Android Question GPS question : altitude data

Status
Not open for further replies.

DOM85

Active Member
Licensed User
Longtime User
Hello,
Vhen i try to obtain the altitude data, i obtain values strongly differents between many smartphones with exactely the same app..
I know that this information is not accurate, but the differences between the smartphones in the same time is stable and very important (+5 times).

For example, on one i obtain 12, while on the 3 others i obtain 66.
I don't understand.
Thank you for any help.

My code is like this :

B4X:
Sub Process_Globals
    Dim GPS1 As GPS  ' GPS Library Ver 1.20
End Sub

Sub Globals
    Dim Altitude As Float
End Sub

Sub Activity_Create(FirstTime As Boolean)
    GPS1.Initialize("GPS")
    GPS1.Start(0, 0)
End Sub

Sub GPS_LocationChanged(Location1 As Location)
    Altitude = Location1.Altitude
 

emexes

Expert
Licensed User
For example, on one i obtain 12, while on the 3 others i obtain 66.
Now the first smartphone (gaving 12 in the past) give always 0 -but i am not at sea level).
And the 3 others smartphone seem to give a realist alitutde !
In the same time and place, GPS Library gives 12m on a smartphone, and near 70m on the 3 others, even after waiting a long time to obtain a max number of satellites. This difference is stable.
These posts indicate that one smartphone is reading incorrectly, and the other three are reading ok.

But this post seems to say the opposite:
I tried GSS library.
Same result : The first smartphone gives a realist altitude, and the 3 others give an altitude between 3 to 5 times upper.
Are we looking at one vertically-challenged smartphone, or three, or... total chaos?!?!?!

What is the altitude of your current location?

Does it match this: https://www.freemaptools.com/elevation-finder.htm (good if it does, but not the end of the world if it doesn't ;-)
 
Upvote 0

DOM85

Active Member
Licensed User
Longtime User
As I understand it, you have four Android phones, and when you have them outside next to each other:

with your B4A app, you get two different altitudes 12, 66, 66 and 66 (perhaps the 66 readings are 66 +/- a few metres)
with GPS Status & Toolbox app, you get four identical readings 66, 66, 66 and 66

and your actual elevation at your location is about 66 metres.

First question: are the GPS Status & Toolbox app readings identical (which suggests that it is looking up the land elevation at your currrent location) or do they also vary slightly eg +/- a few metres (which is entirely normal for GPS, suggesting that all four phones' GPS chips are getting the correct altitude).

Second question: given that only one of the four phones is returning an abnormal altitude, what is different about that phone? Is it set to high accuracy in the settings? Have you ever used a location spoofer on that phone? Perhaps try this app to reset the GPS to standard:

https://play.google.com/store/apps/details?id=com.discipleskies.gpsreset

I like your method, accurate.
1rst question : GPS Status & Toolbox app reading are quite identical on the 4 smartphones, near 12m (i live near the sea), with very small variations between them (2 to 5 meters).
2nd question : The first one giving the correct altitude (12m) is a LG Stylus 3 Android 7.0, set in french.

The 3 others smartphone give around 66 meters, with a normal small variation between them.
But one of them is exactly the same model than the first one : LG Stylus 3 Android 7.0, set in English.
And the 2 remaining smartphones are Samsung Android 5, set in french.

On any of these 4 smartphones i never used a location spoofer.

I will use your link to reset the GPS of all the 4 smartphones, and i will give your the result.

Thank you great.
 
Upvote 0

emexes

Expert
Licensed User
I tried to catch all the NMEA sentences thru GPS Library, and to decode it. But with no hope result.
The "GGA" sentence is received by my app with no data inside like this "$GPGGA,,,,,,,,,".
The reset app I mentioned earlier:

https://play.google.com/store/apps/details?id=com.discipleskies.gpsreset

has a show NMEA button at the top-left corner, and on my phone here I can see the GGA sentence with data including altitude. If you loaded the app, perhaps have a look at that, see if it matches what you received from the B4A GPS library.
 
Upvote 0

DOM85

Active Member
Licensed User
Longtime User
i come back with the result of tests on my 4 smartphones with your link https://play.google.com/store/apps/details?id=com.discipleskies.gpsreset

By reading the NMEA sentences, i discovered that the first smartphone where the altitude is correct for my app use GGA sentence from GLONASS satellite network. But on this smartphone, the american GPS GGA sentence is not received !

And on the 3 others smartphones where the altitude is not orrect for my app, i see that the american GPS GGA sentence is well reeived with the GOOD altitude, but this data is not used by the GPS Library ! Now, i am searching where GPS library take its wrong altitude !
 
Last edited:
Upvote 0
Status
Not open for further replies.
Top