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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:45:31+00:00 2026-06-03T03:45:31+00:00

In this case I use GPS as a Provider, I try walking inside the

  • 0

In this case I use GPS as a Provider, I try walking inside the building but seem like it doesn’t find the location. Yeah, it makes sense that in the building GPS not work. So, Why isProviderEnabled return true? Anyway, What is the way that i should implement “Searching for GPS signal”?

            String context = Context.LOCATION_SERVICE;
            locman = (LocationManager)getSystemService(context);


            Criteria criteria = new Criteria();
            criteria.setAccuracy(Criteria.ACCURACY_FINE);
            criteria.setAltitudeRequired(false);
            criteria.setBearingRequired(false);
            criteria.setPowerRequirement(Criteria.POWER_LOW);
            String provider = locman.getBestProvider(criteria, true);

            if (locman.isProviderEnabled( LocationManager.GPS_PROVIDER )) {
            // Change from 'Searching for GPS signal to Use GPS'
                txtGPS.setText("Use GPS");

            }
            locman.requestLocationUpdates(
                    provider,MIN_TIME, MIN_DISTANCE, locationListener);
  • 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-03T03:45:33+00:00Added an answer on June 3, 2026 at 3:45 am

    isProviderEnabled() only looks if you have enabled GPS or not, it dosn’t take care if you see any satellites!

    If you like to check, if there are any satellites you have to use the gpslistener and this is how to use the gpslistner:

    /**
             * Hier wird ein neuer GPSListener erstellt.
             * Dieser Überprüft ob es Sichtbare Sattelitten gibt.
             */
            mLocationManager.addGpsStatusListener(new GpsStatus.Listener() {
    
                public void onGpsStatusChanged(int event) {
    
                    // Hier wird der EVENT gefiltert
                    // Dieser EVENT erscheint immer wenn GPS Satteliten in sicht sind
                    if (event == GpsStatus.GPS_EVENT_SATELLITE_STATUS) {
                        // GpsStatus casten
                        GpsStatus status = mLocationManager.getGpsStatus(null);
    
                        // Interable sats instanzieren und casten
                        Iterable<GpsSatellite> sats = status.getSatellites();
    
                        // SATCOUNT instanzieren, wird benötigt um die Satteliten zu zählen
                        int SATCOUNT = 0;
    
                        // Interator satI instanzieren und casten.
                        Iterator<GpsSatellite> satI = sats.iterator();
    
                        // Hier wird die anzahl der Satteliten gezählt
                        while(satI.hasNext()){
                            // Den Interator auf den nächsten Satteliten verweisen
                            GpsSatellite satellite = satI.next();
    
                            // Satelitten zählen
                            SATCOUNT++;
                            Log.d("GPSListner", "While with SATCOUNT = " + SATCOUNT + " Elevation des Satellites = " + satellite.getElevation());
    
    
                        }
    
                        // Prüfen ob SATCOUNT 4 Satelitten hat
                        if(SATCOUNT > GPS_SAT_COUNT){
    
                        String test = String.valueOf(SATCOUNT);
                        Log.d("GPSSTATUS", "(true) Anzahl der Sattelitten: " + test );
    
                        // Boolean mGpsOk auf true setzen
                        GPSService.mGpsOk = true;
                        }else{
    
                        String test2 = String.valueOf(SATCOUNT);
                        Log.d("GPSSTATUS", "(fasle) Anzahl der Sattelitten: " + test2 );
    
                        // Boolean mGpsOk auf false setzen
                        GPSService.mGpsOk = false;
    
                        }
    
                    }
                }
            });
    

    To get this one working, you need to start a locationmanager which wants to use the gps, now your gpslistner can check if there are any satellites in view and writes a variable true or false. Afterwards you can check the Variabel. If its true (at least 4 Satellites in View) you can use Criteria.ACCURACY_FINE else you can use Criteria.ACCURACY_COARSE. Don’t forget to set the permission for both!

    Best Regards

    safari

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

Sidebar

Related Questions

I have this use case of an xml file with input like Input: <abc
The use case is some what like this: public class SomeClass : ICloneable {
I am trying to search for best provider with this case below: // GPS
In my app, I wanna use both location provider. That means, if the gps
My use case is this... I have a project that has two production branches.
I'm starting to use Mercurial on my web server (in this case MediaTemple's Grid).
How can I use output caching with a .ashx handler? In this case I'm
I have a use case with NServiceBus explained in this question. Essentially there is
I'm writing a Python generator which looks like cat. My specific use case is
Consider this case: dll = LoadDLL() dll->do() ... void do() { char *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.