If a component that needs to be updated with a location needs only updates when the component is around - say, activity - I would use the LocationListener approach.
If the component in need of location updates would definitely not be around - say, IntentService - I would use PendingIntent . You cannot use the LocationListener in this case, since there is nothing in memory to listen to locations.
source share