I want to send to my server every 24 hours how many steps I walked. I have an AlarmManager to go off alarmManager.setRepeating(AlarmManager.RTC_WAKEUP,System.currentTimeMillis(),1000*60*60*24, pendingIntent1)
Now this is where I am stuck... how should I measure the daily steps?(remember I need to send this in the background) I can use this a service that could override this function public void onSensorChanged(SensorEvent event)
this doesn't seem so accurate since my Service could be destroyed(and battery will get drained very fast).
Or
I can try and use the Google Fitness but I need to request connection from user every time I try to get the data mGoogleApiClient.connect()
(I need to get this data in the background)
Anyone have experience doing this?