How do i create a file in phone memory instead of SD card.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should only have access to the directories possessing the correct access rights for your application.
Usually, you will use the method
Context.getDir("example", MODE_PRIVATE)to get a writeable directory on the phone memory.It creates a directory called
/data/data/[package_name]/app_example.You will then be able to create files in that directory.
You can also use :
which will create and open a file named
/data/data/[package name]/files/filetest.