In my android app I am using the osmdroid framework. In the framework I am using the MyLocationNewOverlay() which contains a method to show the current location on the map.
My problem
The LocationListener in the framework seems not to use the network provider and only wants to locate me with GPS (which works fine, but only if I am outside).
Is there a standard way to use a LocationProvider that also works with the network provider if gps is not available?
AndroidManifest.xml
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> Pretty standard to init my location overlay:
private void initMyLocationNewOverlay() { myLocationNewOverlay = new MyLocationNewOverlay(new GpsMyLocationProvider(context), mapView); myLocationNewOverlay.enableMyLocation(); mapView.getOverlays().add(myLocationNewOverlay); } Thanks in advance!