UP | HOME

android

Table of Contents

Develop Android Program by using Py4A 2012-04-19 Thu

  • download and installation
    • install Android SDK in computer
    • download android.py in computer
    • install SL4A in phone
    • install Py4A in phone
  • enable USB debugging in phone
  • connect phone and computer with USB
  • start private server in phone: SL4A -> menu -> View -> Interperters -> Menu -> Start Server -> Private
  • get server port: status bar in phone -> SL4A Service
  • adb forwarding: adb forward tcp:9999 tcp:4321 when 4321 is server port
  • set up an environment variable (APPORT): export AP_PORT=9999
  • change to directory of android.py, and run python or python scripts
  • put script into phone: adb push my_script.py /sdcard/sl4a/scripts
  • stop adb forwarding: adb kill-server

more info: http://code.google.com/p/android-scripting/wiki/RemoteControl

Connect to laptop via wifi

why? use DroidPad to control my laptop, as joystick or mouse and presenster. If there is a wifi network avaiable, it is easy, but if not, we have to connect them directly.

Windows 7

Use connectify for windows to create a wifi network.

Linux

unfortunately there is no alternative of connectify in Linux, but there are two ways to work out:

create a AP by hostapd

use the simple configure file for hostapd:

interface=wlan0
driver=nl80211
ssid=SL400
channel=1
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=3
wpa_passphrase=informatik
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

but then, I have problem to start DHCP service…

connect by Ad Hoc

because the Android 2.2 can not find Ad Hoc network, it is a software problem, and it can be fixed, but needs root.

© 2012-05-17 22:26:31 CEST Xu Yuan (xuyuan.cn@gmail.com) Proudly powered by Org version 7.8.10 with Emacs version 24. Validate XHTML 1.0