Most effective location tracking implementation? Intention / BroadcastReceiver / LocationListener / Services / IntentService / AlarmManager?

I went through the solutions and found that there are many ways to implement location tracking logic.

  1. Intention + BroadcastReceiver + LocationListener
  2. Intent + IntentService + AlarmManager
  3. LocationListener
  4. other methods or various combinations of the above ...

I am trying to figure out what would be the best way (the most energy efficient way) to achieve the same ...

I have a library class MyLocationClass.java, which has two methods: 1. startTracking () - start sending the user's location after time T and only if the user has moved X distance 2. stopTracking () - stop sending location updates.

The simple answer seems to be a LocationListener due to its built-in Time Passed / Distance Moved features that provide a better user experience, but then ...

I don’t want the GPS to be on all the time? In fact, it should only be included at the intersection of T and X. Would using a Service / IntentService and / or / with an alarm manager timer be the best solution? Could BroadcaastReceivers with LocationListeners be the best solution?

Please suggest.

+3
2

, , . GPS GPS, . , GPS.

requestLocationUpdates. minTime minDistance :

minTime . , .

minDistance ,

+2
 > Most power efficient location tracking implementation?

( ) - gps , gps- ( , samsung) .

Android , , , , - . . .

- , , , .

.

android llama , . , : " 7 . " ".

0

All Articles