Skip to content

Native Activity

Duy Tran Le edited this page Jun 7, 2018 · 5 revisions

Native Activity

Sample: native-activity The native-activity sample resides under the NDK installation root, in samples/native-activity. It is a very simple example of a purely native application, with no Java source code. In the absence of any Java source, the Java compiler still creates an executable stub for the virtual machine to run. The stub serves as a wrapper for the actual, native program, which is located in the .so file.

The app itself simply renders a color onto the entire screen, and then changes the color partly in response to movement that it detects.

Example from https://developer.android.com/ndk/samples/sample_na

See video demo https://www.youtube.com/watch?v=rS4FtvXPE8M

  1. Click File menu, then select Open file
  1. Go to directory /sdcard/CPlusPlusNIDE/Examples/native-activity and select native-activity.c to open it
  1. Select native-activity.c to open it
  1. Now click Run button on the action bar
  2. You can enter CFLAGS, CXXFLAGS or LDFLAGS if need needed. In this case, just click Build button
  1. Wait for build complete and see result, perfect.
Clone this wiki locally