My app collects data which it stores in arrays, and I need to be able to access the data from outside the app. The tablet I am using has no SD card, so I'm thinking the best way to transfer data would be to save to 'external' system memory. I have found tutorials to save data on internal storage and for specific data types like pictures onto SD cards, but I can't figure out how to write an arbitrary file to an arbitrary location. Thanks.
2 Answers
This sounds like a perfect time to use a SQLite database. Android comes with SQLite support built in so its easy to set up. You can just create a database and store your array data there (you can even store pictures too as a byte[]). There are a number of tutorials that show how to do this. Here is 1 and 2. It should be pretty easy from there.
4 Comments
Lableable
Thanks! Once data are saved in external memory, would it be accessible from the file browser when I plug it into a computer?
Rarw
Yes you can get the database off the phone - see here and here. Alternativly you can build a file and store it to the build in storage as you were suggesting. This can be done both with and without the database but the database makes it possible to use the information easily on the phone and get it off the phone if you need to.
Lableable
I could get away with building the files myself if it's easier. Would I still need to use the content provider to bring data outside of the app? That's the part that's confusing me right now.