I'd like to know the most simple way to detect if a key/field exists in a JSON String.
for example:
if(jsonObject(myJsonString).hasKey("myKey")){
}
I would not prefer to write a lot. I am currently using minimal JSON and it appears it does not have such a function.
Answer: JSONObject jsonObj2 = new JSONObject(message); if(jsonObj2.has("key"));