I have json file:"document.json" in assets folder
document.json:
{
"string": "Hello World"
}
Can i do this to get the string in android from a json file?
JSONObject jresponse = new JSONObject(R.assets.document);
string response = jresponse.getString("string");
Am i doing something wrong or is it correct?
Is there any method where we pass .json file and get the required string?