org.json.JSONException: End of input at character code example
Example: org.json.jsonexception: end of input at character 0 of
Change
JSONObject jsonObject = new JSONObject(result);
to
result=getJSONUrl(url); //<< get json string from server
JSONObject jsonObject = new JSONObject(result);