android location listener question
<p>I am developing an location aware application that needs to know the users location.
The problem is that the application doesn't seem to work properly.</p>

<p>By properly I mean that every time I have to first open an application (like cardio trainer) in order to get a GPS signal and then run my program, otherwise the GPS icon on the notification bar is blinking like it blinks when the device tries to get GPS signal and after a while it stops and no location is returned!</p>

<p>this is really weird because it shouldent stop, is there an interval that android provides the gps to get signal?</p>

<p>on the documentation I haven't found anything about that.</p>

<p>my code is as follows:</p>

<pre><code>lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 60000, 10, locationListenerGps);
LocationListener locationListenerGps = new LocationListener() {
    public void onLocationChanged(Location location) {
        locationResult.gotLocation(location);
        Log.e("##################","MyLocation got GPS location accuracy:
        "+location.getAccuracy()+" Altitute: "+location.getAltitude()+" log:
        "+location.getLongitude()+" lat: "+location.getLatitude());
     }
    public void onProviderDisabled(String provider) {}
    public void onProviderEnabled(String provider) {}
    public void onStatusChanged(String provider, int status, Bundle extras) {}
  };
</code></pre>

<p>That should open the gps provider and register a listener called locationListenerGps that would be called by the location manager every 1 minute or 10 meters right?</p>

<p>why I have to open cardioTrainer first to get a GPS signal?</p>

<p>thanks in advanced maxsap </p>
