I am first time developing an android app. Very new to this. I have the application compiled and when I hit run on eclipse, I am expecting to see the log message but it never shows there
try {
JSONArray jArray = new JSONArray(result);
for(int i=0; i<jArray.length(); i++) {
// JSONObject json_data = jArray.getJSONObject(i);
JSONObject json_data = jArray.getJSONObject(i);
Log.i("log_tag","id: "+json_data.getInt("id")+
", name: "+json_data.getString("name")+
", sex: "+json_data.getInt("sex")+
", birthyear: "+json_data.getInt("birthyear"));
//Get an output to the screen
returnString += "\n\t" + jArray.getJSONObject(i);
}
using log.i.
Click DDMS and make sure the emulator you’re running is selected. And make sure you’re on the LogCat tab. you can also search for “app: com.your.app.package”
just to make sure your message isn’t messed up you might try doing something like Log.d(“tag”, “test”); Also i assume you’ve imported android.util.Log; since it compiles.
also maybe do something like
right before your for loop