0

I am trying to log android sensor data and then upload it to a server (using Parse.com) on a 24 hour basis (for testing it I will set this to one hour though). My problem is that I know how to write a way to save the sensor data to a local txt file, but when the 24hr time passes. How do I do the following:

  1. Upload the 24 hour data
  2. Clear out the 24 hour data
  3. Continue saving data

Basically I don't understand a proper pseudo code / or full code way to do this.

Brian Tompsett - 汤莱恩
  • 5,195
  • 62
  • 50
  • 120
eWizardII
  • 1,884
  • 4
  • 30
  • 54

1 Answers1

1

Just a suggestion. 1. Write a service which will keep on reading sensor data and write to database / file. I would prefer database. 2. Write a service for reading (from db or file) and uploading this data to wherever you wish to. Schedule this service for interval of 1hr using Alarmmanger. U will find plenty of examples about alarmmanager,

Changdeo Jadhav
  • 676
  • 8
  • 21
  • Thanks, that's basically what I ended up implementing was to continue to save the data to a file, then using alarm call up the file every 5 minutes (just for testing) and upload it to the server. – eWizardII Dec 30 '12 at 18:38