Question

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?

Was it helpful?

Solution

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" />

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top