I am trying to make a button (in my case, ImageButton) that will locate the user on a Google map. I have done it so far, and when I click a button in the application simulator; "com.tools.fd.runtime.BootstrapApplication will not work unless you upgrade the Google Play services." Here is my code:
built.gradle
apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "25.0.0" defaultConfig { applicationId "com.example.konarx.a11042016" minSdkVersion 14 targetSdkVersion 23 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:23.4.0' compile 'com.google.android.gms:play-services:9.8.0' testCompile 'junit:junit:4.12' compile 'com.google.android.gms:play-services-maps:9.8.0' }
MapsActivity.class
package com.example.konarx.a11042016; import android.os.Bundle; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.OnMapReadyCallback; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.MarkerOptions; public class MapsActivity extends MainScreen implements OnMapReadyCallback { private GoogleMap mMap; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_maps); SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.map); mapFragment.getMapAsync(this); } @Override public void onMapReady(GoogleMap googleMap) { mMap = googleMap; LatLng sydney = new LatLng(-34, 151); mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney")); mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney)); } }
source share