I have successfully made contact with the internet and parsed a few documents via android and now I think my next big questions is how do I create the client that will convert my database into JSON files I can parse from my android app? Ive done some digging and I know it probably involves PHP, but I havent been able to find much specific info.
What I am looking for in a answer are any of the following:
- How difficult/complex is creating server end clients like this useually?
- Keywords I can research for example something like ” you’ll need a php server side client do hicky , look into [insert php topics I need to study here]
- LINKS LINKS LINKS!!!
You are on the right track. You essentially need a server side application stack that will connect to your mysql database, read out recordsets, and send back HTTP responses that include the JSON payload.
You can do this by simply writing a PHP method that returns the JSON formatted response (this would be fairly easy to get up and running). However if you are looking for a more robust/longterm solution I would invest the time in developing a RESTful web service. RESTful services provide a common interface to access data intensive applications.
As for how to do this, you can check out Phil Sturgeon’s blogpost here that describes how to setup a RESTful service in the popular PHP framework, CodeIgniter.
Also if you are not attached to PHP, I would recommend Ruby on Rails as it is designed out of the box to create RESTful web services. DHH, one of the creators of the Ruby on Rails framework, helped write the book on RESTful web services.