I have an application where i get a json and read out of it. To test my application a hava a file with the json in it. The problem is that I can´t just as in C# get it from my pc. So I created an assets folder and put my file in it. Now I have this code:
BufferedReader r = null;
AssetManager a = getAssets();
StringBuilder s = new StringBuilder();
try{
r = new BufferedReader(new InputStreamReader(a.open("My.json"), "UTF-8"));
String l;
while((l = r.readLine()) != null){
s.append(l);
}
JSONObject g = new JSONObject(s.toString());
everytime I run this and get to the while loop the debuger says that there is no frame available. I have breakpoints in the loop and after and they never get hit even when I wait for a long time. What am I doing wrong or is there an other better way to get the jsonObject from my text file?