1. Copy the android-project directory wherever you want your Android project to go
1. Copy the android-project directory wherever you want to keep your projects and rename it to the name of your project.
2. Move this SDL directory into the <project>/jni directory
3. Place your application source files in the <project>/jni/src directory
4. Edit <project>/jni/src/Android.mk to include your source files
...
...
@@ -35,16 +40,54 @@ If you want to use the Eclipse IDE, skip to the Eclipse section below.
creates a .apk with the native code embedded
8. 'ant install' will push the apk to the device or emulator (if connected)
Here's an explanation of the files in the Android project, so you can customize them:
android-project/
AndroidManifest.xml - package manifest, do not modify
build.properties - empty
build.xml - build description file, used by ant
default.properties - holds the ABI for the application, currently android-4 which corresponds to the Android 1.6 system image
local.properties - holds the SDK path, you should change this to the path to your SDK
jni/ - directory holding native code and Android.mk
jni/Android.mk - Android makefile that includes all subdirectories
jni/SDL/ - directory holding the SDL library files
jni/SDL/Android.mk - Android makefile for creating the SDL shared library
jni/src/ - directory holding your application source
jni/src/Android.mk - Android makefile that you should customize to include your source code and any library references
res/ - directory holding resources for your application
res/drawable-* - directories holding icons for different phone hardware
res/layout/main.xml - place holder for the main screen layout, overridden by the SDL video output
res/values/strings.xml - strings used in your application, including the application name shown on the phone.
src/org/libsdl/app/SDLActivity.java - the Java class handling the initialization and binding to SDL. Be very careful changing this, as the SDL library relies on this implementation.
The documentation in the NDK docs directory is very helpful in understanding the build process and how to work with native code on the Android platform.