lunedì 2 gennaio 2012

GPS+Python+Android


Un esempio base per la gestione del GPS su Android via Python
(molto molto grezzo ma funzionante)

------------------------------------------------------------------------------------
import android, math
from time import sleep
droid = android.Android()
droid.startLocating()




title = ''
message = 'Acquisizione del punto'
droid.dialogCreateSpinnerProgress(title, message)
droid.dialogShow()
sleep(15)
droid.dialogDismiss()


location = droid.readLocation().result


if location == {}:
        location = droid.getLastKnownLocation().result


print location
print location['gps']
print location['network']
print location['network']['latitude']
print location['network']['longitude']
print location['network']['altitude']
print location['network']['accuracy']
print location['network']['speed']

Nessun commento:

Posta un commento

FTP Bash script

 Uno script rubato su stack overflow per fare l'upload automatico su FTP senza criptazione   #!/bin/sh HOST='ftp.xxxxx.altervista.or...