do you want to use php and mysql to support your android app, or php and mysql inside of your android app? the first one is totally doable, the 2nd one is not.
well they just redesigned it but php.net is a great site for learning how to do things in PHP. basically you have to design what you want to view/access/update in the MySQL database and layout that first. Then you need to expose php scripts that can perform that functionality, ( a simple way would be a file called "getcontact.php" which when given an ID, would return all the details about a given contact for example... )
Then you need to create Android code to make a HTTPRequest to call your page Example Domain for example.... and then process the return, JSON is a great simple format, and using Google Gson you can map from Json to Java Objects extremely easily. and php can output json as easily as calling " echo json_encode($array); "
[HIGH]
String json = "";// this is the content read in from the input stream.
JsonParser parser = new JsonParser();
JsonObject jsonObj = parser.parse(json).getAsJsonObject();
String username = jsonObj.get("username").getAsString();
//use username for whatever you want...
[/HIGH]
then use the jsonObj variable as a regular java object and do what you need to with the result.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.