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 7869215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:14:46+00:00 2026-06-03T01:14:46+00:00

I have to implement my Google map where i entered any address it will

  • 0

I have to implement my Google map where i entered any address it will automatically get the longitude and latitude.Here is the code i tried

 coder = new Geocoder(this);
 try {
     String locationName ="Gulshan 1";

        List<Address> addressList = coder.getFromLocationName(
                locationName, 5);
        if (addressList != null && addressList.size() > 0) {
            destLat = (int) (addressList.get(0).getLatitude() * 1e6);
            destLon = (int) (addressList.get(0).getLongitude() * 1e6);

            TextView pozycja = (TextView) findViewById(R.id.position);
            pozycja.setText("lat: "
                    + addressList.get(0).getLatitude() + " lng: "
                    + addressList.get(0).getLongitude());
    }
 }
 catch (Exception e) {
     Log.e("error", e.getMessage().toString());
}

Getting location from this code is possible?

  • 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-03T01:14:48+00:00Added an answer on June 3, 2026 at 1:14 am

    Use below code it will work.

     Geocoder coder = new Geocoder(this);
         List<Address>  address = coder.getFromLocationName(
                                                    "your address", 5);
                                            if (address == null)
                                                Log.d(TAG,
                                                        "Latitude and longitude not found");
                                            else {
                                                Address location = address.get(0);
                                                latitude = location.getLatitude();
                                                longitude = location.getLongitude();
                                            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Do you have any idea how to implement an indefinite scroll widget like google
I have Googled merge+cell+Javascript but did not find any suitable code to implement merge
I've tried to implement the Google Map View tutorial on the Android developer site,
I tried to implement this code (http://stackoverflow.com/questions/10318316/how-to-hide-or-display-a-google-maps-layer/) on my page, to put the weather/clouds
I need to show the google map based on the address of a contact
I have followed http://www.vogella.de/articles/AndroidLocationAPI/article.html to implement the GPS Apps ( Google Maps) I have
i have some code examples I am working to implement that uses the type
I am trying to implement this example http://www.javacodegeeks.com/2011/02/android-google-maps-tutorial.html and i have followed exactly all
Goal: To render a google map using geolocation. I am trying to implement the
I have my map working and displaying correctly. I trying to get it to

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.