# shows a notification with your locationBased on the notify_weather.py example script and some trying and guessing based on the Geocode API documentation.
# johan@vorrrm.nl - (c) 2010
import android
droid = android.Android()
location = droid.getLastKnownLocation().result
address = droid.geocode(location['latitude'], location['longitude'])
street = address.result['result'][0]['thoroughfare']
postalcode = address.result['result'][0]['postal_code']
city = address.result['result'][0]['locality']
droid.makeToast("%s - %s %s" % (street, postalcode, city) )
droid.exit()
Documenting my progress with programming for Android.
2010-04-21
Where Am I
whereami.py
Subscribe to:
Post Comments (Atom)
About Me
- Johan
- interactie ontwerper
Yay, I found out that simply printing the results of a function also reveals its structure. E.g.: 'print address' shows the complete contents of the variable.
ReplyDelete