سؤال

I am writing a service that uses location information. I want to know if any of the activities running use GPS. I want this service to use passive mode if there is an application running which has already started making request for GPS location. Examples of such an application might be Waze or Google maps. If not such application is running, I want to call requestLocationUpdates using the GPS provider.

As far as I can tell, LocationManager does not have an API that tells you whether there are outstanding requests for GPS location. Is there some way of finding outstanding requests other that those generated by my application?

هل كانت مفيدة؟

المحلول

I want this service to use passive mode if there is an application running which has already started making request for GPS location. Examples of such an application might be Waze or Google maps. If not such application is running, I want to call requestLocationUpdates using the GPS provider

I fail to see the benefit in all this complexity. It's not like you will somehow use twice the power by having two apps use GPS, because it's not like the device will all of a sudden sprout a second GPS radio that will be consuming power.

Is there some way of finding outstanding requests other that those generated by my application?

No.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top