rfresh Well-Known Member Licensed User Longtime User Feb 27, 2012 #1 I need to save some data to a file and then read it back into a variable. Is there a tutorial showing me some examples of doing file io? I understand that I should not try to write to an sd card since not all devices will have one. I assume it's recommended that I create a folder for my app to write the data to? My have a very small amount of data to store. Thanks...
I need to save some data to a file and then read it back into a variable. Is there a tutorial showing me some examples of doing file io? I understand that I should not try to write to an sd card since not all devices will have one. I assume it's recommended that I create a folder for my app to write the data to? My have a very small amount of data to store. Thanks...
W wl Well-Known Member Licensed User Longtime User Feb 27, 2012 #2 Have a look at: Basic4android - RandomAccessFile Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Feb 27, 2012 #3 Also see this tutorial: Text files Upvote 0
rfresh Well-Known Member Licensed User Longtime User Feb 27, 2012 #4 What is the generally accepted standard for where we should write our data? Should I make a folder off of the root for my app? Or is there another, recommend location? Upvote 0
What is the generally accepted standard for where we should write our data? Should I make a folder off of the root for my app? Or is there another, recommend location?
stevel05 Expert Licensed User Longtime User Feb 27, 2012 #5 While not all devices will support and SDCard, they will need some form of additional memory to install apps on, I have seen refferred to as NAND on some devices. This is still external memory as far as Android is concerned and can be accesses via File.DirRootExternal or File.DirDefaultExternal (app installation folder) which is treated the same as the SDCard on devices that don't have NAND. It should also pass the File.ExternalWritable test see here Last edited: Feb 27, 2012 Upvote 0
While not all devices will support and SDCard, they will need some form of additional memory to install apps on, I have seen refferred to as NAND on some devices. This is still external memory as far as Android is concerned and can be accesses via File.DirRootExternal or File.DirDefaultExternal (app installation folder) which is treated the same as the SDCard on devices that don't have NAND. It should also pass the File.ExternalWritable test see here
rfresh Well-Known Member Licensed User Longtime User Feb 27, 2012 #6 So, I want to be writing my file data to External storage? (NAND or SDCARD) On my Droid3 I see the following folders off of the root: sdcard sdcard-ext sys system tmp That's it. Last edited: Feb 27, 2012 Upvote 0
So, I want to be writing my file data to External storage? (NAND or SDCARD) On my Droid3 I see the following folders off of the root: sdcard sdcard-ext sys system tmp That's it.
rfresh Well-Known Member Licensed User Longtime User Feb 28, 2012 #7 Is there a Lib I need to declare to use RandomAccessFile? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Feb 28, 2012 #8 Yes. The RandomAccessFile library. Upvote 0
stevel05 Expert Licensed User Longtime User Feb 28, 2012 #9 Yes use File.DirDefaultExternal or File.DirRootExternal and a path if you want it somewhere different. Upvote 0
Yes use File.DirDefaultExternal or File.DirRootExternal and a path if you want it somewhere different.