The blue dot/arrow isnt showing on my map. Everything else works fine. Am i missing some permissions?
Included the Java Class, Manifest and layout XML.
private void setUpMap(int satelliteMode, LatLng startPoint, float zoomLevel) {
mapView.getUiSettings().setZoomControlsEnabled(false);
//mapView.getUiSettings().setMyLocationButtonEnabled(false);
mapView.setMapType(satelliteMode);
mapView.setMyLocationEnabled(true);
mapView.moveCamera(CameraUpdateFactory.newLatLngZoom(startPoint, zoomLevel));
}
xml:
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mapview"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment"/>
manifest:
<permission
android:name="com.example.project.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.example.project.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="API_KEY"/>
For some reason it just worked. Went away for lunch and left the app on. When i returned the blue arrow was drawn on the map. Not on the right location though but it was on the map. So the posted code of mine works. It only needs an update from the location manager.