[Q] Android API for GPS location - General Questions and Answers

Hi,
I have Hero H7000 GSM phone with Android 2.2.1. Some application which using GPS data show speed approx. 1,9x higher then real speed. First my idea was about some mistake in sw - behaviour looks like as twice conversion from knots (nm/h) to km/h because (km/h = 1,852x nm/h)... But problem is generic for all applications using GPS data. I was use U-Blox app. for NMEA logging, and in RAW NMEA log zero speed is correctly received. But Android API provide 1,29m/s for applications. Do you have some idea where problem is locate? And idea about how to fix it?
Thanks
SDG

ACTUALIZATION: I made NMEA log (approx. 30km by car). In raw NMEA sentences captured by "u-center" is correct speed. Maximum is around 90km/h. But all applications using Android API show twice more. Please, do you have some idea about repair of this bug?
SDG

Related

Accessing gps and digital compass raw data

Can anyone tell me how I access the gps and digital compass raw data?
I am currently writing an application but am unsure how to access this data from the device.
Thanks,
Michelle
Make a call to the GPS COMM port then parse the NMEA data that streams in to extract what you need, Lat, Long, heading, speed (in knotts) will all be found in the GPRMC line, if you need altitude you will need an extra line from the GPS but the accuracy of altitude is not very good to be honest - what are you scripting? - Mike

G-Force?

Is there any application available that can calculate acceleration (not distance over time but m/s2) and g-force over gps data? I know there are this kind of apps available on devices equipped with g-sensor, but i think this kind of data could be calculated with data got directly from gps...

[Q] GPS position update frequency on WP7 - anything faster than 1Hz?

My Samsung Focus only gets GPS position updates once per second (1Hz). At 100kmph (~62mph), you've already moved ~28meters or 91 feet. Thats pretty inaccurate.
Are there any WP7 phones with built-in GPS that update more frequently than 1Hz?
$40 external Bluetooth GPS units update at 10Hz and some wired usb units update even faster than that. But Microsoft isn't supporting the SPP Bluetooth profile even with Mango update and I see no way to communicate with a generic USB device through the micro-usb port cause you don't get native access to write a driver. So no luck getting external GPS working with the current framework
I'd like to build a list of the GPS update frequency of the various phones out there. Hopefully they are not all using the same crappy GPS chip...
10 Hz GPS update will drain your battery much faster... Also, GPS software have some interpolation algorithms. From my own experience with Navigon 3.0: I very like WP7's default GPS accuracy.
Thanks.
I don't care about battery life though; my scenario has power cable available (non-hand-held scenario).
The compass and accelerometer sensors are available on my device but unfortunately the Samsung Focus does not have a gyroscope.
Accelerometer and compass samples at 50Hz, but they are fairly noisy. The new Mango/7.1 Motion API should help filter some of that noise and maybe I could get a reasonably accurate equivalent of a 2Hz GPS with some tricky math.
Double the accuracy is double the accuracy!
BTW, for what kind of tasks you need this accuracy? As I said before, Navigon 3.0 (see corresponding forum) works very fine and precisely, as a standalone Garmin, for example (what is internally also WinCe device ).
I'm not doing GPS maps. Everybody's done that Mine is more of a real-time motion analysis and visualization. I don't want to give away too many details cause I don't want someone to beat me to the punch. I do know that nobody has an app that does what I want on the marketplace yet.
OK, it's up to you. Take a look to my advice : http://forum.xda-developers.com/showpost.php?p=15982827&postcount=574
Sent from my SCH-I800 using XDA Premium App
Oh cool. I wonder if mine is set to 1000 impliying 1Hz updates. 500 would be 2Hz updates.
But I reckon when submitting an app to the marketplace you're not allowed to edit the registry

Understanding Android GPS Architecture

