Android Application Development Tutorial - 100 - File Input Stream
Top Comments
All Comments (32)
-
Excellent ...I reached the 100th One...Great work buddy!!!!
-
Thanks 4 ur great work!!!
-
@dunngh In Java, the toString() is present in every class. It is written by the programmer and it's job is to represent the object in words. e.g. if you have a date object Date d = new Date(); then d.toString() will write out the date in words. the toString() class does NOT convert the data into a string ( see Bucky's beginner java tutorial 42). Here,the string class has a constructor which takes a byte array as a parameter and automatically converts it to a string and assignes it to myString.
-
@jacktrow1 I can answer this. Instantiate your FileOutputStream like the following: fos = new FileOutputStream(Environment.g
etExternalStorageDirectory()); in the onCreate. Change the context in your openFileOutput to the following: fos = openFileOutput(FILENAME, Context.MODE_APPEND);. Now try it. If it doesn't work, MESSAGE ME I HAVE ONE WORKING HERE AND I WILL HELP YOU -
use StringBuilder contacts = new StringBuilder(); a bit more efficient
-
I've got a problem and i cant solve it. Any help would be great, when you open the internalData activity on your phone and type something in and save it and then load it, it works, however when you shutdown the app and go back it doesn't remember what i have saved before, if you write to internal storage your file should stay there? is this just me? and how can i solve it?
-
-1 is End of FILE...
-
I'm still an armature at best at coding so correct me if I'm wrong but isn't it a bit inefficient to use the "new" constructor in this while loop. Doesn't it just keep on creating a new string and overwriting all the data in "collected" at every byte read (as apposed to adding new data onto the data in collected)? Wouldn't it be better to use "collected = new string(dataArray):" outside of the loop, as once the loop if finished dataArray contains all the data?
finished my 100 in 3 days. D: tiring. time for me to go to bed.
praveenchukka 4 months ago 12
HAPPY 100 VIDEO, T.T!!! Surviving like a Sir U.U
SuperJALB 1 month ago 7