예를 들어 처음엔 3초, 그다음엔 4초, 그다음엔 5초, 그다엠엔 6초,, 7초 이런식으로요..
public boolean process(final Context context) {
locationProvider = LocationManager.GPS_PROVIDER; // GPS 사용
locationManager = (LocationManager)context.getSystemService(Context.LOCATION_SERVICE);
if(locationManager.isProviderEnabled(locationProvider) == true) { // GPS가 On 이라면
locationListener = new LocationListener() {
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
// TODO Auto-generated method stub
}
@Override
public void onProviderEnabled(String provider) {
// TODO Auto-generated method stub
}
@Override
public void onProviderDisabled(String provider) {
// TODO Auto-generated method stub
}
@Override
public void onLocationChanged(Location location) {
// TODO Auto-generated method stub
if(location != null) {
longitude = (int)(location.getLongitude() * 1000000);
latitude = (int)(location.getLatitude() * 1000000);
Log.d("MIZNO", "[Process.java] GPS LBS : " + longitude + " / "+ latitude);
Log.d("MIZNO", "[Process.java] timeCycle : " + timeCycle);
Toast.makeText(context, "GPS LBS : " + longitude + " / "+ latitude, Toast.LENGTH_SHORT).show();
timeCycle = timeCycle + 1000;
}
}
};
locationManager.requestLocationUpdates(locationProvider, timeCycle, 0, locationListener);
// locationManager.requestSingleUpdate(locationProvider, locationListener, null);
}
return true;
}
이런식으로 구현해봤는데. 로그에 찍히는건 3000, 4000, 5000 이렇게 늘어나지만