File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change 11# Native Activity
22
3- Native Activity is an Android sample that initializes a GLES 2.0 context and
4- reads accelerometer data from C code using
5- [ Native Activity] ( http://developer.android.com/reference/android/app/NativeActivity.html ) .
3+ This is an Android sample that uses [ NativeActivity] with ` native_app_glue ` ,
4+ which enables building NDK apps without having to write any Java code. In
5+ practice most apps, even games which are predominantly native code, will need to
6+ call some Java APIs or customize their app's activity further.
7+
8+ The more modern approach to this is to use [ GameActivity] , which has all the
9+ same benefits as ` NativeActivity ` and ` native_app_glue ` , while also making it
10+ easier to include Java code in your app without a rewrite later. It's also
11+ source compatible. This sample will likely migrate to ` GameActivity ` in the
12+ future.
13+
14+ The app here is intentionally quite simple, aiming to show the core event and
15+ draw loop necessary for an app using ` native_app_glue ` without any extra
16+ clutter. It uses ` AChoreographer ` to manage the update/render loop, and uses
17+ ` ANativeWindow ` and ` AHardwareBuffer ` to update the screen with a simple color
18+ clear.
19+
20+ [ GameActivity ] : https://developer.android.com/games/agdk/game-activity
21+ [ NativeActivity ] : http://developer.android.com/reference/android/app/NativeActivity.html
622
723This sample uses the new
824[ Android Studio CMake plugin] ( http://tools.android.com/tech-docs/external-c-builds )
You can’t perform that action at this time.
0 commit comments