We have been working on developing service for android platform.
In our service we need to send GPS data (Lat and Long) of device to some external REST service afte
If you run your app on API 21+, using JobScheduler which is described in Google documentation is also a best approach.
Also, if you don't want to change your code structure, you can use your service to keep the CPU ON even if screen is off. Read how to keep CPU On from Google Documentation. Just add permission in your manifest and in your Service.onCreate, put :
PowerManager powerManager = (PowerManager) getSystemService(POWER_SERVICE);
WakeLock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
"MyWakelockTag");
wakeLock.acquire();
And release in Service.onDestroy with wakelock.release().
But be aware that it drains your battery. But if you said that the device will be always plugged in a source power, I think it will not be a problem. Just in case, it will be better to have an admin UI in the app to stop the service manually.