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

  • Home
  • SEARCH
  • 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 4382874
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T12:50:06+00:00 2026-05-21T12:50:06+00:00

I am working on GPS system for android. I am able to find the

  • 0

I am working on GPS system for android. I am able to find the latitude and longitude of my current position, but when I try to convert my latitude and longitude into Physical address my code doesn’t work. I have tried several possibilities. I have posted my code here.

Any help is much appreciated.
Thanks.

try {

        List<Address> addresses = gc.getFromLocation(latitude, longitude, 1);
        System.out.println(""+latitude);
        StringBuilder sb = new StringBuilder();
        if (addresses.size() > 0) {

        Address address = addresses.get(0);
        for (int i = 0; i < address.getMaxAddressLineIndex(); i++)
        sb.append(address.getAddressLine(i)).append("\n");
        sb.append(address.getLocality()).append("\n");
        sb.append(address.getPostalCode()).append("\n");
        sb.append(address.getCountryName());
        }
        addressString = sb.toString();
        } catch (IOException e) {}
        } else {
        latLongString = "No location found";
        }
        myLocationText.setText("Your Current Position is:\n" +
        latLongString + "\n" + addressString);
        }

My problem is, I couldn’t get any value in the List<Address> addresses = gc.getFromLocation(latitude, longitude, 1);
. It returns a empty list only.
Could anyone tell me what the problem is and how to sort it out…

  • 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-05-21T12:50:07+00:00Added an answer on May 21, 2026 at 12:50 pm
    Geocoder gc = new Geocoder(ctx, Locale.getDefault());
    List<Address> addresses;
    addresses = gc.getFromLocation(lat, lng, 1);        
    StringBuilder sb = new StringBuilder();
    if (addresses.size() > 0) 
    {
        Address address = addresses.get(0);
        for (int i = 0; i < address.getMaxAddressLineIndex(); i++)
             sb.append(address.getAddressLine(i)).append(",");
    }
    

    This would get a location. But sometimes an exception comes as "Unable to parse the response from server". You need to handle the exception.Also check for the INTERNET permission in the manifest.

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

Sidebar

Related Questions

Working on a tracking application using GPS. It is all fine, but sometimes because
I am trying to use Android's LocationManager requestLocationUpdates. Everything is working until I try
I am new to PHP, and am working on a GPS tracking system. I
I'm working on some experiments to try and increase the GPS accuracy on an
I am working on gps based application. I am using LocationProvider and calling setlocationListener
I have a working application which gets the GPS Long/Lat of from a BlackBerry
I'm working with a GPS module that is transferring data to my mac over
I would like to be able to test to see if the Phone's GPS
I am working on an Android Application where I am trying to track movement
Working on trying out the market licensing service, and I'm running into a few

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.