need android
Make sure we have android.py
http://android-scripting.googlecode.com/hg/python/ase/android.py
Connect USB (make sure debugging option is enabled).
Start a private server.
Menu -> View -> Interpreters
Menu -> Start Server -> Private
Go to the home screen
Menu -> Notifications
Look for "SLA4A Service Tap to view running scripts" and tap lightly.
Should see something like "127.0.0.1:45027", we want the bit after the colon i.e. 45027. Your number maybe different.
Setup forwarding.
$ adb forward tcp:9999 tcp:45027
Should see something like
* daemon not running. starting it now on port 5037 * * daemon started successfully *Now setup PORT info for Python.py
$ setenv AP_PORT 9999Test it using
echo $AP_PORTYou should see
9999Speaking with repeat http://www.submergedspaceman.com/blog/2010/02/16/android-scripting-environment-is-incredible-part-i/ Testing over ITS Example of Course for Third Graders http://davidbau.com/python/learning.html Barcode
import android droid = android.Android() code = droid.scanBarcode() isbn = int(code['result']['SCAN_RESULT']) url = “http://books.google.com?q=%d” % isbn droid.startActivity(‘android.intent.action.VIEW’, url)http://www.mattcutts.com/blog/android-barcode-scanner/ Need barcode scanner installed (example of extending Android platform). Barcode scanner would be good. One person wrote a script to go into silent mode when the phone is placed screen-down on the table. It took less than 20 lines of code, and that’s including comments! THINGS TO DO -- WRITE SCRIPT TO LAUNCH THE ADB SERVER STUFF ON THE PHONE, SIMPLIFY SENDING THE FILES TO THE PHONE THINGS TO DO -- SILENT NIGHT: https://github.com/docblades/Silent-Night Nice use of the sensor. http://www.brokenairplane.com/2011/08/im-not-texting-im-programming.html Unwanted numbers https://github.com/punchagan/v_block Other stuff Pygame simplified. http://pygame.renpy.org/ Download the zip file and unpack. It creates quite a complex directory. Next step is to try running android.py, first step is to test the install. ./android.py test You should get All systems go! Now try installing. ./android.py installsdk It checks if JDK is present and downloads lots of stuff, for some reason that absolutely evades me it wants to install the Android SDK - WTF!? Ok, stopped that. Let's see if can get by without it. So ... first, created mygame. Now try. android.py configure mygame Ok had to download android.py and it expects the remote mode to be running.