Google maps go somewhere random


i am not familiar with maps.
i m trying to do when i click a button google map will go to random place.
how can i do it.thanks


Are you wanting to go to a random place based off a list of places or a random place anywhere in the world?


yup random place anywhere in the world.i figure out it.thanks solved.


By selecting a random point in the globe you will end up 71% of the times in the ocean, right?


mm actually i dont know because i didnt use maps i dont know how to use it still.
my solution is litte bit different.
i make a list with all cities in the world.
when button click selecting a random item from cities list and maps go there
so i never end up oceans:)


this may have happened that Google map API key was missing in Upfront option
from aaron


have you verified the presence of Google map API key in upfront option…???
from aaron


Please analyse the following code first , to get a basic knowledge and grip on how to use maps in android …make your foundations very strong…

import android.os.Bundle;

public class MapPane extends Activity implements OnMapReadyCallback {

protected void onCreate(Bundle savedInstanceState) {

    MapFragment mapFragment = (MapFragment) getFragmentManager()

public void onMapReady(GoogleMap map) {
    LatLng sydney = new LatLng(-33.867, 151.206);

    map.moveCamera(CameraUpdateFactory.newLatLngZoom(sydney, 13));

    map.addMarker(new MarkerOptions()
            .snippet("The most populous city in Australia.")



thanks for useful info.


welcome ,once carefully going through the above and analyzing ,it helps to establish the solution
and feel feel to ask any further questions