Plz see the Attached GPS Architecture diagram 1st before reading below Article:
Location Services using GPS in Android consist of following Architectural Components
1) GPS Chip
2) GPS Driver
3) GL Engine
4) Android Framework
5) User Applications
Now Lets Understand each
GPS Chip: Radio Frequency Receiver that directly communicates with GPS Satellites
GPS Driver: GPS Driver System Software that uses Low level API’s to Communicate with the GPS chip, at the system level it may consist of a single or multiple files located at /System/Lib/hw/ Or /Vendor/Lib/hw/ files names usually starts with Prefix GPS and Postfix So (i.e gps.default.so or gps.aries.so e.t.c) depending upon the Android version and Smartphone Platform.
GL Engine: Actually the heart of this overall system.
At System level it consist of files at Path /system/bin with names like glgps or gpsd (Platform Specific)
It works using the Configuration Parameters which consist of .xml and .conf files (i.e glconfig.xml, gps.xml, Jupiter.xml, gpsconfig.xml and gps.conf, secgps.conf e.t.c). The Physical Location and names of files again depends upon Android version and Platform, but they are mostly at (/system/etc , /system/etc/gps , /vendor/etc/, /data/gps e.t.c), depending upon the Configuration and Platform, it takes initial Location Information from Cell Towers, then it take it read NVRAM , it is most important as here it store assistance data from GPS Lock, and it may also use xtra data.
NVRAM information is mostly location at /data/gps in a file with .sto ext (i.e gldata.sto) and xtra data files (lto.dat, xtra.bin, epo.dat e.t.c Platform dependent),
Using all this information Gl Engine instruct / Assist the GPS Driver, mostly Gl Engine is able to Detect multiple GPS satellites for which it is GPS driver is Programmed, but to Lock it need some extra information (Timing, Alm. / Emp.e.t.c) which it could either download from GPS satellites (Standalone Mode: very slow speed bits/sec.) or it could use internet to access SUPL/NTP servers (MS Based/MS Assisted Fast speed MB/sec.)
After all this activity, it saves all the data in NVRAM for future use.
Android Location Services : It consist of Android Framework Classes like Location Manager that Provide services to the use applications using the GL Engine.
User Applications: Location services Applications like Google Maps, Sygic, Navigon , TomTom e.t.c.
Keeping all this information in mind now lets see how the GPS Faster Fix Solutions in Market do.
Faster Fix Solutions like GPS Status & Tool Box, GPS Test, GPS Doctor e.t.c mostly handle two things.
1) Download XTRA Data (lto.dat , xtra.bin , epo.dat, gldata.sto e.t.c)
2) Modify GPS.conf (Root Required)
But this not always works.
Devices uses Google as Supl Server but most devices are unable to use it due to invalid/expired certificates and Google servers rejects the Assistance requests in such scenario Users should use SUPL.NOKIA.COM:7275 , which although slow (but something is better then nothing)
If something is wrong with GL Engine or GPS Driver, it may need Re flashing but a little could be done if GPS Chip Reception is Low or Problem is at Hardware Level, some time need soldering skills for hardware alteration (Risky)
http://forum.xda-developers.com/showthread.php?t=1318892
The Other Configuration Parameter which users could modify is xml Configuration file( Take Backup 1st) at Least a Programmer could get Debug Log to understand where things are going wrong, using below parameters.
cLogEnabled="true" acLogDirectory="/sdcard/gps" and LogPriMask, LogFacMask and also DEBUG_LEVEL (gps.conf)
Hope everyone could easily improves their GPS Performance using this guide for any platform.
Wow, thank you, this is very useful!
Neat! Thanks!
hi
can you please explain the extensive location settings from google maps ... i searched google's help and i'm still confused.
for eg, what is the difference between "report from this device" and "enable location history"?
i guess they generate the trafic info using the data from our phones ... how?
thanx!
Happy Holidays! and Happy New Year!
jean2323 said:
hi
can you please explain the extensive location settings from google maps ... i searched google's help and i'm still confused.
for eg, what is the difference between "report from this device" and "enable location history"?
i guess they generate the trafic info using the data from our phones ... how?
thanx!
Happy Holidays! and Happy New Year!
Click to expand...
Click to collapse
'report from this device' is used in latitude. latitude allows you to share your location with your 'friends'. 'enable location history' is for you only and keeps a record of everywhere you go. or at least thats my understanding of it. hope this helps
Thanks for this "sort of" schematic! Keep on making some new schematics! :cyclops:
Dude i dint think ill tamper with gps in my life but the info you provided is just to simple and cool. thanks
mbbauk said:
Dude i dint think ill tamper with gps in my life but the info you provided is just to simple and cool. thanks
Click to expand...
Click to collapse
I agree. I've always enjoyed learning about gps starting from my Garmin iQue days. After suffering with the Captivate and that horrible gps it's nice to have a phone with fantastic gps and the ability to truly use it. Good stuff here!
Sent from my SG Note i317 via XDA Premium...I eat apples, not use them.
Hi
Speaking about GPS, is there any onchip limitation regarding the speed or location that it should grab GPS signal ?
Someone told me that it may not be possible to make it work in a plane because of US rules and security.. or around some sensitive FBI or Governments buildings (that may have signal killers) ?
Thanks
ak074 said:
'report from this device' is used in latitude. latitude allows you to share your location with your 'friends'. 'enable location history' is for you only and keeps a record of everywhere you go. or at least thats my understanding of it. hope this helps
Click to expand...
Click to collapse
first ... with both disabled ... maps and search still search your location .. which is strange ...
second ... if i enable location history, but not report from the device ... there is no history ! or i don't know where to find it ... cause, indeed it's not in latitute ... you can select "report from the device" without selecting history ... not sure if anything happens ...
Happy New Year!
wow mind blowing and extensive work to understand all this about global positioning system ...
Simple question to OP
Can the Broadcom chipset XTRA file- lto2.dat be used for Qualcomm chipset XTRA file - xtra.bin ? and vice versa?
Thank you.
popcorn1122 said:
Simple question to OP
Can the Broadcom chipset XTRA file- lto2.dat be used for Qualcomm chipset XTRA file - xtra.bin ? and vice versa?
Click to expand...
Click to collapse
To My Understanding and Experience "NO",
putting lto2.dat file in a Qualcomm Android Phone do not improve Time To First Fix (TTFF), did'nt experimented BroadCom.
also contents of both files seems different, MediaTek processors uses EPO files instead, but it is astonishing that lto2.dat do improve their TTFF.
But no technical document to prove these experimentation .
US past policy do restrict the use of GPS above certain altitude (to deny military use of GPS), but cell phones still acquire navigation using GlONASS in Planes.
Can anyone tell me which files are responsible for GPS? I used TitaniumBackup and I suspect that I deleted these files by mistake because now I do not receive a signal outside the building
Lollipop 5.0.1 GT-I9505

