How does android application get data from network?
I'm in ur开发者_开发技巧gent need of help with a project.
I need to develop an android client, and I don't know how to get data from a database through the internet.
Could I use a socket or maybe send a http request?
Can I query the database on the client directly?Do you mean a raw MySQL database? If you want to connect over a raw socket you would need a MySQL client on the android, I suggest looking up libraries in whatever language you are using.
Depending on what you're doing, an alternative is creating a web server that will query the database and format some results for you. You could fetch this over http and display it directly. Or you could have the server encode it into json and manipulate that on the android device.
精彩评论