Thanks for your suggestion Dianne. In addition to storing the values, I need to show the evolution on a chart and possibly to export the data in some format (like CSV) at a later time. With this in mind, I guess the CP + sqlite back end approach is the easiest for me at this time. Let's say I need to export the data stored the previous day, I'm guessing it is easier for me to do a SQL query to select the data I need to export than to manually extract the data from the binary file.
Thanks again! Bogdan On Apr 17, 4:08 am, Dianne Hackborn <[email protected]> wrote: > If you really care about performance, and all you are doing is reading two > values and writing them over time, just appending this as binary data to a > file would be far, far more efficient than using a SQLite database. > > > > On Sat, Apr 16, 2011 at 1:10 PM, bogde <[email protected]> wrote: > > Thanks for the suggestion. I wasn't clear enough, I'm reading two > > analog values and store them over time; I store two values every ten > > seconds, so I need a database. > > > I implemented a content provider and everything seems to work great so > > far. Actually, it worked pretty well before, except I used to get log > > entries from dalvikvm about sqlite errors (I'm ashamed to say I didn't > > keep the logs so I can't provide any more details). The application > > wasn't crashing or anything but being new to Android I wanted to make > > sure I'm at least using the best and safest methods. > > > I have to update the charting functions to use the CP instead of > > direct database access and I'm done. > > > Thank you all for your help! > > > Bogdan > > > On Apr 15, 10:03 am, Kostya Vasilyev <[email protected]> wrote: > > > Two values? > > > > Service running all the time? > > > > Just put them into static variables accessible from both your Service > > > and Activity classes. Back up into shared preferences or a file, so you > > > can reload the latest values if/when the service/process is killed. > > > > -- Kostya > > > > 14.04.2011 11:17, bogde пишет: > > > > > Thank you both for taking the time to reply. > > > > > I read about ContentProvider and also read the thread you gave me. It > > > > definitely looks like CP is the best approach for me. So I will have > > > > the service write data to the database via CP, and the Activity will > > > > use CP to display data. I wonder if this adds any unneeded overhead to > > > > the whole application. The application runs on a WM8505 based Chinese > > > > tablet with only 128 MB of RAM. The purpose of the entire hardware and > > > > software is to record and display two values. I really hope the > > > > hardware is good enough for the requirements. > > > > > Thanks again! > > > > > Bogdan > > > > -- > > > Kostya Vasilyev --http://kmansoft.wordpress.com > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to [email protected] > > To unsubscribe from this group, send email to > > [email protected] > > For more options, visit this group at > >http://groups.google.com/group/android-developers?hl=en > > -- > Dianne Hackborn > Android framework engineer > [email protected] > > Note: please don't send private questions to me, as I don't have time to > provide private support, and so won't reply to such e-mails. All such > questions should be posted on public forums, where I and others can see and > answer them. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

