Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8583907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:38:48+00:00 2026-06-11T21:38:48+00:00

I have an application in which on clicking a button, or on changing place,

  • 0

I have an application in which on clicking a button, or on changing place, or after a particular time, I am able to get longitude and latitude values. I want to use this values to show them on Google Map application. I am opening a map using intent to show location, but somehow its not showing cordinates which I am getting.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T21:38:49+00:00Added an answer on June 11, 2026 at 9:38 pm

    This is a working piece of code that I use in one of my apps. This code also includes a check to find out if the user has Google Maps installed on his / her device. If the check returns the app as installed, then the function will pass on the data to the app. If the check fails, it displays an AlertDialog informing the use that the app is not installed.

    protected void showMap() {
    
        boolean installedMaps = false;
    
        // CHECK IF GOOGLE MAPS IS INSTALLED
        PackageManager pkManager = getPackageManager();
        try {
            @SuppressWarnings("unused")
            PackageInfo pkInfo = pkManager.getPackageInfo("com.google.android.apps.maps", 0);
            installedMaps = true;
        } catch (Exception e) {
            e.printStackTrace();
            installedMaps = false;
        }
    
        // SHOW THE MAP USING CO-ORDINATES FROM THE CHECKIN
        if (installedMaps == true) {
            String geoCode = "geo:0,0?q=" + PLACE_LATITUDE + ","
                    + PLACE_LONGITUDE + "(" + PLACE_NAME + ")";
            Intent sendLocationToMap = new Intent(Intent.ACTION_VIEW,
                    Uri.parse(geoCode));
            startActivity(sendLocationToMap);
        } else if (installedMaps == false) {
    
            AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
                    CheckinsDetails.this);
    
            // SET THE ICON
            alertDialogBuilder.setIcon(R.drawable.ic_launcher);
    
            // SET THE TITLE
            alertDialogBuilder.setTitle("Google Maps Not Found");
    
            // SET THE MESSAGE
            alertDialogBuilder
                    .setMessage(R.string.noMapsInstalled)
                    .setCancelable(false)
                    .setNeutralButton("Got It",
                            new DialogInterface.OnClickListener() {
                                public void onClick(DialogInterface dialog,
                                        int id) {
                                    dialog.dismiss();
                                }
                            });
    
            // CREATE THE ALERT DIALOG
            AlertDialog alertDialog = alertDialogBuilder.create();
    
            // SHOW THE ALERT DIALOG
            alertDialog.show();
        }
    }
    

    This line of code mentioned below sends it to Google Maps and instead of displaying just the Pin also displays the location name.

    String geoCode = "geo:0,0?q=" + PLACE_LATITUDE + ","
                        + PLACE_LONGITUDE + "(" + PLACE_NAME + ")";
    

    EDIT: If you do not wish to display the PLACE_NAME, modify that particular line with: geo:latitude,longitude instead of the one used in the code block.

    Check this link for further combinations possible, like zoom for example: http://developer.android.com/guide/appendix/g-app-intents.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my application I have a quit button, on clicking of which the session
I have map application in which I have a button. On clicking that button
I have a Windows Form Application in which clicking certain buttons create objects from
I have seen one application in which there was a button of write a
I have an application which have a system add button the navigation bar .on
I have created one application which contains several buttons to home page clicking on
I have an application which displays a list of users , When clicking on
I am using UIDatePicker in my iPhone application.I have kept a button on clicking
I have an Activity which when clicking the menu and a button appearing there,
In my JSF2 application, I have Clear button, which is supposed to clear all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.