User Tools

Site Tools


android:scripts

These scripts require the installation of SL4A.

Python

Location

import android, time
droid = android.Android()
 
droid.startLocating()
time.sleep(10)
 
while True:
    l = droid.readLocation().result
 
    # provider = network or GPS
    latitude = l['network']['latitude']
    longitude = l['network']['longitude']
 
    print latitude, longitude
 
    time.sleep(10)
android/scripts.txt · Last modified: 2011/03/03 08:09 by cedric