Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send data from one android device to another?

Tags:

Hi all I was wondering what options do we have to exchange data between two different android devices?

For example, User-A and User-B both installs my app. I would like User-A to send data (possibly just a simple message or user-A's location info) to User-B.

The functionality I would need is similar to the functionality that WhatsApp has. However unlike WhatsApp, I do not have a server and I was wondering if we could do data exchange between two different android devices without a server?

I was thinking we build it atop SMS or something.

like image 647
Pacerier Avatar asked Jan 10 '12 01:01

Pacerier


People also ask

How can I transfer data from Android to Android wireless?

On both Samsung devices, open the switch app. On the sending device, tap “Send data” and on the receiving device, tap “Receive data”. Next, select either the Cable or wireless transfer option. Wireless will allow both devices to connect automatically and transfer wirelessly.

Can I transfer data from one phone to another phone?

How to Transfer Data from Android to Android. Transferring your data from one Android device to another is ridiculously simple as most of it is synced with your Google account. In most cases, your data will sync automatically if you sign into your Google account on your new device.


1 Answers

Options for exchanging information between devices are the following:

  • Bluetooth - this would be between two devices in the near vicinity
  • TCP/UDP IP connection - this would be using TCP to open a socket directly to another server socket. That could be hosted on the phone or a shared server. There are pros and cons to both.

The pros of bluetooth would be no need for a central server. The big downside is this means you can only exchange data between two people standing within 20 meter range. The other downside is you have to pair the devices which not everyone finds easiest.

You can use TCP/IP connections to exchange data just like any client-server program you write on a traditional computer. This could be used no matter if your phone is using 3G/4G/WIFI/EDGE or future radio protocols. The problem is the IP address of the phone might not be globally reachable. The IP address of the phone might be a non-routable like a private IP. They might be behind a firewall or NAT address.

This is where a central server is probably needed to either exchange IP addresses for users, or serve as a common location for clients behind infrastructure that could block. This is where protocols like SWIFT come in handy for jumping firewalls. Even with things like P2P you still run into these types of issues with non-accessible devices, and tricks like this have to be used to crawl around them. Unfortunately, that means you probably need a central server even with the P2P model.

like image 101
chubbsondubs Avatar answered Oct 23 '22 07:10

chubbsondubs