• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps How do I store sensor data based on a daily basis?

Niga

Lurker
Hello, I'm making a step counting application and I'm trying to have something like an activity log that displays steps taken each day, my question is how do I do that? Where do I start when it comes to managing that data?
 
In terms of acquiring the step data, are you intending to use some kind of hardware to automatically do this, or would the user be inputting this data manually?

In terms of managing the data, there are two main aspects:-

1. Storing it. This could be achieved by creating a very simple database table containing two columns:- date, number_of_steps
2. Presenting it to the user. Can be done by presenting a ListView.

But it really depends what you mean by 'managing the data'.
 
In terms of acquiring the step data, are you intending to use some kind of hardware to automatically do this, or would the user be inputting this data manually?

In terms of managing the data, there are two main aspects:-

1. Storing it. This could be achieved by creating a very simple database table containing two columns:- date, number_of_steps
2. Presenting it to the user. Can be done by presenting a ListView.

But it really depends what you mean by 'managing the data'.


I'm not familiar with databases in android but I have experience with MySQL and Oracle 10g,

How do I start with what you are saying? I have made some progress with getting the data from the sensor but it counts the steps from the last reboot.
 

Attachments

  • 18361204_1587122137995738_265483849_n.png
    18361204_1587122137995738_265483849_n.png
    47.7 KB · Views: 113
Your first step will be a crash course in SQLite, the database included with Android. There are many web resources on this.

I'd save the total steps at the end of each day. Then you can always calculate the daily number. Of course you will have to cope with the sensor rebooting and resetting its step count.

Your initial UI is a good start, but I'd say you need a ListView. Again, many web links on how to use this as it's a common UI component.
 
Back
Top Bottom