I have a simple understanding of how this sample app should work. I have a MySQL DB a PHP script on my server and some code in my Android application. From the information I've gathered from StackOverflow and other sources, it seems like the best way to get data from my DB is to send my PHP script some parameters (from my app)of what data I want, and then relay that information back to the app.
As of right now, my android app is just using a httppost method to connect to a URI of the PHP page. It is simply reading the webpage of plaintext and spitting it back onto the screen. My question is, how do I go about sending some kind of formatted output back to my application so that I can sort it, and put different parts of the response into different parts of my app.
Example:
DB:
Menu ID| Dinner | Desert|
1 | Chicken| Jello |
2 | Steak | Fruit |
3 | Ham | Cake |
PHP: Take parameter (http://website.com/script.php?param=1) Look it up in DB and echo that row.
Android: Send httppost to URI Take the input and show it on the screen
So what is the best way that I could seperate the incoming data?
Example: This is from Menu: 1 You dinner will be: Chicken Your desert will be: Jello
Basically how can I "parse" the data? I feel like there should be a standard way (but I'm just not sure about it yet)