What is the best approach in this case I´m trying to develop an Android App:
1st activity will be an EditText to get "State" typed by user and will send this data to the second activity;
2nd activity will get this 1st activity´s input data at the top and will have another EditText to get "City" typed by user. This City will correspond to the State above in the activity;
3rd activity is supposed to show the restaurants corresponding to the City specified before in a ListView;
I have a database (mysql/php) where I intend to do the search relating:
State->City->restaurants.
Should I do Json encode? If so, can I relate input data in the 3th activity to match the results? Or I should communicate with php/mysql since the first input data in the 1st and 2nd activity?
Should I do mysql commands in the 3rd activity to get input data to match the results?
From what I understand you have your database exposed throught some web service (or webserver). As long as you don't describe how you use that service it's kind of difficult to tell you what to do. So, should you do json encode? It depends on what the service expects.. But json or xml are probably good. Should you do mysql commands in the 3rd activity?. It's all up to you. What do you want to happen when you have retreived the restaurants. Are you going back to activity1 or are you staying in activity3 or starting a new activity4??