I am working on a Location-App which should begin to track some statistic data based on longitude and latitude when the user presses a Button
. All this stuff wo
Here is application that does something like you want:
https://github.com/sergstetsuk/CosyDVR/blob/master/src/es/esy/CosyDVR/CosyDVR.java
Main Activity starts on BackgroundVideoRecorder service.
Intent intent = new Intent(/*CosyDVR.this*/getApplicationContext(), BackgroundVideoRecorder.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startService(intent);
bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
look at mConnection onServiceConnected,onServiceDisconnected.
Here is BackgroundVideoRecorder class:
https://github.com/sergstetsuk/CosyDVR/blob/master/src/es/esy/CosyDVR/BackgroundVideoRecorder.java
It implements LocationListener. So has onLocationChanged, onProviderDisabled, onProviderEnabled, onStatusChanged.