[Android Head-Units] renedis:
I too have this problem and is not related with the place of the GPS unit.

IT simply has to do with the fact that it doesn't update satellite positions on boot. When connected to the internet on boot (if this is configured by Newsmy) or a "cache" file with expected positions it will be solved. I haven't found a app yet that can fix this issue.

Copied from the internet:

The process of interpreting the GPS data to compute with a location is handled centrally in Android itself. The Android system offers an interface for apps to query the location without having to worry about the details of whether it came from GPS, cell towers, or Wi-Fi networks.

This way, only the Android system has to compute the location, using any possible sources, it can give this location to many apps without duplicating effort, and (as you've noticed) each app doesn't have to start from scratch to compute the location. More recent Android versions also do clever tricks like giving a less precise location to apps that have the "approximate (network-based) location" permission but not the "precise (GPS) location" permission, regardless of which methods were actually used to determine the location.

Internally, this works with what's called a bound system service: an IPC mechanism for different processes to receive data from the service that actually computes the location. The service does run in user space, not inside the kernel, and like any other Android app it runs inside its own process. (Only the very low levels of the GPS receiver driver run inside the kernel.)

If you're interested, you can learn more by reading here:

http://developer.android.com/guide/topics/location/strategies.html

---------- Post added at 01:54 PM ---------- Previous post was at 01:44 PM ----------

I've found a code that updates GPS positions..

I absolutely have no idea where to place this code in android.

Also, the code is not 100% right. the following adjustments should be done:

You shouldn't get the Location object's time from its extras, but instead call location.getTime(). This will ensure that you get its exact fix time, even if its cached/old.

public class LocationRecorder extends Service {

private volatile Location lastLocation;

private LocationManager locationManager;

private LocationListener locationListener;

private static volatile PowerManager.WakeLock wakeLock = null;

private static synchronized PowerManager.WakeLock getWakeLock(Context context) {

if (wakeLock == null) {

PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);

wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "LocationRecorder");

wakeLock.acquire();

}

return wakeLock;

}

public static void startLocationRecorder(Context context, Intent service) {

getWakeLock(context);

context.startService(service);

}

[MENTION=439709]override[/MENTION]

public void onCreate() {

Log.d("LocationRecorder", "Starting Location Service");

locationManager = ((LocationManager)getSystemService(LOCATION_SERVICE));

locationListener = new LocationListener() {

[MENTION=439709]override[/MENTION]

public void onLocationChanged(Location location) {

Log.d("Location Changed", location.toString());

if (location.getExtras()!=null) {

String x = "";

for (String key : location.getExtras().keySet()) {

x+=key+":"+location.getExtras().get(key).toString()+", ";

}

Log.d("Location Changed Extras", x);

}

setLocation(location);

}

public void onStatusChanged(String provider, int status, Bundle extras) {

Log.d("Status Changed", provider+" "+status);

if (extras!=null) {

String x = "";

for (String key : extras.keySet()) {

x+=key+":"+extras.get(key).toString()+", ";

}

Log.d("Status Changed Extras", x);

}

}

public void onProviderEnabled(String provider) {

Log.d("Provider Enabled", provider);

}

public void onProviderDisabled(String provider) {

Log.d("Provider Disabled", provider);

}

};

locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);

waitForLocation();

}

[MENTION=439709]override[/MENTION]

public int onStartCommand(Intent intent, int flags, int startId) {

return Service.START_REDELIVER_INTENT;

}

[MENTION=439709]override[/MENTION]

public void onDestroy() {

locationManager.removeUpdates(locationListener);

try {

wakeLock.release();

wakeLock = null;

}

catch (Exception e) {

wakeLock = null;

}

Log.d("LocationRecorder", "Destroying service");

super.onDestroy();

}

protected void waitForLocation() {

new Thread() {

[MENTION=439709]override[/MENTION]

public void run() {

setLocation(null);

for (int i=0; i<3;i++) {

Log.d("LocationRecorder", "Waiting for location");

try {Thread.sleep(10000);} catch(Exception e) {};

if (getLocation() != null) {

Log.d("LocationRecorder", "Sending new location!");

new Utilities(LocationRecorder.this).updateLocation(getLocation().getLatitude(),

getLocation().getLongitude(), getLocation().getAccuracy());

break;

}

}

stopSelf();

}

}.start();

}

public synchronized void setLocation(Location newLocation) {

lastLocation = newLocation;

}

public synchronized Location getLocation() {

return lastLocation;

}

[MENTION=439709]override[/MENTION]

public IBinder onBind(Intent intent) {

return null;

}

---------- Post added at 02:06 PM ---------- Previous post was at 01:54 PM ----------

Thins like this will work to if you have internet activated on the HU.

https://play.google.com/store/apps/details?id=com.androidlab.gpsfix

https://play.google.com/store/apps/details?id=com.Double.FasterFix

https://play.google.com/store/apps/details?id=org.fastergps

Or an entire post on XDA about editing gps.conf:

http://www.xda-developers.com/android/gps-lock-faster-xdatv/