0

Is this something which is updated to different method or am i doing something wrong?
I want to get my current location on Google Maps what am doing right now is as follows.

Creating GoogleMaps Activity,
Download GooglePlay Services from Android SDK Manager,
Giving Permissions in AndroidManifest for Internet and Location

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET"/>

Giving permission to use my location in OnMapReady

@Override
public void onMapReady(GoogleMap googleMap) {
    mMap = googleMap;

    mMap.setMapType(googleMap.MAP_TYPE_TERRAIN);

    if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
        return;
    }
    mMap.setMyLocationEnabled(true);
}

When i try to run this code at my device LG Spirit H440 I doesn't get what i expect to get, it should give me the option to get my current location with blue dot on the maps.

I have created also API KEY in the Google API's console.

What am i doing wrong?

Edited by Stefan_1

1
Contributor
0
Replies
4
Views
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.