Android: loss of GPS signal power on some phones when starting the camera and SurfaceView

I am working on an application that takes GPS encoded images.

I can get about 15-20 meters of GPS signal accuracy when I don’t start the camera and have at least 3 satellites in range, sometimes 5-7 satellites.

However, when I start an activity that displays a SurfaceView with a camera connected and a GPS code, my accuracy goes down (> 100 meters), but only on some phones.

Phones on which he does not work:

  • Droid Incredible 2
  • HTC Wildfire
  • HTC Inspire

Phones he is working on:

  • Atrix
  • Galaxy Tab
  • Motorolla Droid (original)

So my questions is why this will happen? And of course, how can I fix this?

Here is my code that I use to play GPS

try{ locator = new GeoLocator(this); locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); locationManager.addGpsStatusListener(new GPSStatusManager(locationManager)); Criteria criteria = new Criteria(); criteria.setAccuracy(Criteria.ACCURACY_FINE); criteria.setPowerRequirement(Criteria.NO_REQUIREMENT); bestProvider = locationManager.getBestProvider(criteria, true); Bundle bundle = new Bundle(); //I copied the next two lines out of some tutorial hoping that they would help boost my gps, but I'm really not sure what they do boolean xtraInjection=locationManager.sendExtraCommand(LocationManager.GPS_PROVIDER, "force_xtra_injection",bundle); boolean timeInjection=locationManager.sendExtraCommand(LocationManager.GPS_PROVIDER, "force_time_injection",bundle); locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000, 0.0f, locator); }catch(Exception e){} 
+1
source share
2 answers

Complete the guessing here, but try changing this line:

 criteria.setPowerRequirement(Criteria.NO_REQUIREMENT); 

:

 criteria.setPowerRequirement(Criteria.POWER_HIGH); 

Theory: By not specifying high power requirements for GPS, you let the OS run GPS in the power saving mode that it does when you turn on other energy-intensive accessories. When GPS starts in low power mode, this will make it less accurate.

0
source

The same thing here with the galaxy Gio GTS5660 (Android 2.3.6) and LG5 E610. This is actually an instance of this error, which is likely to be a hardware problem: http://code.google.com/p/android/issues/detail?id=20098

0
source

All Articles