====== Android Development ====== ===== CS0 (7/17/2012) ===== To install SL4A and Python for Android on an Android device (e.g., Kindle Fire)... - Visit http://code.google.com/p/android-scripting/downloads/list and select Featured Downloads to get the latest versions. - Download and install SL4A: http://code.google.com/p/android-scripting/downloads/detail?name=sl4a_r6.apk - Download and install Python For Android: http://code.google.com/p/android-scripting/downloads/detail?name=PythonForAndroid_r4.apk To copy a script to the SL4A script directory for easy execution... - Install Android SDK onto your computer, so that adb is in your path and you can connect your Android device. (See http://developer.android.com/sdk.) $ adb push fetch.py /mnt/sdcard/sl4a/scripts/ To edit Python scripts on a workstation and push to a connected Kindle Fire... - See full instructions at http://code.google.com/p/android-scripting/wiki/RemoteControl. - Connect Android device to workstation with Android SDK installed. - From SL4A Scripts screen -> Menu -> View -> Interpreters - Set server to use port 4242: Menu -> Preferences -> Server Port -> 4242 - Start server on Android device: Menu -> Start Server -> Private. - Set environment variable with local port (used by android.py): ''typeset -x AP_PORT=4242'' - Forward local port on workstation to Android device: ''adb forward tcp:4242 tcp:4242'' - Download android.py to workstation workspace: http://android-scripting.googlecode.com/hg/python/ase/android.py - Run Python and play... $ python Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import android >>> android = android.Android() >>> android.makeToast('hello there') ===== CS1 (8/14/2009) ===== These notes are based on a Windows 7 environment and Android G1 development unit. Instructions based on [[http://developer.android.com/guide/developing/other-ide.html|Developing in Other IDEs]] from [[http://developer.android.com|Android developer site]]. Download and install [[http://www.drjava.org|DrJava]] (current stable release). Download and install the [[http://developer.android.com/sdk/1.5_r3/index.html|Android SDK]] (need additional details of what to do with the zip file).