GPS Location tracking even when app is closed(Not running in Background)/ScreenLocked
I want to track user location very similar to strava, even after the is closed. I tried AlarmManager but it's not giving me execution after every one minute Just using a Service as BiGGZ explained won't work in case the device enters sleep mode. The Service won't be killed though but your app won't get any CPU. Therefore you would have to acquire a partial Wakelock to prevent the device from entering sleep mode. @Override public void onCreate() { super.onCreate(); PowerManager pm = (PowerManager)getSystemService(Context.POWER_SERVICE); wakeLock = m.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,