I have only one device (HTC HD Deside) for testing my apps and when I want to get GPS data with
locationManager.requestLocationUpdate(criteria,0,0,this); //critera = "gps"
My GPS icon appears in the notification bar but it "flashes", as if It meant my device is looking for and get the GPS data. Accordingly, my apps takes too much "thinking" times before it succeeds to get data from GPS (~1mn to 3mn !) (before the icon stop flashes)
So, I'm obliged to create a while instruction like this :
do{
lastLocation = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);
}while(System.currentTimeMillis() - lastLocation.getTime() > 5000);
Thanks that, I'm sure to get a recently location but I lost too much time.
What's the problem? is it the hardware? Can I find a better way for fix this? Can I get "quickly" the GPS data? :/ (1~5 sec)
GPS sensor may take more time when you are inside a building or covered area. Sometimes if you are inside a building and no GPS signals available, its always blinking and draining the battery a lot. Try to utilize some other provider.