SilentKiller
SilentKiller

Reputation: 6942

how to send and receive image through socket

I want to send an image from one android device to one or multiple android devices. so which mechanism i should follow to send the image from one android device to another android device. I am new to android. so if possible then give me logic(way to complete the task). and if possible then give example of it..

Upvotes: 0

Views: 3675

Answers (1)

Anirudh
Anirudh

Reputation: 2524

Take a look at the WiFiDirectDemo sample in the SDK (API level 14+). It does exactly what you are looking for: http://developer.android.com/resources/samples/WiFiDirectDemo/index.html

WiFi direct is only available for devices running ICS. However, the socket server/client code is generic and reusable over Wifi network also:

Client: http://developer.android.com/resources/samples/WiFiDirectDemo/src/com/example/android/wifidirect/FileTransferService.html

Server: http://developer.android.com/resources/samples/WiFiDirectDemo/src/com/example/android/wifidirect/DeviceDetailFragment.html FileServerAsyncTask.

Upvotes: 4

Related Questions