Frage

I am currently developing an application which gets the users location from time to time and stores it, later on it sends it over the network. I have been testing out the location poller but have had some issues, it seems that in some android models the location updates are not received for some time. The service does run, but only returns the last known location. Below some data that I have received to show what I mean:

+----------+------------------+--------------------+--------------+--------------+
| Accuracy | Date registered  | Date from position |     Lat      |     Lng      |
+----------+------------------+--------------------+--------------+--------------+
| 8.3      | 16/08/2013 14:23 | 16/08/2013 14:23   | -2.361.446   | -4.665.134   |
| 45       | 16/08/2013 14:28 | 16/08/2013 02:26   | -235.644.403 | -465.143.039 |
| 45       | 16/08/2013 14:32 | 16/08/2013 02:26   | -235.644.403 | -465.143.039 |
| 45       | 16/08/2013 14:36 | 16/08/2013 02:26   | -235.644.403 | -465.143.039 |
| 45       | 16/08/2013 14:40 | 16/08/2013 02:26   | -235.644.403 | -465.143.039 |
| 45       | 16/08/2013 14:44 | 16/08/2013 02:26   | -235.644.403 | -465.143.039 |
| 45       | 16/08/2013 14:48 | 16/08/2013 02:26   | -235.644.403 | -465.143.039 |
| 45       | 16/08/2013 14:52 | 16/08/2013 02:26   | -235.644.403 | -465.143.039 |
| 45       | 16/08/2013 14:56 | 16/08/2013 02:26   | -235.644.403 | -465.143.039 |
| 45       | 16/08/2013 15:00 | 16/08/2013 02:26   | -235.644.403 | -465.143.039 |
| 45       | 16/08/2013 15:04 | 16/08/2013 02:26   | -235.644.403 | -465.143.039 |
| 45       | 16/08/2013 15:08 | 16/08/2013 02:26   | -235.644.403 | -465.143.039 |
| 45       | 16/08/2013 15:12 | 16/08/2013 02:26   | -235.644.403 | -465.143.039 |
| 45       | 16/08/2013 15:16 | 16/08/2013 02:26   | -235.644.403 | -465.143.039 |
| 45       | 16/08/2013 15:20 | 16/08/2013 02:26   | -235.644.403 | -465.143.039 |
| 45       | 16/08/2013 15:24 | 16/08/2013 02:26   | -235.644.403 | -465.143.039 |
+----------+------------------+--------------------+--------------+--------------+

Any ideas?

War es hilfreich?

Lösung

I also ran into issues using the CWAC poller, and ended up using material from this popular SO post with my own timers/broadcast receivers to control the frequency. The MyLocation code, and this tutorial were what finally worked for me. Good luck!

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top