PDA

View Full Version : Android: onCurrentPositionUpdate is calling although the position not changed



FatihA
28.02.2015, 01:07
Hi all,

if I have a position the onCurrentPositionUpdate is called -> Thats fine.
But why the onCurrentPositionUpdate is called, although I have a position and the position is not chaneging?

Here you can see that th onCurrentPositionUpdate is called less then 1 sec.
02-28 00:00:00.936 MapFragment onCurrentPositionUpdate
02-28 00:00:01.857 MapFragment onCurrentPositionUpdate
02-28 00:00:01.857 MapFragment onCurrentPositionUpdate
02-28 00:00:02.918 MapFragment onCurrentPositionUpdate
02-28 00:00:02.918 MapFragment onCurrentPositionUpdate
02-28 00:00:03.839 MapFragment onCurrentPositionUpdate
02-28 00:00:03.849 MapFragment onCurrentPositionUpdate
02-28 00:00:04.900 MapFragment onCurrentPositionUpdate
02-28 00:00:04.930 MapFragment onCurrentPositionUpdate
02-28 00:00:05.901 MapFragment onCurrentPositionUpdate
02-28 00:00:05.911 MapFragment onCurrentPositionUpdate
02-28 00:00:06.883 MapFragment onCurrentPositionUpdate
02-28 00:00:06.903 MapFragment onCurrentPositionUpdate
02-28 00:00:07.934 MapFragment onCurrentPositionUpdate
and so on...

Can we give anything do that the onCurrentPositionUpdate is only called if we have really changeing our position?
If the position is not changeing I need do no update...

Thanks a lot

Adela_Silvia
02.03.2015, 17:42
Hello,
I have to check with the development team the right answer. I'll get back to you as soon as possible.

Adela_Silvia
05.03.2015, 17:41
As the SDK is used for mapping and navigation functionality, the GPS location is very important therefore, the positions are send every time there are available. Is very hard to give a definition of "same position" as the last decimals from latitude and longitude vary a bit .
As a workaround- you could define an algorithm that detects the same positions based on the needs and ignore them or to create a custom location manager.

FatihA
16.03.2015, 20:29
Thank you Adela.