GeoclueShare icon indicating copy to clipboard operation
GeoclueShare copied to clipboard

Wrong NMEA format when phone locale is not US

Open filipkemuel opened this issue 7 years ago • 4 comments

This app only works if the phones locale uses "." as decimal separator.

So if your phone is set up for lets say French language it will not work since French use "," as decimal separator.

Because of that the NMEA format will be wrong and look something like this:

$GPGGA,233456,1234,567,N,00123,456,E,1,,7,5,75,1,M,,M,,*66

When it should look like:

$GPGGA,233456,1234.567,N,00123.456,E,1,,7.5,75.1,M,,M,,*66

The solution is actually very simple: Add Locale.US to instances of String.format For example:

latStr = String.format(Locale.US, latStr, degrees, minutes, symbol);

This ensures that the decimal separator is "."

filipkemuel avatar Nov 12 '17 00:11 filipkemuel

@filipkemuel seems your PR never made it in. This seems very important fix so if you could submit a PR, that would be great. I hope @ankitstarski has time to review and merge.

zeenix avatar Apr 30 '19 10:04 zeenix

@ankitstarski this seems like a very serious issue so whether or not @filipkemuel has time to create a PR soon, we should look into merging their changes.

zeenix avatar Apr 30 '19 10:04 zeenix

Made a pull request.. But the project hasn't been updated in four years so it seems like it has been abandoned.

filipkemuel avatar May 14 '19 09:05 filipkemuel

@filipkemuel yeah, thanks for the PR. Too bad @ankitstarski has disapeared completely. I hope he's OK.

zeenix avatar May 14 '19 10:05 zeenix