开发者

Using a SAVE Button

I have have completed an application and would like to add a save button to store all the string values throughout the activity. I have read about csv write, sqlite and others and trying to determine the best way to go. I would like to basically create a report with a header, column headings and then the data and not sure the best way to proceed. I would like to have a filename consisting of the date/time and name like rep开发者_开发问答ort one ie: report one 2011091190400. Each time save is pressed I would like to append data to file as long as the date is the same, not the time.

Is the best way sqlite or csv file? I usually implement something then get it working then find out there is a better way so this time I am asking for advice/recommendations before I start.

There is not much data but the intent is open the file later on a pc using excel.

thanks in advance.


Ok, what is the best is depend on your need and use of data.

If you have a data like table format and you want to use it frequently then SQLIte is best. And if you have a bulk data like a string format or various type then File is also suitable,

and you want to store a premitive data for your application internal usage then you can use SharedPreference is suitable.

EDIT: here you mentioned you have to create a report like, header and columns wise then SQLITE is the best example for that.

Android - DataStorage will help you.

Thanks.


if you want to open the file later, you need to format it at some point.

do you intend to open the file by connecting the usb cable to the phone ?

if so, i recommend that you save a csv file with a line for each input, and a simple in-memory datetime verify mechanism (for instance, just keep the time code of the last input to make sure you don't input it twice.)


I always look for easiest way and later find out easy is not the the best or able to fill my needs. sqlite seems to be the answer for me. thanks for the link, I will go back to reading. I am not a programmer but have a great idea and have my layouts working and all my java code working well so I guess its time to advance my knowledge. I feel like a caveman trying to make a rocket ship :)

I will update my question with my decision asap.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