3

I would like to create my own implementation of a LocationProvider, there seems to be a way to add a "mock" provider, but that isn't exactly what I want.

http://developer.android.com/reference/android/location/LocationManager.html

There also appears to be a permission called: android.permission.INSTALL_LOCATION_PROVIDER

But there is no documentation about how to use this permission.

How do I register a new location provider?

gregm
  • 12,019
  • 7
  • 56
  • 78
  • possible duplicate of [Android mock location on device?](http://stackoverflow.com/questions/2531317/android-mock-location-on-device) – Pentium10 Aug 17 '10 at 19:09
  • dupe of this one also http://stackoverflow.com/questions/3636106/replace-default-gps-signal-provider-on-android-devices/ – Paul Gregoire Sep 13 '10 at 20:47

2 Answers2

4

It certainly can be done. The Android Open Source Project provides you with all the code needed to do this - you would have to extend the LocationProvider class and make use of your extension in the LocationManager. (I believe you would have to modify the LocationManager). Of course this also assumes that you have a rooted phone or some other device you can flash an image to. So, when you say that it cannot be done - you mean it cannot be done without changing the OS.

1

It cannot be done. See my answer to this SO post:

How to provide your own LocationProvider on Android?

and:

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

Community
  • 1
  • 1
AlexBottoni
  • 2,237
  • 20
  • 24