Reputation: 183
I have question regarding on how to display the values into the Android Client from online database in MySQL using the PHP Web Service. The idea is such that initially when the activity is displayed, the first record must be displayed in the textview. There would be a button called Next which would display the next record and move the cursor to the next record in the database. My question is that the move to next record logic should be written in which place? That means should I write the move-to-next-record code in the Android client or should I write in the PHP code?
For the basic understanding of how to connect to an online db in Android Client I had referred to the question in this forum itself: Connect to Remote DB which gave me a good understanding on how to connect to remote db. But here my idea is kind of different which is event based and has to move to the next record and display in the textview. Any hints and suggesstions? Very grateful if you help me! Thank you.
Upvotes: 1
Views: 796
Reputation: 15079
It is really bad idea to connect directly to database. AFAIK, you can create a PHP/MySQL Service to return data in such a format that clients can parse, like popular JSON.
Have a look at this: http://blog.sptechnolab.com/2011/02/10/android/android-connecting-to-mysql-using-php/
Hope it helps!
Upvotes: 1