| Newsgroups |
alt.alt |
| Message-ID |
<[email protected]> |
import android
import sys, select, os
zooz = android.Android()
zooz.eventClearBuffer()
zooz.startLocating()
ziz = zooz.eventWaitFor('location',10000).result
lat = repr(ziz['data']['gps']['latitude'])
lng = repr(ziz['data']['gps']['longitude'])
sea = repr(ziz['data']['gps']['altitude'])
acu = repr(ziz['data']['gps']['accuracy'])
spd = repr(ziz['data']['gps']['speed'])
if ziz['name'] == "location":
try:
eah = "1"
except KeyError:
eah = "0"
zubs = "[E:" + eah + "]"
# zooz.stopLocating()
# zooz.startLocating()
# Trying supposedly valid keywords 'network' and 'passive' gets all fucky
# nwlat = repr(ziz['data']['passive']['latitude'])
# nwlng = repr(ziz['data']['passive']['longitude'])
zooz.stopLocating()
gpstype = "#"
print (zubs + "[GPS]==========")
place = "LT:"+ lat + "-" + gpstype
print (place)
place = "LG:"+ lng + "-" + gpstype
print (place)
# -----misc
# BAD int seal
# convert to float for math then convert back
sealt = float(sea)
seal = sealt * 3.2808333
seal = str(seal)
speed = spd
accu = acu
misk = "SEA(ft/mtr):" + seal + "/" + sea + "#SPEED:" + speed + "#ACCU:" + accu + "_end"
print (misk)
# print ("[CELLTOWER]====")
# place = "nLT:"+ nwlat + "-" + gpstype
# print (place)
# place = "nLG:"+ nwlng + "-" + gpstype
# print (place)
# 36 in + 3.37 is 3 feet 3.37 inches 39.37
# ------RIGHT
# sea * 3.2808333
# ----- WRONG
# sea1 = sea * 3
# sea2 = sea * 3.37
# sea3 = sea1 + sea2
# 2.780