How to provide your own LocationProvider on Android?

前端 未结 4 564
一生所求
一生所求 2020-12-29 14:41

Does anyone know how to provide your own LocationProvider and publish it to the system, so other apps may fetch a reference to it from the LocationManager?

4条回答
  •  既然无缘
    2020-12-29 15:37

    It cannot be done.

    The problem is that only OEMs are allowed to install a new location provider. A third-party developer cannot grant to his/her application the permission required to install a new location provider (android.permission.INSTALL_LOCATION_PROVIDER).

    See the answer of Dianne Hackborn (Android framework engineer) in this thread:

    https://groups.google.com/d/topic/android-developers/OvCcdvO6jZY/discussion

    To install a new location provider, you should develop a whole new firmware (like http://www.cyanogenmod.com/ ), insert your new location provider in this firmware and install all of this stuff o the user's phone.

    See this SO thread, as well: Why are these permissions being refused?

    All of this because of security concerns.

提交回复
热议问题