Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to implement database search in an app where search is the main focus?
    primarykey
    data
    text
    <p>I'm developing an app that calls a database via REST API from a main view and returns results in JSON format, to be parsed and displayed on a new view likely in ListView format. From the results list view, users can click on a specific result and see a "place view" with information specific to that place. The originally returned JSON objects that populated ListView will likely be used to populate the place page. I've been doing a lot of research about how best to implement this, and there doesn't seem to be any right answer or consensus. A few of my questions:</p> <ol> <li><p>Should the main search and results listview be one activity? If they are, it seems like I can use AsyncTask to make the search to the external database. Is that a good use of AsyncTask?</p></li> <li><p>If main search and results are separate activities, can I still use AsyncTask, or do I have to get more complex and use a Service to make that call? I've gotten the idea in my head that AsyncTask only can be used within an activity, and not to take a search term from one activity and return results to another. Can someone clarify that for me?</p></li> <li><p>Is there a single proper way to implement this type of very common search?</p></li> <li><p>Can anyone point me to sample code that illustrates a similar search and response being done? I have sample code and understanding of creating the actual REST methods, but I'd love to see some code that shows a search structure like mine (rest api, input and results in different views, etc) being implemented properly.</p></li> </ol> <p>Thanks for all your help.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload