How can I retrieve data from MySQL database and store it in an ArrayList?
I have already used php scripts to connect to database and get all the data that I want. The data is sent to the webserver in Json format.
Let's say:
1) I have a table in my database based called users.
2) I have a class in Android Studio also called users that provides all the necessary fields for users. (such as id, name, surname, etc.)
3) I want to create an ArrayList (usersList< users>) that contains all the users from the database.
How can I do that?
-
You can retrieve MySQL data to Android array list via a web service by adding the proxy to android references.M_K– M_K2017-12-28 14:05:49 +00:00Commented Dec 28, 2017 at 14:05
-
Quite long way aheadDaksh Agrawal– Daksh Agrawal2017-12-28 14:09:41 +00:00Commented Dec 28, 2017 at 14:09
-
So you have a JSON file with the data?Daksh Agrawal– Daksh Agrawal2017-12-28 14:35:07 +00:00Commented Dec 28, 2017 at 14:35
-
I actualy have a php file that gets data from the database and sends it at webserver in JSON formatSonap Tseazmi– Sonap Tseazmi2017-12-28 15:00:05 +00:00Commented Dec 28, 2017 at 15:00
Add a comment
|