Game Development Reference
In-Depth Information
Testing the App on a Device
To run your app on the device, you must create a Run configuration and fire up the emulator.
Follow these steps:
1.
Select Run Configurations from the main menu.
2.
In the Run Configurations dialog box, right-click Android Application
in the left list and choose New.
3.
Enter a configuration name ( ch02.Project ) and select a project
( ch02.Project ), as shown in Figure 2-14 . Then click Run.
Figure 2-14. Run Configurations dialog box for the project
The application runs in the emulator and displays the text “Hello Chapter2! My first Android
NDK/JNI Project” There is nothing out of the ordinary here (see Figure 2-15 ). You must look
at the logcat view to see the messages from the native layer.
In the output, notice the following lines:
Trying to load lib /data/data/ch02.project/files/libch02.so ...
Added shared lib /data/data/ch02.project/files/libch02.so ...
These are JNI messages that tell you the library loaded successfully and the native methods
can now be invoked within Java.
 
Search WWH ::




Custom Search