Changes between Version 33 and Version 34 of SeattleOnAndroid

Changes between Version 33 and Version 34 of SeattleOnAndroid

Please note that these Trac pages are no longer being updated. Wiki contents/documentation have moved to GitHub.

Changes between Version 33 and Version 34 of SeattleOnAndroid

Please note that these Trac pages are no longer being updated. Wiki contents/documentation have moved to GitHub.

Changes between Version 33 and Version 34 of SeattleOnAndroid

Show
Ignore:
Timestamp:
11/08/12 00:57:20 (7 years ago)
Author:
albert
Comment:

Removed some factual inaccuracy

Legend:

Unmodified
Added
Removed
Modified
  • SeattleOnAndroid

    v33 v34  
    1515Here is a general outline of steps to be performed. You will get access to Python, Repy (Seattle's runtime), and the Seattle Node Manager, respectively. 
    1616 1. Set up [http://code.google.com/p/android-scripting/wiki/InstallingInterpreters Python for Android (Py4A)]. 
    17  1. [wiki:RepoAccess#Anonymousaccess Check out] the latest version of Seattle from SVN (r5656 and later should work): {{{svn co https://seattle.cs.washington.edu/svn/seattle/}}} The code is available at seattle/trunk/dist/android 
    18  1. Install Seattle on the command line. This won't give you autostart capabilities, though. Import the code in seattle/trunk/dist/android as an "existing android project" from within Eclipse. Then just "run as" on the android emulator or your device.  
     17 1. [wiki:RepoAccess Check out] the latest version of Seattle from SVN (r5656 and later should work): {{{svn co https://seattle.cs.washington.edu/svn/seattle/}}} 
     18 1. Install Seattle on the command line. This won't give you autostart capabilities, though. 
    1919 
    20 PS: Quite a few command line settings on this page requires your device to be rooted, ie, you need root privilege on your phone to run these settings. How to root a device largely depends on the phone, Android version, etc. Fortunately [http://www.cyanogenmod.org/ CyanogenMod] firmware is rooted by default. I will use a separate page for rooting a device, but still, my example may not apply to you.  
     20(If you want to work on the SeattleOnAndroid GUI (not discussed here), import the code in {{{seattle/trunk/dist/android}}} as an "existing Android project" from within Eclipse. Then just "run as" on the android emulator or your device.) 
    2121 
    22 PPS: Terminal commands on android are either the limited version of standard Linux, or even not implemented (when you use adb shell, you can see all of the implemented commands in /system/bin). There is an app called Busybox in Play store which has better implementation of many (but not all) commands. But to use Busybox, your device needs to be rooted.  
     22Quite a few command line settings on this page requires your device to be rooted, i.e., you need root privilege on your phone to run these settings. How to root a device largely depends on the phone, Android version, etc. Fortunately [http://www.cyanogenmod.org/ CyanogenMod] firmware is rooted by default. 
     23 
     24PS: Terminal commands on Android are either the limited version of standard Linux, or even not implemented (when you use {{{adb shell}}}, you can see all of the implemented commands in {{{/system/bin}}}). There is an app called Busybox in Play store which has better implementation of many (but not all) commands. To use Busybox, your device needs to be rooted.  
    2325 
    2426 
     
    3133=== Python from shell === 
    3234 
    33 To get shell access to your device, run {{{adb shell}}} which comes within your android-sdk/platform-tools (the location may vary depending on your OS or other settings). [http://developer.android.com/tools/help/adb.html adb] is Android debug bridge, which lets you communicate with an emulator instance or connected Android device.  
     35To get shell access to your device, run {{{adb shell}}} which comes within your android-sdk/platform-tools (the location may vary depending on your OS or other settings). [http://developer.android.com/tools/help/adb.html adb] is Android debug bridge, which lets you communicate with a connected Android device or emulator instance.  
    3436 
    3537Shell access to the Python interpreter is tricky to add because the shell knows nothing about Python's paths yet. Depending on which shell you have, there are different routes to take from here. Be sure to adapt the actual paths to your device/installation. 
     
    3739For {{{sh}}} (which is the default shell also greeting you via [http://developer.android.com/guide/developing/tools/adb.html adb]'s {{{shell}}} command), I don't know yet where it takes its run commands (.shrc) from. If you have [https://github.com/jackpal/Android-Terminal-Emulator/wiki Jackpal's AndroidTerm2] installed, you could write an rc script and configure !AndroidTerm to run it on startup: Press ''Menu'', go to ''Settings > Start command'' and enter /path/to/your/script. 
    3840 
    39 For {{{bash}}}, mount {{{/system/etc}}} writable by issuing {{{mount -o rw,remount /system}}} as the superuser (you need a rooted device here). Add the following lines to {{{/system/etc/bash/bashrc}}} : 
     41For {{{bash}}}, mount {{{/system/etc}}} writable by issuing {{{mount -o rw,remount /system}}} as the superuser (you need a rooted device here). Add the following lines to {{{/system/etc/bash/bashrc}}} (The last line puts the Python interpreter on your {{{$PATH}}}, so you can type {{{python}}} to access it right away): 
     42 
    4043{{{ 
    4144export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/data/com.googlecode.pythonforandroid/files/python/lib 
     
    4649}}} 
    4750 
    48 (The last line is needed to make the {{{Popen}}} calls to the Python interpreter work). These lines are inspired by [http://code.google.com/p/python-for-android/source/browse/python-build/standalone_python.sh this file in the Py4A repository]. 
     51These lines are inspired by [http://code.google.com/p/python-for-android/source/browse/python-build/standalone_python.sh this file in the Py4A repository]. 
    4952 
    5053{{{ 
     
    6467 1. Finally, upload the contents of {{{/path/to/files}}} to your Android device, e.g. using {{{adb push /target /seattle/on/android/directory}}}. 
    6568 
    66 Meanwhile, to allow RePy collect data from your phone, you have to get [https://seattle.cs.washington.edu/wiki/UsingSensors Seattle Sensor] running. Seattle and Sensor communicate with each other via XML-RPC.  
     69If you want to allow Repy to collect data from your phone, you have to get a [https://seattle.cs.washington.edu/wiki/UsingSensors Seattle Sensor] running. [https://play.google.com/store/apps/details?id=at.univie.sensorium Here] is one implementation that interfaces lots of sensors on your Android device, and makes values available in a GUI and programmatically over an XML-RPC interface. 
    6770 
    6871Congrats, now you can run {{{python repy.py restrictions.that_you_have your_script.repy}}} from the command line!