I am doing an application with android 2.2, i created a file config.properties in the assets folder, i am trying modify the properties with the following code:
AssetManager am = this.getResources().getAssets();
Properties pp = new Properties();
InputStream isConfig = am.open("config.properties",Context.MODE_PRIVATE);
pp.load(isConfig);
pp.setProperty("SHOP_URL", "NEW_SHOP_URL");//This key exists
try {
pp.store(new FileOutputStream("config.properties"), null);
} catch (FileNotFoundException e) {
e.printStackTrace();
}catch (IOException e) {
e.printStackTrace();
}
When run the application,throw this error:
java.io.FileNoFoundException: Read-only file system.
I am trying adding permissions to solve this error,but i dont know which add.
Thanks by help
The problem here is the file path. try using
this should fix the path problem.