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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:09:50+00:00 2026-06-15T03:09:50+00:00

Possible Duplicate: get current location in android I’m trying to make an application for

  • 0

Possible Duplicate:
get current location in android

I’m trying to make an application for android that gives me the position of the device.
I’m using the LocationManager.requestlocationupdates method to start a listener.
Unfortunately this doesn’t work. When I’m looking for the stacktrace in Logcat I don’t find any error but one sentence.

11-28 12:01:17.377: E/AndroidRuntime(1138): at
Tom.Tracer.App.GetCoords.run(GetCoords.java:28)

This line doesn’t really help me further..

I’m using this code :

@Override
public void run() {
     lm = (LocationManager)context.getSystemService(Context.LOCATION_SERVICE) ;
     lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 2000, 10, locationListener) ; 


}

The Listener

private final LocationListener locationListener = new LocationListener() {
    public void onLocationChanged(Location location) {
        double longitude = location.getLongitude();
        double latitude = location.getLatitude();
        Date date = new Date(); 
        toSave = "NEW" + date.toString()+ "-" + location.getLatitude() + "-" + location.getLongitude() + "/";
        p("To save: " + toSave); 

        }
};

Thanks for your help!

  • 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-15T03:09:51+00:00Added an answer on June 15, 2026 at 3:09 am

    I forgot to call the Looper.prepare() method .
    Thanks for your comments!

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

Sidebar

Related Questions

Possible Duplicate: How do I get the current GPS location programmatically in Android? I
Possible Duplicate: How do I get the current GPS location programmatically in Android? I
Possible Duplicate: How do I get the current GPS location programmatically in Android? Got
Possible Duplicate: Get URL of ASP.Net Page in code-behind I'm trying to hold current
Possible Duplicate: get current latitude and longitude from gps enabled device I use the
Possible Duplicate: Android: How can I get the current foreground activity (from a service)?
Possible Duplicate: Get Current Cursor Position I creating the button like this: button =
Possible Duplicate: How to get current time in ms in PHP? I am trying
Possible Duplicate: How do I get the current location of an iframe? Hi, How
Possible Duplicate: How do you get the current DNS servers for Android? I want

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.