README.android
changeset 4965 91d0085b7560
parent 4964 6c645018741e
child 4967 f74a3f94c408
     1.1 --- a/README.android	Thu Jan 06 16:11:21 2011 -0800
     1.2 +++ b/README.android	Thu Jan 06 17:12:31 2011 -0800
     1.3 @@ -2,8 +2,13 @@
     1.4  Simple DirectMedia Layer for Android
     1.5  ================================================================================
     1.6  
     1.7 -Requirements: Android SDK and Android NDK r4 or later
     1.8 -http://developer.android.com/
     1.9 +Requirements:
    1.10 +
    1.11 +Android SDK
    1.12 +http://developer.android.com/sdk/index.html
    1.13 +
    1.14 +Android NDK r4 or later
    1.15 +http://developer.android.com/sdk/ndk/index.html
    1.16  
    1.17  ================================================================================
    1.18   How the port works
    1.19 @@ -22,7 +27,7 @@
    1.20  ================================================================================
    1.21  
    1.22  Instructions:
    1.23 -1. Copy the android-project directory wherever you want your Android project to go
    1.24 +1. Copy the android-project directory wherever you want to keep your projects and rename it to the name of your project.
    1.25  2. Move this SDL directory into the <project>/jni directory
    1.26  3. Place your application source files in the <project>/jni/src directory
    1.27  4. Edit <project>/jni/src/Android.mk to include your source files
    1.28 @@ -35,16 +40,54 @@
    1.29  creates a .apk with the native code embedded
    1.30  8. 'ant install' will push the apk to the device or emulator (if connected)
    1.31  
    1.32 +Here's an explanation of the files in the Android project, so you can customize them:
    1.33 +
    1.34 +android-project/
    1.35 +	AndroidManifest.xml	- package manifest, do not modify
    1.36 +	build.properties	- empty
    1.37 +	build.xml		- build description file, used by ant
    1.38 +	default.properties	- holds the ABI for the application, currently android-4 which corresponds to the Android 1.6 system image
    1.39 +	local.properties	- holds the SDK path, you should change this to the path to your SDK
    1.40 +	jni/			- directory holding native code and Android.mk
    1.41 +	jni/Android.mk		- Android makefile that includes all subdirectories
    1.42 +	jni/SDL/		- directory holding the SDL library files
    1.43 +	jni/SDL/Android.mk	- Android makefile for creating the SDL shared library
    1.44 +	jni/src/		- directory holding your application source
    1.45 +	jni/src/Android.mk	- Android makefile that you should customize to include your source code and any library references
    1.46 +	res/			- directory holding resources for your application
    1.47 +	res/drawable-*		- directories holding icons for different phone hardware
    1.48 +	res/layout/main.xml	- place holder for the main screen layout, overridden by the SDL video output
    1.49 +	res/values/strings.xml	- strings used in your application, including the application name shown on the phone.
    1.50 +	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.
    1.51 +
    1.52 +
    1.53 +================================================================================
    1.54 + Additional documentation
    1.55 +================================================================================
    1.56 +
    1.57 +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.
    1.58 +
    1.59 +The best place to start is with docs/OVERVIEW.TXT
    1.60 +
    1.61  
    1.62  ================================================================================
    1.63   Using Eclipse
    1.64  ================================================================================
    1.65  
    1.66 -NEED CONTENT
    1.67 +First make sure that you've installed Eclipse and the Android extensions as described here:
    1.68 +	http://developer.android.com/sdk/eclipse-adt.html
    1.69 +
    1.70 +Once you've copied the SDL android project and customized it, you can create an Eclipse project from it:
    1.71 + * File -> New -> Other
    1.72 + * Select the Android -> Android Project wizard and click Next
    1.73 + * Enter the name you'd like your project to have
    1.74 + * Select "Create project from existing source" and browse for your project directory
    1.75 + * Make sure the Build Target is set to Android 1.6
    1.76 + * Click Finish
    1.77  
    1.78  
    1.79  ================================================================================
    1.80 - Loading files
    1.81 + Loading files and resources
    1.82  ================================================================================
    1.83  
    1.84  NEED CONTENT
    1.85 @@ -54,7 +97,20 @@
    1.86   Troubleshooting
    1.87  ================================================================================
    1.88  
    1.89 -NEED CONTENT
    1.90 +You can create and run an emulator from the Eclipse IDE:
    1.91 + * Window -> Android SDK and AVD Manager
    1.92 +
    1.93 +You can see if adb can see any devices with the following command:
    1.94 +	adb devices
    1.95 +
    1.96 +You can see the output of log messages on the default device with:
    1.97 +	adb logcat
    1.98 +
    1.99 +You can push files to the device with:
   1.100 +	adb push local_file remote_path_and_file
   1.101 +
   1.102 +You can push files to the SD Card at /sdcard, for example:
   1.103 +	adb push moose.dat /sdcard/moose.dat
   1.104  
   1.105  
   1.106  ================================================================================