91-9990449935 0120-4256464 |
Android External Storage ExampleLike internal storage, we are able to save or read data from the device external memory such as sdcard. FileInputStream and FileOutputStream classes are used to read and write data into the file. Example of reading and writing data in the android external storageactivity_main.xmlDrag the 2 edittexts, 2 textviews and 2 buttons from the pallete, now the activity_main.xml file will like this: File: activity_main.xml
Provide permission for the external storageYou need to provide the WRITE_EXTERNAL_STORAGE permission. File: Activity_Manifest.xml
Activity classLet's write the code to write and read data from the android external storage. File: MainActivity.java
|