ankitstarski / GeoclueShare

GeoclueShare is an Android application that lets you share your Android GPS location with a GNOME Desktop located on the same WiFi network. You can disable or enable location sharing service in GeoclueShare as per your needs.
https://wiki.gnome.org/Apps/GeoclueShare
Other
34 stars 11 forks source link

Wrong NMEA format when phone locale is not US #7

Open filipkemuel opened 6 years ago

filipkemuel commented 6 years ago

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 "."

zeenix commented 5 years ago

@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 commented 5 years ago

@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.

filipkemuel commented 5 years ago

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

zeenix commented 5 years ago

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