Skip to content

Commit fa71ca4

Browse files
committed
Update the native-activity README.
I changed what this sample does but forgot to update the docs.
1 parent 3d0e23e commit fa71ca4

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

native-activity/README.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
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

723
This sample uses the new
824
[Android Studio CMake plugin](http://tools.android.com/tech-docs/external-c-builds)

0 commit comments

Comments
 (0)