Hi everyone,
I'm developing an app which makes use of the GPS and I am not able to
get a fix. Some useful facts that might help:
- The device is running Android 2.1.
- GPS is obviously enabled through the device settings, actually the
icon shows up on the notification bar.
- GPS works fine when using other apps like Google Maps, it gets a fix
after just a few seconds.
- The app has all the neccesary permissions defined in the manifest,
such as ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION or ACCESS_GPS.
Some code:

public boolean start_gps(){
        boolean started = false;
        try{
                if(!gpsStarted){
                        location_manager = location_manager == null ? 
(LocationManager)
getSystemService(LOCATION_SERVICE) : location_manager;
                        if (location_manager != null)
                        {
 
location_manager.requestLocationUpdates(LocationManager.GPS_PROVIDER,
scanTimer, 0, location_listener);
                        }
                        gpsStarted = true;
                        Toast.makeText(PFCLocatorApp.this, 
R.string.message_gps_on,
Toast.LENGTH_LONG).show();
                        started = true;
                }
        }
        catch (Exception e)
        {
                //notify_error(e);
        }
        return started;
    }

ScanTimer's value depends on the app's settings but I've also tried
with a fixed value and it does not work either. Also location_listener
is properly defined. I have tried to show another Toast just after the
call to requestLocationUpdates() and it shows up too, so I know the
code is actually executed.

I think I'm not missing anything, hope someone can help me because
it's driving me crazy. If you need any further

Thank you so much in advance.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to