Varada
Varada

Reputation: 17034

http request in android

I would like to know if we can pass a database table as http response object to android application? I am using a serverside mysql database and I can pass a string to the client side right now. So I concatenated each column with a special character in server side and extracted it in client side to transfer a single row. But in case of table it is not possible, as the table may have huge amount of data. Do any one know how to fix this issue?

Upvotes: 1

Views: 324

Answers (2)

kgiannakakis
kgiannakakis

Reputation: 104158

What you want to do isn't possible. You need to design your system so that the whole table isn't needed in the Android application. Instead, you can send a message with the number of rows found and perhaps their ids. Then, you would make individual http requests to retrieve the contents of each row on a when needed basis.

Upvotes: 0

Pascal MARTIN
Pascal MARTIN

Reputation: 400902

Generally speaking, you will use some kind of serialization to exchange data between your Android application and your server.

The two most used serialization formats are XML and JSON -- I generally prefer JSON, but it's a matter of personal choice, I suppose.

You should be able to find JSON libraries in several languages, including the one you are using on your server, and JAVA (for the android-side).

Upvotes: 1

Related Questions