Android Python get gps status

user1224214 picture user1224214 · Feb 21, 2012 · Viewed 7.8k times · Source

New to Android Python scriptring comming from Symbian PyS60. I want to port my gps info PyS60 app to Android sl4a Python. I can get the location but that is about all. From API docs and Java examples it would seem that something like: import android.location.LocationManager as lm satus = lm.getGpsStatus() would do the trick but I am getting nowhere. Please help me on track (cython perhaps???) Thanks, Janwillem

Answer

XcinnaY picture XcinnaY · Feb 28, 2012

a short example of python code using the GPS:

import android, string, time
droid = android.Android()
droid.startLocating()
time.sleep(10)
l = droid.readLocation()

I found this in the tutorial page of sl4a http://code.google.com/p/android-scripting/wiki/Tutorials one of them is called: "Track where you go! Lua sample and python scripts to track your location."

the complete doc is in LocationFacade Here: http://www.mithril.com.au/android/doc/