I have some files .json
in assets
.
I'mcurrentlyjustreadingthesefiles.
Reading
publicStringloadJSONFromAsset(StringAjson){Stringjson=null;try{InputStreamis=context.getAssets().open(Ajson);intsize=is.available();byte[]buffer=newbyte[size];is.read(buffer);is.close();json=newString(buffer,"UTF-8");
} catch (IOException ex) {
ex.printStackTrace();
return null;
}
return json;
}
How can I write to them? That is, replace all of your content with another of my choice.