Wait for GPS activity

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

Wait for GPS activity

Postby chich » Fri Oct 08, 2010 9:38 am

hey guys,

my app requests gps updates, everything working as expected, however for some reason unless the gps has a lock on our exact position, google maps shows what i think is the network tower approximation to where we are. in an attempt to try and remove this, im trying to lock down the activity until the gps lock actually kicks in. at the moment my current implementation works...but it has has weird results.

Code: Select all
        public void onStatusChanged(String provider, int status, Bundle extras)
        {
            switch (status)
            {
                case LocationProvider.AVAILABLE:
                                       
                    // Set variable
                    isGPSAvailable = true;
                    DisplayToast("GPS Status: " + status); // BNMEEE
                    break;
                   
                default:
                                   
                    // Set variable
                    isGPSAvailable = false;
                    break;
                       
            }
        }


just a very simple check status, if its available then set the variable, etc etc. the problem is that the status doesnt seem to be "AVAILABLE" although the onLocationChanged method keeps firing off.

on the emulator i have to send the gps location twice to get 'status' to become available....however that only works a small percentage of the time, usually the onStatusChanged method doesnt even trigger.

running on a real phone produces almost the same results...the onStatusChanged doesnt trigger whilst onLocationChanged does.

so does anyone know of a more efficient way to determine whether the gps signal is actually locked or if the service is running "normally" ?

cheers
chich
Junior Developer
Junior Developer
 
Posts: 19
Joined: Sat Jul 10, 2010 9:37 am

Top

Return to Map Problems

Who is online

Users browsing this forum: Exabot [Bot] and 5 guests