Support for dual-frequency GNSS?

The phone is supposed to support dual-frequency GNSS.
Can someone use GPSTest (https://play.google.com/store/apps/details?id=com.android.gpstest&hl=en&gl=US)
and show a screenshot that demonstrates that the phone can pick up both frequencies?
Attached screenshot, you can see L5 and E5a in use there.
Looks like the screenshot got lost in the mail ;-) But yet I can confirm that dual-frequency is supported.
B2a too
Dual-frequency GNSS works. Positioning in general seems to be quite fast and accurate outdoors, also in forests.
Unfortunately it does not record carrier phase data with GPSTest or other apps (only outputs zeroes), so post-processing (PPK or others) are not usable. Does anybody know whether a custom rom can help with that?
I've seen it couldn't output "Navigation Messages", is that what's missing ? The Mi 8 could do that though I think. Is it really worth doing post-processing with an Android phone though where you're going to be limited by the poor antenna ? What post-processing tools do you use ?
You're probably right about the antenna. I wanted to see how far you can get with this phone. For some of my applications it could be useful to have sub-meter or at least the best accuracy available.
I wanted to use https://jason.rokubun.cat/#!/
Thanks for the link, they do indeed mention Android Smartphones under https://jason.docs.rokubun.cat/examples/ and give instructions on how to log data with GNSS Logger (GNS Logger v3 keeps crashing on me, does it work for you ?). They don't mention Navigation Messages that the Mi 10 '(and all 765G devices) is not capable of but "measurements" should be ok. Did you activate the "Full GNSS measurements" in the Developer Options ?
PS - I tried to create an account on Jason but I'm not getting the confirmation email. I tried "forgot password" and got an email but it won't reset. Looks like the site might have a few issues !
GNSS Logger always crashed on my phone, too. I have successfully used "GNSS/IMU Logger" as well as "GPSTest" instead (I prefer the former but since the last MIUI update (12.1.3) it has some bugs). I have enabled "Full GNSS measurements" in the developer settings.
The site worked just fine for me. At first files from the GPSTest app were not readable by the engine but the developers changed this immediately. They have also been very fast and helpful with my problems so far so maybe try contacting them via mail.
Good to hear, so what phone were you using when you got your data processed by Jason ? I received the email so I'll give it a try with both GPSTest and GNSS Logger v2 with my Mi 10 Lite just in case.
EDIT : so the GPSTest recording was...empty so same problem as you it seems (or I did something wrong while recording) but the GNSS Logger file is 1.8MB and is currently processing but stuck on "Looking for closest CORS station" so I'm not sure what's going on.
Ah sorry, my message was unclear. I have produced valid rinex and raw log files with the Xiaomi Mi 10 Lite but the fields with the carrier phase data were empty. Jason then still processes the files but the output data are not helpful, with positions way worse than what a standard gpx recorder delivers.
Jason usually didn't take long with my files.
Gotcha, I opened the log with excel and the CarrierPhase fields are indeed empty. Is that why we get the " Could not set-up parameters for PPP processing: Cannot perform PPP on Rinex because SP3 orbits for 2021-01-21 16:00:17.429569 could not be found " message in Jason ? That sounds more like a CORS station problem but anyway it won't help with our problem.
The result was indeed poor, worse than what I was seeing on GPSTest actually but I think GPSTest shows the "Android Position", i.e. fused GPS/WiFI/4G
By the way, which rom are you using?
I don't use 4G or Wifi for positioning.
Stock ROM with Miui 11.0.4.0
I'll try turning off data to see what that does to the position. It might be using the accelerometers too to keep it steady.
About the empty CarrierPhase data fields I wonder if the data isn't being made available differently after reading the paper made available here : https://www.researchgate.net/public...g_Xiaomi_Mi_8_Dual-Frequency_Raw_Measurements
Where it says : " Not all available public methods in these two classes are actually in use or of interest for satellite-based positioning. In fact, some variables (e.g., ‘CarrierPhase’) have been deprecated starting from API version 28 [11]"
EDIT : ok, what we need is the "AccumulatedDeltaRangeMeters" and it is indeed shown as 0.0 on the Mi 10 Lite
Looking for some Mi 8 logs now, I'm pretty sure I've seen some somewhere !
See here for example:
https://www.kaggle.com/google/android-smartphones-high-accuracy-datasets
From the "awesome GNSS" list. You can also find a list of device capabilities there:
https://docs.google.com/spreadsheets/d/1jXtRCoEnnFNWj6_oFlVWflsf-b0jkfZpyhN-BXsv7uo/edit#gid=0
The Mi 10 Lite 5G is supposed to support carrier phase data /accumulatedDelta. It just seems like they are not calculated.
I'm sure you know the GPSTest group:
https://groups.google.com/g/gpstest_android
I'll leave the link for other interested people.
Yes I'm there too ;-) I just mentioned the GeolocPVT app, I managed to build it starting from the .aab, what a hassle ! Unfortunately it can't get a fix with the Mi 10, maybe because of the lacking ADR data ?
Talking of which I ran GNSS Logger v2 on a lowly Redmi 9 and...it logs ADR data ! I'll see if I can post-process some data with Jason.
Thanks for the links for the logs, the video presentation was interesting too. Do you know what the "Ground Truth Data" is ? A geodetic receiver getting RTK corrections maybe ?
I wonder if the Mi10 will ever get proper ADR data...have you had other Android phones that provide that data ?
Sorry, no. I didn't check with the Realme X2 Pro and now no longer have it.

Categories

Resources