frewper
frewper

Reputation: 1433

Send data from android to webserver

What can i use to send/receive data between an android client and a webserver. Data can typically include: Text, Images or videos. As far as i have looked into, i cannot use JSON, since i cant sent images using this.

Upvotes: 0

Views: 11281

Answers (3)

mayur rahatekar
mayur rahatekar

Reputation: 4460

For that you have to use XML/JSON . If you want to send the Images on to the Server convert Image(Blob) to the String and Send that String to the Server and On server Side Convert String to the Blob and Store inside the database.

For that you can take reference from the following link :

http://blog.sptechnolab.com/2011/02/10/android/android-connecting-to-mysql-using-php/

http://www.vogella.de/articles/AndroidJSON/article.html

Upvotes: 2

Harry Joy
Harry Joy

Reputation: 59650

For only text data you can use XML or JSON and for images/videos and other attachments, with or without text, you have to use POST method of server.

Helping links:

  1. Sending and Parsing JSON Objects
  2. Working with XML on Android
  3. Executing a HTTP POST Request with HttpClient in Android

Upvotes: 2

Sumant
Sumant

Reputation: 964

For Receiving the data from server you can use xml/JSON. But to send the data you will have to use get or post method of http. for Sending text only GET is enough but for sending images & video its better to go with POST Methods with base64 encryption.

Upvotes: 0

Related Questions