Eddie Dovzhik
Eddie Dovzhik

Reputation: 297

Simplest way to pass information between the same application installed on different phones

As the topic name suggests, what I am looking for is to add my android app the option to send data to a different phone running the same application so the receiving phone will process it accordingly.

The obvious option for me was to use app engine and use push notification with the phone number acting as the identifier.

Does a simpler solution exist?

Thanks ahead :)

Upvotes: 0

Views: 71

Answers (1)

Raghav Sood
Raghav Sood

Reputation: 82553

The best and most robust solution is to have something like your messaging clients, in which Device A sends data to the server, which pushes it to Device B. Device B sends a reply to the server, which pushes it to Device A.

This process has the advantage of retrying the sending without requiring your users to stay connected, as may be required if Device B is offline when A sends a message.

A less foolproof solution is to have a server work as a middle man, and get each device's IP Address, and then open up a direct socket between them. In this solution, you'll lose any data that doesn't make it through.

If the devices are on the same network or in Bluetooth range, you could try Bluetooth or WiFi direct.

Upvotes: 1

Related Questions