Trouble reading GPS Values

Discussions about CSEntry
Post Reply
jfigueroa
Posts: 100
Joined: August 28th, 2014, 12:46 pm

Trouble reading GPS Values

Post by jfigueroa »

Hello everyone,

I been trying to get the latitude and longitude values on an Android device using the GPS function. I actually am able to read it, but I think there is something I´m doing wrong because it only returns Integer values. For example: latitude: 10.0000000, Longitude: -80.0000000 and I don´t know why the decimals that those values supose to have are taken by .0000000 and I actually confirm those values with my phone and actually I get for example: 10´25´´17 and 80´32´´12 at that same place. So maybe someone could help me to figure out why I can only get those values but the decimals are missing.

Thanks to everyone !!.

Here is what I been trying to do:

// ----- Getting your current Global Position -----

if gps(open) = 0 then
errmsg("The GPS unit is turned off, please turn it on.");
exit;
endif;

numeric li_latitude, li_longitude;

if gps(read,70) then // try to get a gps reading for up to 70 seconds

errmsg("Your actual position corresponds to:");

errmsg("Latitude: %f", li_latitude);
errmsg("Longitude: %f", li_longitude);

Here What I get is: Latitude: 10.0000000 then Longitude: -80.0000000 (For Example)
And I think what I supose to get is something like:
Latitude: 10.251700 then Longitude: -80.321200

else
errmsg("There has been an error while Reading gps, Try again later");
endif;

gps(close);

// ----- End getting your current Global Position -----

But I don´t know If I´m wrong or doing something wrong.

Thank you so much for everyone !!
jfigueroa
Posts: 100
Joined: August 28th, 2014, 12:46 pm

Re: Trouble reading GPS Values

Post by jfigueroa »

Hi everyone
Just an interesting detail, I have been making tests about my problem and figured out that trouble only happens when I run my CSEntry Application on a Tablet Android device.
Because when I run it on a Smartphone Android Device it Works perfectly. Cause I get in fact the values I expected that are:
Latitude: 10.251700 then Longitude: -80.321200

So to be more explicit:
In My Tablet CSEntry Application I get:
Latitude: 10.0000000 Longitude: -80.0000000

In the other way In my Smartphone CSEntry Application I get:
Latitude: 10.251700 then Longitude: -80.321200

So in fact the logic suppose to work, but why does I get this problem when I run it on a Tablet ?

Thanks.
regards.
Gregory Martin
Posts: 1947
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Trouble reading GPS Values

Post by Gregory Martin »

Are you using the most recent beta, released on August 1? There was a bug in the previous versions and GPS readings didn't work on Android devices that had regional settings where commas were used as decimal marks instead of periods. (For example, if you were using a French or Spanish language device, you would only get the integer part of the GPS reading, not the whole reading.) I suspect that that is what was happening to you. Try the new beta and let me know if there is still a problem.
jfigueroa
Posts: 100
Joined: August 28th, 2014, 12:46 pm

Re: Trouble reading GPS Values

Post by jfigueroa »

Thank you so much for your reply Mr. Gregory Martin, you are right I´m not using the most recent beta reléase. So I will try your advice and let you know if it Works.
Also thanks to everyone for Reading my post.
So let me try it and I´ll let you know if it Works.

regards.
jfigueroa
Posts: 100
Joined: August 28th, 2014, 12:46 pm

Re: Trouble reading GPS Values

Post by jfigueroa »

Hi Mr. Gregory Martin,

Sorry If I took so long, but finally I was able to test my CSEntry Aplication on an Android Tablet Device with the most recent beta reléase (August 1), and I noticed that I still actually have that problem. The trouble is that I only get an Integer value as I read my gps position.
And you are right my devices are on Spanish language.
Also I noticed that in some tablets I get a low gps strenght at the time I read the values (less than 40% of the strenght bar) why does it happens ?. And another interesting fact, I also requested the number of satellites that my device was being conected, and even I have a strenght bar of like 75 or 80% I still get only integers as latitude and longitude values, and the number of satellites is 0. And I don´t know why does it happens. Any advice ?.

Notice that this only happens at tablets device, because actually I tested at smartphones also on Spanish language, but there it runs perfectly.

So actually I still have the problem, but it is only on tablets, I don´t know why.
I have tested at most recent beta reléase (August 1)
My devices are Spanish devices. ( Tablets and Smartphones).

Thanks for Reading,

Regards.
jfigueroa
Posts: 100
Joined: August 28th, 2014, 12:46 pm

Re: Trouble reading GPS Values

Post by jfigueroa »

I continued testing at most recent beta (August 1) release, and as you said that the bug was only when the device was using French or Spanish language, I decided to make a test changing my tablet device language to english, and it Works perfectly, cause I got the latitude and longitude values as I needed, with decimals and everything.
The thing is that I really need my device to be at spanish language.

So I´ll be waiting for your comments and assistance about it, Mr. Gregory Martin.

regards, from Guatemala.
Gregory Martin
Posts: 1947
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Trouble reading GPS Values

Post by Gregory Martin »

I'm a bit confused. So is this summary correct:

Tablet in English - GPS works
Tablet in Spanish - GPS does not work
Phone in Spanish - GPS works

Is that right? Are you saying that the GPS coordinates are correct on a phone in Spanish mode but not on a tablet? That is strange. I just want to make sure that I understand you before I try to solve the problem.
jfigueroa
Posts: 100
Joined: August 28th, 2014, 12:46 pm

Re: Trouble reading GPS Values

Post by jfigueroa »

Yes you are right, Mr. Martin.
Yes, I also think is strange, but that´s what actually happens.

You are all right.

Your summary about the problem is correct.

Thank you so much for your help.

Regards.
Post Reply