Following steps
1. Create your own mysql database
2. Write your web service in PHP or .NET
Sample code
<?php
$host = '198.57.182.115';
$user = 'root';
$password = 'root';
$dbName = "db";
$link = mysql_connect($host, $user, $password);
mysql_select_db($dbName, $link);
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo "Connect successfully";
?>
3. Write your android code to call the web service to get the data
String responseBody = null;
HttpClient httpclient = HttpsClient
.getHttpsClient(new DefaultHttpClient());
HttpPost httppost = new HttpPost("Link to your web sevice");
try {
ResponseHandler<String> responseHandler = new BasicResponseHandler();
responseBody = httpclient.execute(httppost, responseHandler);
Log.d("responseBody: ", responseBody);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
return e.toString();
} catch (ClientProtocolException e) {
e.printStackTrace();
return e.toString();
} catch (JSONException e) {
e.printStackTrace();
return e.toString();
} catch (Exception e) {
e.printStackTrace();
return e.toString();
}
In above code, responseBody is the return data from webservice