Android MySQL Database 04 : ListView - ServerSide Search/Filter [HttpURLConnection]

preview_player
Показать описание


I have quite so many tutorials about filtering or searching against a dataset.And they are doing quite well.But then we have been dealing with client side filtering which is relatively simple cause we have Filter class and getFilter() method to help us as long as we implement Filterable Interface.
But then in the real world data is nver stored in an arraylist but in a database.And Server side filtering is way more faster than client side,at least in many cases.
So today we exlpore how to filter MySQL data in th server.This is quite a comprehensive tutorial cause we cover POST Request.We send and receive data.Do our thing in the background thread,parse JSON etc.

Join me we learn.
Cheers.

RELATED TUTORIALS

RELATED KEYWORDS:
android mysql,filter,search,httpurlconnection,POST Request,server side,listview,InputStream,outputstream,bufferedreader,bufferedwriter,website,network,android internet,json parse,jsonobject,json array,stringbuffer,response,GET Request,webservice,RESTFUL service,programmingwizards,programing wizards
Рекомендации по теме
Комментарии
Автор

you are great buy your recording is too bad ....

shalawmshir
Автор

do you have any tutorial using volley, searchview with volley instead of HttpURLConnection?? thanks

portuguesetraveller
Автор

Hi! I have a problem with the search filter.. When I write the name, the list is not filtered.. How I can fix it?

marcomilani
Автор

Works just fine, but what's the reason exactly for "unable to parse"? When I try some keywords it gives me unable to parse.

algerianpsycho
Автор

Master, when i run localhost/searcher.php, i receive this error. -> Notice: Undefined index: Query in C:\xampp\htdocs\searcher.php on line 14. Can teach me how to fix it? I followed all the code correctly.

tejingshan
Автор

Sir, Can we call this as "searching of keywords over database??

MoneyMindedJayu
Автор

can you explain how or wher to save the PHP file?

guykoren
Автор

I have a problem.. I have a database with numbers of cars.. Like B 14 ASD and if I write B nothing happens.. What should I do ?

kryno
Автор

do you have source code for this one sir?

firdaussyah
Автор

Hi Programming Wizard i have followed the link but i haven't see Datapackager class

gaudiozrwechungura
Автор

Hi sir
this is the great video but some reason whenever I run the app the message shows unfortunately app is stopped. Please help.
The error message I got : FATAL EXCEPTION: AsyncTask #1

yoojiale
Автор

Hi - thanks alot for this tutorial
if i have other php that i working with ... can i working with your searcher.php and just to change the $db="soccerDB" -> to my php in the name of this: $db="products"
?
<?php

$response = array();


// include db connect class
require_once __DIR__ . '/db_connect.php';

// connecting to db
$db = new DB_CONNECT();

// get all products from products table
$result = mysql_query("SELECT *FROM products") or die(mysql_error());

// check for empty result
if (mysql_num_rows($result) > 0) {
// looping through all results
// products node
$response["products"] = array();

while ($row = mysql_fetch_array($result)) {
// temp user array
$product = array();
$product["pid"] = $row["pid"];
$product["name"] = $row["name"];
$product["description"] = $row["description"];
$product["protein"] = $row["protein"];
$product["carb"] = $row["carb"];
$product["fat"] = $row["fat"];
$product["calories"] = $row["calories"];
//$product["created_at"] = $row["created_at"];
//$product["updated_at"] = $row["updated_at"];



// push single product into final response array
array_push($response["products"], $product);
}
// success
$response["success"] = 1;

// echoing JSON response
echo json_encode($response);
} else {
// no products found
$response["success"] = 0;
$response["message"] = "No products found";

// echo no users JSON
echo json_encode($response);
}
?>

guykoren
Автор

thanks sir for the tutorial very very....helpful, now i want to add onItemClickListner to the listview and also my db has a field for image was wondering how i would go about solving that too. thanks

joshuamugisha
join shbcf.ru