On Android, we can use Qpython to write and execute Python scripts. It on many Android
The system functions are conveniently encapsulated, and it is easy to use Qpython to write small programs with simple functions.
This example is the underlying script that I used to read the phone's location information and serve as a further process for processing the data.
#-*-coding:utf-8-*-ImportAndroidhelperImport Time fromMathImportradiansdroid=Androidhelper. Android () droid.startsensingtimed (1, 250) droid.startlocating () while1: Gpsdata=droid.readlocation (). Result S6data=droid.sensorsreadorientation (). ResultifLen (Gpsdata) >0:Printgpsdata['GPS']['Bearing']#Get GPS Guide (bearing) (angle) ifLen (S6data) >0:PrintS6DATA[0]#Get Compass Azimuth (azimuth) (radians)Time.sleep (0.5) droid.stoplocating () droid.stopsensing ()
Write Python to get GPS and posture information for Android devices