User Tools

Site Tools


android:scripts

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
android:scripts [2011/03/02 23:33] cedricandroid:scripts [2011/03/03 08:06] cedric
Line 1: Line 1:
 ====== Python ====== ====== Python ======
 ===== Location ===== ===== Location =====
 +<code python>
 +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)
 +</code>
 +
 +
 +{{tag>cs_lang:python python gps location android google}}
android/scripts.txt · Last modified: 2011/03/03 08:09 by cedric