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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:45:10+00:00 2026-06-07T08:45:10+00:00

I am creating a service that will give updates on the users location every

  • 0

I am creating a service that will give updates on the users location every 5 minutes. I am using the DDMS to send the coordinates to the emulator. I want to convert the coordinates and find the location. How can i do this? I am new to android Please help. This is my code so far

 public class GetLocationService extends Service {
protected LocationManager locationManager;
Button start;

@Override
public IBinder onBind(Intent arg0) {
    // TODO Auto-generated method stub
    return null;
}
@Override
public int onStartCommand(Intent intent, int flags, int startId){
    LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
    LocationListener ll = new MyLocListener();
    Location location = new Location("abc");
    ll.onLocationChanged(location ); 
    locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000, 0, ll);
    return START_STICKY;
}

 private class MyLocListener implements LocationListener {
public void onLocationChanged(Location location) {
    if (location != null) {
    Log.d("LOCATION CHANGED", location.getLatitude() + "");
    Log.d("LOCATION CHANGED", location.getLongitude() + "");
    }
    Toast.makeText(GetLocationService.this,
    location.getLatitude() + "" + location.getLongitude(),
    Toast.LENGTH_LONG).show();

    }
  }

}
  • 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-07T08:45:11+00:00Added an answer on June 7, 2026 at 8:45 am

    Try this:

    try{
     Geocoder geo = new Geocoder(youractivityclassname.this.getApplicationContext(), Locale.getDefault());
     List<Address> addresses = geo.getFromLocation(latitude, longitude, 1);
      if (addresses.isEmpty()) {
            yourtextfieldname.setText("Waiting for Location");
      }
      else {
         if (addresses.size() > 0) {       
            Log.d(TAG,addresses.get(0).getFeatureName() + ", 
             " + addresses.get(0).getLocality() +", 
             " + addresses.get(0).getAdminArea() + ",
             " + addresses.get(0).getCountryName());
    
         }
      }
    }
    catch (Exception e) {
        e.printStackTrace(); 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a windows service that will let different users connect to the PC
I'm working on creating a windows service that will send emails to a customer
I'm manually creating a WCF service that will act as a DAL and have
I am creating Windows service class in Python that will eventually display a Window
I'm interested in creating a service that will receive a text message and based
I am on a project where I will be creating a Web service that
I am going to be creating a web service that will be passing confidential
I'm creating a web service in Java that will be consumed by an external
I'm creating a watch dog service that will be monitoring other services on various
I plan on creating a windows service that will monitor an exchange mailbox for

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.