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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:00:22+00:00 2026-05-23T13:00:22+00:00

I have been unable to test my code on an emulator as Ive come

  • 0

I have been unable to test my code on an emulator as Ive come to understand you cannot use geolocate on an emulator. Thus I’m not sure if Im initializing / using the functions utilities properly.

(I want to geolocate my phone, and print via a TextView the closest known address to my lat/lon fix)

Heres my code:

Location location;
Geocoder geocoder;
TextView Address;

private OnClickListener OnClick = new OnClickListener(){
    public void onClick (View src){

        double latitude = location.getLatitude();
        double longitude = location.getLongitude();

        if (longitude != 0 && latitude != 0){
            try {
                List<Address> list  = geocoder.getFromLocation(latitude, longitude, 1);
                Address address = list.get(0);          
                StringBuilder sb = new StringBuilder();
                sb.append(address);
                String addressString = sb.toString();
                Address.setText(addressString);
            } catch (IOException e) {}
        }
    }
};
  • 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-23T13:00:22+00:00Added an answer on May 23, 2026 at 1:00 pm

    You can look at this :How to emulate GPS location on the android emulator

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

Sidebar

Related Questions

I have been unable to find any decent documentation on this function. The code
I have been unable to receive UDP multicast under VxWorks 5.5. I've joined the
I have been unable to trigger an onselect event handler attached to a <div>
I have been unable to find any documentation on the .build method in Rails
I have been unable to find any documentation on properly closing database connections in
I have been unable to locate any information on compatibility with Visual Studio 2003
I have need to return multiple results from a subquery and have been unable
So I have been intrigued by the ?? operator, but have still been unable
I've read a number of articles about UDP packet sizes but have been unable
This is probably a simple question, but i have been unable to find a

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.