In my application i did not want to real time location just want to compare some values so i need to use the passive location providers(get location from other app).i have try code link read from the blog http://android-developers.blogspot.in/2011/06/deep-dive-into-location.html but i can get the broadcast yet,can anyone please tell me how to implement it? In manifest i have give the permission and broadcast receiver.
<receiver android:name=".PassiveLocationChangedReceiver" android:enabled="true">
The passive location provider will provide you with location data when other apps that have requested location updates get their data. So if no other app on the phone is getting location updates, you won't get them either.
If you want to see the last value that each provider has obtained in the past then you must use getLastKnownLocation with the network or gps provider.
http://developer.android.com/reference/android/location/LocationManager.html#getLastKnownLocation(java.lang.String)
For comprehensive details on getting location updates see this:
http://android-developers.blogspot.com/2011/06/deep-dive-into-location.html
In that article, look at the section called "Freshness means always being up to date. What if we could reduce startup latency to zero?". See the linked code for Froyo+ passive location updates.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With