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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:36:51+00:00 2026-05-24T15:36:51+00:00

I am planning to use a GPS enabled Android phone to create an application

  • 0

I am planning to use a GPS enabled Android phone to create an application that will not use the internet to access the user’s current position.

What I need to know is how to code it in Eclipse. Can you share a piece of code in Java that will return the longitude and latitude of the GPS user without accessing the internet?

Also, is it possible to make it so that it will not access the cell network- getting the user’s position directly from the satellite?

  • 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-24T15:36:51+00:00Added an answer on May 24, 2026 at 3:36 pm

    Add the following line to your Android Manifest, above the application tag:

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    

    Then you’ll need an Activity or a Service that has code like this:

    LocationManager locationManager = (LocationManager)this.getSystemService(Context.LOCATION_SERVICE);
    locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, new LocationListener() {
        onLocationChanged(Location location) {
             // put code in here to respond to a change in location
        }
        onProviderDisabled(String provider) {
             // put code in here to respond to GPS being disabled
        }
        onProviderEnabled(String provider) {
            // put code in here to respond to GPS being enabled
        }
        onStatusChanged(String provider, int status, Bundle extras) {
            // put code in here to respond to change in GPS status (e.g. GPS becomes unavailable)
        }
    });
    

    Edit: When you call LocationManager locationManager = (LocationManager)this.getSystemService(Context.LOCATION_SERVICE);
    locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, new LocationListener()...

    this sets a new LocationListener that listens to the GPS. The first number indicates the minimum number of milliseconds between each check (note this is just an indicator, the system may check more/less frequently), and the second number indicates the minimum distance travelled in metres between each check. So if both are 0, then the GPS will be checked constantly, and new values will be sent to onLocationChanged() as soon as they are available.

    For more detailed information, see http://developer.android.com/guide/topics/location/obtaining-user-location.html

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

Sidebar

Related Questions

We're planning to use standard ASP.NET user authentication for our application. However, by default
I was planning to use url routing for a Web Forms application. But, after
I am planning to use jquery in Rails instead of prototype. I am not
im planning to use java/jsp for web application installed on virtual web hosting space
I am planning to use facebook authentication for my application. I thought of using
I am planning to use coverflow control in my Silverlight application, but I am
I am planning to use Snowball stemming solution in one of my commercial application.There
I am planning to use Ext JS for a large application. The application's features
I am planning to use ShellExecute for the updater of an application written in
I am planning to use various objects that are exposed as COM objects. 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.