How can I create file.txt and insert data on file with content of some of variable on my code for example : population [][]; on Android, so there will be folder files on our package in file explorer (data/data/ourpackage/files/ourfiles.txt) Thank You
Share
Using this code you can write to a text file in the SDCard.
Along with it, you need to set a permission in the Android Manifest.
This is the code :
Before writing files you must also check whether your SDCard is mounted & the external storage state is writable.