Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to acces file stored in project folder?

Tags:

file

android

I have several files stored in my project /res/values folder, is there any way to open and read these files from my android application? Each file contains text informations about one level of my game. I really appreciate any help.

like image 354
Kubeczek Avatar asked Jan 24 '26 03:01

Kubeczek


1 Answers

I find what I needed here:
http://developer.android.com/guide/topics/data/data-storage.html
"If you want to save a static file in your application at compile time, save the file in your project res/raw/ directory. You can open it with openRawResource(), passing the R.raw. resource ID. This method returns an InputStream that you can use to read the file (but you cannot write to the original file). "
Sorry if My question was not clear.
And big thanks to Radek Suski for some additional information and example. I appreciate that.

like image 160
Kubeczek Avatar answered Jan 25 '26 17:01

Kubeczek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!