How to display a location of a place in android app

how to show current location on map in android studio
show current location on map android studio example
how to get current location in android studio
how to get current location in android programmatically
how to get current location address in android studio
how to display location in android
show location on google map using latitude and longitude android
android google map current location marker example

I am looking for a way to display a location of a place inside an android application. I have the longitude and Latitude coordinates of the place stored inside a MySQL database, now I want to retrieve them (Longitude and latitude)and display the exact location in the application. thanks

I am assuming you want it on a map view with a marker.

    class="" />

This should be added to you xml file of the activity you want the Map to be in. Then in your activity,

GoogleMap googleMap;
MapFragment mapFragment;

Initialize this in you onCreate;

mapFragment = (MapFragment) getFragmentManager().findFragmentById(;

and then create the override method, onMapReady()

public void onMapReady(GoogleMap gMap) {
    googleMap = gMap;
    try {
    } catch (SecurityException se) {


    //Edit the following as per you needs

    LatLng placeLocation = new LatLng(***YOUR LAT***, ***YOUR LNG***); //Make them global
    Marker placeMarker = googleMap.addMarker(new MarkerOptions().position(placeLocation)
                  .title(***NAME OF PLACE HERE***));
    googleMap.animateCamera(CameraUpdateFactory.zoomTo(10), 1000, null);

I think that should give you what you want. Comment if you need anything else.

How to display a location of a place in android app, Can you tell me how to do realtime tracking of another person having our app? Read more Duration: 11:18 Posted: Oct 6, 2017 If you want to provide a feature in your app that should display a list of places such as banks, hospitals, business, parks, transport, etc. near the current location of user device, then you need to use Google places API for android to implement it. Google places API provides places data from Google database which is used for Google maps.

To get the location details using latitude and longitude please use the below code

Geocoder geocoder;
List<Address> addresses;
geocoder = new Geocoder(this, Locale.getDefault());

addresses = geocoder.getFromLocation(latitude, longitude, 1); // Here 1 represent max location result to returned, by documents it recommended 1 to 5

String address = addresses.get(0).getAddressLine(0); // If any additional address line present than only, check with max available address lines by getMaxAddressLineIndex()
String city = addresses.get(0).getLocality();
String state = addresses.get(0).getAdminArea();
String country = addresses.get(0).getCountryName();
String postalCode = addresses.get(0).getPostalCode();
String knownName = addresses.get(0).getFeatureName(); // Only if available else return NULL

Get Device Location - [Android Google Maps Course], Current Location Tutorial : In This Video, You Will Learn How to Find Current Location On Duration: 10:32 Posted: Apr 10, 2019 In Android Studio, click the Run menu option (or the play button icon). Choose a device as prompted. Android Studio invokes Gradle to build the app, and then runs the app on the device or on the

            //Add mapView  activity.xml
                        android:apiKey="your api key"

                        android:layout_below="@id/tv_location" />

        //Add Activity
         // Getting reference to MapView
                mapView = (MapView) findViewById(;
                googleMap = mapView.getMap();

    final LatLng latLng = new LatLng(lat, lng);
            final MarkerOptions markerOptions = new MarkerOptions().icon(BitmapDescriptorFactory.fromResource(R.drawable.map_pin));
            final CameraPosition cameraPosition = new CameraPosition.Builder().target(latLng).zoom(14f).tilt(70).build();

How to Show Current Location On Map in Android Studio, Using the Google Play services location APIs, your app can request the You should include logic for choosing which location to show based� The location of the user is useful to display location features or to show directions. If you want to create an app that uses a client’s location then you are in luck. I am going to show you how to get the user’s current location and display it on a map.

    Geocoder coder = new Geocoder(this);
    String locationName = list.get(i);
    Geocoder gc = new Geocoder(this);
    List<Address> addressList = null;
    try {
        addressList = coder.getFromLocationName(locationName, 1);
    } catch (IOException e) {
    Address location = addressList.get(0);
    double latitude = location.getLatitude();
    double longitude = location.getLongitude();
    LatLng helpcenter = new LatLng(latitude, longitude);
    googleMap.addMarker(new MarkerOptions().position(helpcenter)
    mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(helpcenter, 6f));

Get the last known location, You can add important places by searching for locations or drawing them directly on the On your Android phone or tablet, open the My Maps app MyMaps . Android Google Map Displaying Current Location. In the previous tutorial of Android Google Map, we simply displayed the default coordinates (location) set by the class file. Now in this tutorial we will display and place marker at the user current location. For doing this we need to generate Google Map API key.

Add places to your map - Android - My Maps Help, When an app is using your phone's location via GPS, the top of your screen shows To see and manage the places your phone has been, learn how to turn on� Get the coordinates of a place. On your Android phone or tablet, open the Google Maps app . Touch and hold an area of the map that isn’t labeled. You'll see a red pin appear. You'll see the

Manage your Android device's location settings, Build an app to find and track your device location on a map. Using the ArcGIS API for Android, it's easy to create an app that displays and tracks a device when building applications that allow you to find directions or places around you. Your Android smartphone has its own Locations settings (go to your Settings app and search for “Location” to access these settings) and Google Maps relies on your phone’s settings to know where you are, so you may need to change your settings for Google Maps to work properly.

Display and track your location, This example demonstrates how do I show current location on a google map on Android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Proje ActivityCompat; import Reporting location Report each new location fix to the Android framework with the reportLocation () method. This method accepts a Location object, which contains the updated contents to report. Set the provider for each reported Location to LocationManager.GPS_PROVIDER.

  • Are u using GoogleMaps in android, if yes show us code, may be we can help..!
  • Can you be more specific on How u need to display the exact location like Is it in a google map as a marker or not
  • do you want it in a map view? or just the details?
  • well formatted step-to-step instruction. this should be the accepted answer.
  • is there a @override method onMapReady()??
  • Very Good Explanation hope i could accept that answer
  • @ArnoldBrown YourClassName implements OnMapReadyCallback
  • In this code you can find any place using place name.Here list is a listview and list.get(i) is the specific place name