0

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 2

1

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.

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks! Once data are saved in external memory, would it be accessible from the file browser when I plug it into a computer?
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.
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.
You mean like this heres an example that works w/o an SD card
0

I'm not sure that you can write to an arbitrary place on the Android system. You could write to a file in /data/data// and then email that file to yourself.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.