I would like to create file of format .properties
in android app. Unfortunately, I am getting error java.io.FileNotFoundException: /app.properties: open failed: EROFS (Read-only file system) Any idea why?
Asked
Active
Viewed 5,461 times
-5

tshepang
- 12,111
- 21
- 91
- 136

user3415458
- 765
- 1
- 6
- 5
-
can you show a little from your code ? – Ranjit Mar 14 '14 at 11:39
-
and also check that you gave WRITE_EXTERNAL_STORAGE permission in manifest.. – Ranjit Mar 14 '14 at 11:40
2 Answers
0
try to use "android.permission.WRITE_INTERNAL_STORAGE" insert it to AndroidManifest.xml example's below:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.megazy.android"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />

323go
- 14,143
- 6
- 33
- 41

user3113670
- 1,909
- 1
- 12
- 8
-
-
Yes there is no such permission, WRITE_INTERNAL_STORAGE. This should not be marked as correct-answer. – Hassan Siddique Apr 24 '16 at 13:23
0
Of course you cannot write to a file called
/app.properties
as that would be located in the top-level or root directory of the device, to which application code will never have write access.
See the Saving Files section of the developer docs to learn about valid places to store a file, and which do and do not require additional attainable permissions.

Chris Stratton
- 39,853
- 6
- 84
- 117