So I did this: File Build.gradle:
compile 'com.google.android.gms:play-services:4.2.42'
Manifest:
<uses-permission android:name="com.example.angyy.home3.permissions.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<meta-data android:name="com.google.android.maps.v2.API_KEY"
android:value="(my key)"/>
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version"/>
Main:
map=((MapFragment) getFragmentManager().findFragmentById(R.id.fragment1)).getMap();
MarkerOptions k = new MarkerOptions()
.position(new LatLng(40.6453157,-7.9209911))
.title("Escola Superior Tecnologia Viseu")
.icon(BitmapDescriptorFactory.fromResource(R.drawable.estvfoto))
.draggable(true).snippet("Near something something");
map.addMarker(k);
map.setMapType(GoogleMap.MAP_TYPE_NORMAL);
map.setMyLocationEnabled(true);
map.getUiSettings().setZoomControlsEnabled(true);
map.getUiSettings().setZoomGesturesEnabled(true);
map.getUiSettings().setCompassEnabled(true);
map.getUiSettings().setMyLocationButtonEnabled(true);
map.getUiSettings().setRotateGesturesEnabled(true);
map.getUiSettings().setTiltGesturesEnabled(true);
CameraPosition cameraPosition = new CameraPosition.Builder().target(new LatLng(40.6453157,-7.9209911)).zoom(15).build();
map.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
the map is showing and the gestures are working, but it's not going to the location I put there.. What am I missing? (No errors...)