1

I am designing an app which requires to get the activities using activity recognition.But i am new to android.And now i can implement and get results of activities but i have some questions here.I have completed the code.if any one answers these questions it will be very useful to me.

  1. Is there any time interval(to get updates) which is accurate and enough (not to drain the battery and getting good results).
  2. how to get previous activity (here i want to compare the current activity with previous activity).
Niranjan
  • 1,879
  • 2
  • 22
  • 28

1 Answers1

0

For you first question. It really depends on your application. I would suggest you set the interval to 30 seconds and see if you are happy with the battery drain/accuracy ratio. If you feel it is too much of a drain increase the interval if you feel it is not accurate enough reduce the interval. I have got it set to 15 seconds to detect when the user starts driving and I am happy with the results.

As for you second question, I would suggest you save it using Shared Preferences

Let me know how it goes.

DrkStr
  • 1,752
  • 5
  • 38
  • 90
  • Thank you @DrkStr i have tried using shared preferences but i'm not getting the previous activity so i used database which help me to save all activities respective to each time working well.... – Niranjan Aug 07 '14 at 05:06