user3662124 user3662124 - 1 year ago 213
JSON Question

How to implement search on a mysql database using Android App?

Basically, I am developing an online library management system. I have successfully displayed the whole database as a listView using PHP, JSON and Async Task. Now I need to search that listView and and display the selected item's detail in a new Activity.

Answer Source

You can try creating your new activity with a WebView that opens your PHP url with a query string dictating your search. This would be a start.

public void onCreate(Bundle savedInstanceState) {

    Intent intent = getIntent();
    String stringPassed = intent.getExtras().getString("searchParam");

    webView = (WebView) findViewById(;


Your listView will have to pass strings to your webView activity in order to dynamically generate your query string, which is subsequently used to generate your search parameters.