Android how to create a JSON file in SDCARD? -


i need on creating new json file sdcard, filenotfoundexception while trying load, , how read file if it's constructed.

how can manage create new json file in sdcard?

first, have add permission manifest

<uses-permission android:name="android.permission.write_external_storage" /> <uses-permission android:name="android.permission.read_external_storage"/> 

then, write code in java.

the path sdcard :

string dir = environment.getexternalstoragedirectory()+file.separator+"nameofyourfile.extension" 

to create json string, best way use class jsonobject , jsonarray.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -