You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Move platform-specific documentation to `winit::platform` module
* Document cargo features in crate docs
* Move version requirements to crate-level docs
|`NativeActivity`|`android-native-activity`| Built-in to Android - it is possible to use without compiling any Java or Kotlin code. Java or Kotlin code may be needed to subclass `NativeActivity` to access some platform features. It does not derive from the [`AndroidAppCompat`] base class.|
145
-
|[`GameActivity`]|`android-game-activity`| Derives from [`AndroidAppCompat`], a defacto standard `Activity` base class that helps support a wider range of Android versions. Requires a build system that can compile Java or Kotlin and fetch Android dependencies from a [Maven repository][agdk_jetpack] (or link with an embedded [release][agdk_releases] of [`GameActivity`]) |
For more details, refer to these `android-activity`[example applications](https://github.com/rust-mobile/android-activity/tree/main/examples).
155
-
156
-
##### Converting from `ndk-glue` to `android-activity`
157
-
158
-
If your application is currently based on `NativeActivity` via the `ndk-glue` crate and building with `cargo apk`, then the minimal changes would be:
159
-
1. Remove `ndk-glue` from your `Cargo.toml`
160
-
2. Enable the `"android-native-activity"` feature for Winit: `winit = { version = "0.29.10", features = [ "android-native-activity" ] }`
161
-
3. Add an `android_main` entrypoint (as above), instead of using the '`[ndk_glue::main]` proc macro from `ndk-macros` (optionally add a dependency on `android_logger` and initialize logging as above).
162
-
4. Pass a clone of the `AndroidApp` that your application receives to Winit when building your event loop (as shown above).
163
-
164
-
#### MacOS
165
-
166
-
A lot of functionality expects the application to be ready before you start
167
-
doing anything; this includes creating windows, fetching monitors, drawing,
168
-
and so on, see issues [#2238], [#2051] and [#2087].
169
-
170
-
If you encounter problems, you should try doing your initialization inside
171
-
`Event::Resumed`.
172
-
173
-
#### iOS
174
-
175
-
Similar to macOS, iOS's main `UIApplicationMain` does some init work that's required
176
-
by all UI-related code (see issue [#1705]). It would be best to consider creating your windows
//! | `NativeActivity` | `android-native-activity` | Built-in to Android - it is possible to use without compiling any Java or Kotlin code. Java or Kotlin code may be needed to subclass `NativeActivity` to access some platform features. It does not derive from the [`AndroidAppCompat`] base class.|
48
+
//! | [`GameActivity`] | `android-game-activity` | Derives from [`AndroidAppCompat`], a defacto standard `Activity` base class that helps support a wider range of Android versions. Requires a build system that can compile Java or Kotlin and fetch Android dependencies from a [Maven repository][agdk_jetpack] (or link with an embedded [release][agdk_releases] of [`GameActivity`]) |
//! For more details, refer to these `android-activity` [example applications](https://github.com/rust-mobile/android-activity/tree/main/examples).
58
+
//!
59
+
//! ## Converting from `ndk-glue` to `android-activity`
60
+
//!
61
+
//! If your application is currently based on `NativeActivity` via the `ndk-glue` crate and building with `cargo apk`, then the minimal changes would be:
62
+
//! 1. Remove `ndk-glue` from your `Cargo.toml`
63
+
//! 2. Enable the `"android-native-activity"` feature for Winit: `winit = { version = "0.29.10", features = [ "android-native-activity" ] }`
64
+
//! 3. Add an `android_main` entrypoint (as above), instead of using the '`[ndk_glue::main]` proc macro from `ndk-macros` (optionally add a dependency on `android_logger` and initialize logging as above).
65
+
//! 4. Pass a clone of the `AndroidApp` that your application receives to Winit when building your event loop (as shown above).
0 commit comments