You are here
Home > Android > Reading & Writing File in Android

Reading & Writing File in Android

Hello Friends, Today I am writing this post to share that how to read and write file to external storage in Android. In the latest version of android Marshmallow, we cannot read and write file directly in external storage even we declare permission in manifest file but in lower version we can use external storage after declaring permission in manifest file.

To access external storage in Marshmallow we need to take permission at runtime. From the code below we can read & write file to external storage on any android version.

AndroidManifest.xml

activity_main.xml

MainActivity.java

Screen Shot

Reading & Writing File in Android

Download Android Studio Project

Thanks

Rajesh Kumar Sahanee
I am a passionate Java Developer and I like Computer Programming. I love to do some interesting experiments and listening music in my free time.
http://www.zatackcoder.com

Comments

zatackcoder
Top