README.android
author Sam Lantinga <slouken@libsdl.org>
Thu, 06 Jan 2011 16:11:21 -0800
changeset 4964 6c645018741e
parent 4954 144d9df7e611
child 4965 91d0085b7560
permissions -rw-r--r--
Build the SDL library as a shared object on Android, so it will work correctly with SDL_image and SDL_ttf.
     1 ================================================================================
     2 Simple DirectMedia Layer for Android
     3 ================================================================================
     4 
     5 Requirements: Android SDK and Android NDK r4 or later
     6 http://developer.android.com/
     7 
     8 ================================================================================
     9  How the port works
    10 ================================================================================
    11 
    12 - Android applications are Java-based, optionally with parts written in C
    13 - As SDL apps are C-based, we use a small Java shim that uses JNI to talk to 
    14 the SDL library
    15 - This means that your application C code must be placed inside an android 
    16 Java project, along with some C support code that communicates with Java
    17 - This eventually produces a standard Android .apk package
    18 
    19 
    20 ================================================================================
    21  Building an app
    22 ================================================================================
    23 
    24 Instructions:
    25 1. Copy the android-project directory wherever you want your Android project to go
    26 2. Move this SDL directory into the <project>/jni directory
    27 3. Place your application source files in the <project>/jni/src directory
    28 4. Edit <project>/jni/src/Android.mk to include your source files
    29 5. Run 'ndk-build' (a script provided by the NDK). This compiles the C source
    30 
    31 If you want to use the Eclipse IDE, skip to the Eclipse section below.
    32 
    33 6. Edit <project>/local.properties to point to the Android SDK directory
    34 7. Run 'ant debug' in android/project. This compiles the .java and eventually 
    35 creates a .apk with the native code embedded
    36 8. 'ant install' will push the apk to the device or emulator (if connected)
    37 
    38 
    39 ================================================================================
    40  Using Eclipse
    41 ================================================================================
    42 
    43 NEED CONTENT
    44 
    45 
    46 ================================================================================
    47  Loading files
    48 ================================================================================
    49 
    50 NEED CONTENT
    51 
    52 
    53 ================================================================================
    54  Troubleshooting
    55 ================================================================================
    56 
    57 NEED CONTENT
    58 
    59 
    60 ================================================================================
    61  Known issues
    62 ================================================================================
    63 
    64 - SDL audio (although it's mostly written, just not working properly yet)
    65 - TODO. I'm sure there's a bunch more stuff I haven't thought of