0

I have to Multicast Bitmap Image object within the same WiFi connected Android device. Anyone help me to do this in android. Any example code snippet are also very helpful:)

Note :I would like to send Bitmap image from one device to other devices which are all connected in the same WiFi network.

user779554
  • 185
  • 2
  • 13
  • 1
    It's hard to tell what you want to do. Do you want to pass a bitmap to several activities on the same device, e.g. through an intent, or transmit it to other devices that have your app installed, generally, or only if they are connected to the same WiFi network? What are you trying to do? – Pontus Gagge Dec 05 '11 at 08:09
  • I would like to send Bitmap image from one device to other devices which are all connected in the same WiFi network. – user779554 Dec 05 '11 at 08:58

1 Answers1

0

The most robust solution would probably be to setup a central application server and use Cloud to Device Messaging. Let devices register themselves with the application server when they tune into a WiFi network (use ConnectivityManager to register for notifications on network status changes, and get the SSID). Define http protocols to let the application server handle

  1. Devices connecting and disconnecting from a WiFi network
  2. An image being uploaded (probably identified by name unless there is ever only one image you want to broadcast)
  3. Downloading an image

If you want to transmit images directly over the WiFi network (and avoid net roundtrips), steps 2 and 3 would be redundant. You can probably use C2DM to let devices register their IP addresses directly, and use lower-level network protocols (android.net?) for transmission. Such a solution would get more complex in order to manage partial transmissions, devices being turned on and off and suddenly leaving the network: Android devices are not designed to be servers.

Community
  • 1
  • 1
Pontus Gagge
  • 17,166
  • 1
  • 38
  • 51