README.android
author Sam Lantinga <slouken@libsdl.org>
Tue, 04 Jan 2011 18:55:23 -0800
changeset 4958 47e9f1629e62
parent 4954 144d9df7e611
child 4964 6c645018741e
permissions -rw-r--r--
We don't need these scripts anymore
paul@4727
     1
================================================================================
paul@4726
     2
Simple DirectMedia Layer for Android
paul@4727
     3
================================================================================
paul@4725
     4
paul@4725
     5
Requirements: Android NDK r4 or later
paul@4725
     6
paul@4727
     7
================================================================================
paul@4727
     8
 How the port works
paul@4727
     9
================================================================================
paul@4727
    10
paul@4727
    11
- Android applications are Java-based, optionally with parts written in C
paul@4727
    12
- As SDL apps are C-based, we use a small Java shim that uses JNI to talk to 
paul@4727
    13
the SDL library
paul@4727
    14
- This means that your application C code must be placed inside an android 
paul@4727
    15
Java project, along with some C support code that communicates with Java
paul@4727
    16
- This eventually produces a standard Android .apk package
paul@4727
    17
paul@4727
    18
paul@4727
    19
paul@4727
    20
paul@4727
    21
paul@4727
    22
paul@4727
    23
================================================================================
paul@4727
    24
 Building an app
paul@4727
    25
================================================================================
paul@4727
    26
paul@4725
    27
Instructions:
paul@4725
    28
1. Edit android/config.cfg to point to the location of the NDK
paul@4725
    29
2. Run 'make -f Makefile.android'. If all goes well, libsdl.a should be created
paul@4727
    30
3. Place your application source files in android/project/jni
paul@4727
    31
4. Edit the Android.mk to include your source files
paul@4727
    32
5. Run 'ndk-build' (a script provided by the NDK). This compiles the C source
slouken@4954
    33
6. Edit project/local.properties to point to the SDK directory
slouken@4954
    34
6. Run 'ant debug' in android/project. This compiles the .java and eventually 
paul@4725
    35
creates a .apk with the C source embedded
paul@4727
    36
7. 'ant install' will push the apk to the device or emulator (if connected)
paul@4725
    37
paul@4725
    38
paul@4727
    39
paul@4727
    40
paul@4727
    41
================================================================================
paul@4727
    42
 Known issues
paul@4727
    43
================================================================================
paul@4727
    44
paul@4727
    45
- SDL audio (although it's mostly written, just not working properly yet)
paul@4727
    46
- TODO. I'm sure there's a bunch more stuff I haven't thought of