Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Latest commit 676d555 Dec 10, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
androidnative Added C++ library example (with build command line) May 17, 2017
input added java source files May 2, 2017
java_src Initial commit May 4, 2017
lib_src Added C++ library example (with build command line) May 17, 2017
main Cleaned up example Dec 10, 2018
.gitignore Initial commit Jan 10, 2017
README.md Cleaned up example Dec 10, 2018
androidnativeext.png Cleaned up example Dec 10, 2018
game.project Cleaned up example Dec 10, 2018

README.md

Android Extension

50 points

This is a small example of how to implement native extensions for Android

It features .java files, .jar files, resources, and native function calls (vibration)

Resources

If you put the resources under myext/res/android/res they will be picked up as regular Android resources, and as such, they need to conform to the naming standards of Android resources

JNI

To be able to communicate between C++ and Java, you use JNI Calls. Some resources:

Build .jar Files

We've added a small example of how to build a .jar file from .java source. Simply open a command prompt and go to the java_src folder, and run the build.sh file. It requires javac which you'll get when you install the Java SE Development Kit

Note that we use the flags -source 1.6 -target 1.6 due to the fact that we support many older Android devices.

Build .a Files

To show you how to create a C++ library file on your own, we've added a small example for this. Simply open a command prompt and go to the java_src folder, and run the build.sh file. It requires that you have installed an Android SDK and NDK.

NOTE: You may have to alter your "lib_src/build.sh" script with the appropriate paths to your local android tools
You can’t perform that action at this time.