So, I get some JSON values from the server but I don\'t know if there will be a particular field or not.
So like:
{ \"regatta_name\":\"ProbaRegatta\"
You can try this to check wether the key exists or not:
JSONObject object = new JSONObject(jsonfile); if (object.containskey("key")) { object.get("key"); //etc. etc. }