traccar-client-android icon indicating copy to clipboard operation
traccar-client-android copied to clipboard

getProvider() test

Open oliv3 opened this issue 7 years ago • 6 comments

Hi, https://github.com/traccar/traccar-client-android/blob/2a36e1aa6d8038793f2f968d915af56f3763e54a/app/src/main/java/org/traccar/client/Position.java#L37-L39 location.getProvider() will always return the string "fused", when previous versions returned LocationManager.GPS_PROVIDER or .NETWORK_PROVIDER.

So, testing with .equals() here will always fail. Hence, accuracy will always be set, regardless of the location provider.

No idea if this is intended ?

oliv3 avatar Sep 12 '18 23:09 oliv3

I don't understand where fused provider comes from. We don't use it.

tananaev avatar Sep 12 '18 23:09 tananaev

Oops I agree wrong title.

oliv3 avatar Sep 13 '18 01:09 oliv3

I still don't understand how it could return "fused" value.

tananaev avatar Sep 13 '18 01:09 tananaev

That's what getProvider() returns now:

POST /?id=1122334455&timestamp=1536800250&lat=49.27344199&lon=-0.26038954&batt=79.0&speed=0.971922&bearing=303.8&altitude=65.0&accuracy=21.44&provider=fused HTTP/1.1

oliv3 avatar Sep 13 '18 01:09 oliv3

Interesting... what device are you using? And what Android version? And what accuracy setting?

tananaev avatar Sep 13 '18 02:09 tananaev

@tananaev Updated https://github.com/traccar/traccar-client-android/pull/348.

oliv3 avatar Sep 13 '18 14:09 oliv3