Android JSONObject : Search function Android JSONObject : Search function json json

Android JSONObject : Search function


You can use something like this:

String name;JSONObject searchObject;JSONArray array = new JSONArray(yourJsonString);for (int i = 0; i < array.length(); i++) {    JSONObject currObject = array.getJSONObject(i);    name = currObject.getString("name");    if(name == "hello")    {       searchObject = currObject            }}return searchObject


For big data you can't use search in every element imagin you have a 50K user you can't search in every 50k title to found your element I advise you to the backend - Web Developer - do this it will be easier to you and more faster how you can do this? You just need a space to pass search text in JSON Url then post it and retrieve searched data from him


Try to use a web server with (PHP) and set your search element in GET like this.

Then the php search function will give you the full Json needed to your search. Also you can set pagination for this search like this.