1 / 8

Read and Write Files

Read and Write Files. By the end of this lab you will be able to: Write a file in internal storage Read a file from internal storage Write a file on SD card Read a file from SD card Install an app on the Android emulator. Prerequisites. Main classes you will need to learn about:

Download Presentation

Read and Write Files

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Read and Write Files • By the end of this lab you will be able to: • Write a file in internal storage • Read a file from internal storage • Write a file on SD card • Read a file from SD card • Install an app on the Android emulator CS440

  2. Prerequisites • Main classes you will need to learn about: • BufferedReader • BufferedWriter • OutputStreamReader • OutputStreamWriter • StringBuffer • Main methods you will need to learn: • readLine!! • Write • openFileOutput • openFileInput

  3. Java.io

  4. Java.io

  5. The mission • Create a file in internal storage • Create all the necessary objects to write in this file • BufferedWriter • OutputStreamWriter • Write in the file • Read from file • Create all the necessary objects to read from this file • BufferedReader • OutputStreamReader CS440

  6. The endless doubt • How do you know you have created the file? • How do you know you have written in the file? CS440

  7. The mission impossible? • Create a file in the SD card • Create all the necessary objects to write in this file • BufferedWriter • OutputStreamWriter • Write in the file • Read from file • Create all the necessary objects to read from this file • BufferedReader • OutputStreamReader CS440

  8. References • http://www.vogella.de/articles/AndroidFileSystem/article.html • http://www.tylerfrankenstein.com/create-android-emulator-sd-card-and-write-data-to-it • http://stackoverflow.com/questions/9351904/cannot-write-to-sdcard-in-android-emulator CS440

More Related