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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:21:39+00:00 2026-06-10T12:21:39+00:00

i am getting different Gps coordinates in same location why its happening. But i

  • 0

i am getting different Gps coordinates in same location why its happening. But i need to change gps coordinates only moves after 10 meters . How can i do that.

Here is my code.

  private static final long MINIMUM_TIME_BETWEEN_UPDATES = 1000; 
            private  static final float MIN_GEOGRAPHIC_POOLING_DISTANCE = (float)10.0;


 double myLat_Values;
        double myLog_Vaues;


locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
 locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, MINIMUM_TIME_BETWEEN_UPDATES, MIN_GEOGRAPHIC_POOLING_DISTANCE, new MyLocationListener());


private class MyLocationListener implements LocationListener {

        @Override
        public void onLocationChanged(Location location) {
            longitude_str = String.valueOf(location.getLongitude());
            latitude_str = String.valueOf(location.getLatitude());

             Double longitude_number = Double.valueOf(longitude_str);
                 DecimalFormat dec = new DecimalFormat("#.000000");
                longitude_message = dec.format(longitude_number);

             Double latitude_number = Double.valueOf(latitude_str);
             DecimalFormat decim = new DecimalFormat("#.000000");
                latitude_message = decim.format(latitude_number);

                try
                {
                    myLat_Values = Double.valueOf(latitude_message);  
                    myLog_Vaues = Double.valueOf(longitude_message);
                }
                catch(NullPointerException ex)
                {
                    myLat_Values = 0;
                    myLog_Vaues = 0;
                }

     System.out.println("GPS Values Clockout:"+myLat_Values+"-"+myLog_Vaues);

        }       

    public void onProviderDisabled(String s) {}
        @Override
        public void onProviderEnabled(String provider) {}
        @Override
        public void onStatusChanged(String provider, int status, Bundle extras) {}      
    }

also i used these into manifestfile :

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

I used this link

please anybody give a suggestion how to solve my problem.

Thank you in advanced.

  • 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-10T12:21:41+00:00Added an answer on June 10, 2026 at 12:21 pm

    When you use NETWORK_PROVIDER ,it returns GPS co-ordinates based on the Network Service Provider you are using. But when you are using GPS_PROVIDER it returns GPS co-ordinates based on the satelites.

    For Accuracy Criteria, add following code,

    locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
    Criteria criteria = new Criteria();
    criteria.setAccuracy(Criteria.ACCURACY_HIGH);  
    locationManager.getBestProvider(criteria, true);
    
    • ACCURACY_HIGH less than 100 meters
    • ACCURACY_MEDIUM between 100 – 500 meters
    • ACCURACY_LOW greater than 500 meters

    Also, you need to declare following GPS Permission in AndroidManifest.xml

    <uses-permission android:name="android.permission.ACCESS_GPS"></uses-permission>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble getting the GPS's onLocationChanged to run on a different thread. I
I am getting different results performing the exact same query using regular statements and
I am getting different results for the same locator. For example //table[@id='foo'] returns true
I am getting different results when I run the query with above clause but
This must be a very noob question, but via googling I am getting different
Given the following code why am I getting different values for a and b
I'm getting a different behavior than my expectation (and also different than Microsoft C++).
I've never had this issue before, so I'm somewhat lost. I'm getting two different
I'm currently looking at different solutions getting 2 dimensional mathematical formulas into webpages. I
I'm getting book info from two different Google Books bookshelves via the API and

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.