Android Application Development Tutorial - 100 - File Input Stream

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
8,292
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Aug 20, 2011

Check out the full series at http://www.thenewboston.com/

Here is a link to the mybringback YouTube Channel. Go and subscribe now!

http://www.youtube.com/user/mybringback

Also, the mybringback official website:

http://mybringback.com/

  • likes, 1 dislikes

Link to this comment:

Share to:

Top Comments

  • finished my 100 in 3 days. D: tiring. time for me to go to bed.

  • HAPPY 100 VIDEO, T.T!!! Surviving like a Sir U.U

see all

All Comments (32)

Sign In or Sign Up now to post a comment!
  • 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?

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more