6

I'm trying to write an app that transfers data from one android device to another - but the devices are most likely located in different parts of the city, state, or country. (The straight forward way would be to have a central server (or any type of server), but i'm trying to avoid using one).

The data I'm trying to pass is text, pictures, or a combination of both.

The solution I've found so far is to communicate with specially formatted text or picture messages; but that seems far from optimal. Any better solutions?

Jeff
  • 670
  • 1
  • 11
  • 28
pseudosudo
  • 1,932
  • 1
  • 19
  • 28

3 Answers3

2

Use Amazon Simple Queue Service:

Amazon Simple Queue Service (Amazon SQS) offers a reliable, highly scalable, hosted queue for storing messages as they travel between computers. By using Amazon SQS, developers can simply move data between distributed components of their applications that perform different tasks, without losing messages or requiring each component to be always available

Octavian A. Damiean
  • 38,480
  • 19
  • 92
  • 99
gby
  • 14,093
  • 38
  • 57
  • This is a server-based solution. – Paul Sasik Apr 13 '11 at 12:21
  • @PaulSasik It is but you don't need to buy expensive hardware. – Octavian A. Damiean Apr 13 '11 at 12:21
  • 1
    What the asker said is: "The straight forward way would be to have a *central* server, but i'm trying to avoid using one". So yes, Amazon SQS is a distributed server solution, not a central server one and one he doesn't need to build and maintain to boot. I agree the difference is subtle, but it is important and think it is dealing with the underlying problem very well, even if not exactly what the asker had in mind. – gby Apr 13 '11 at 12:24
  • My mistake for being unclear, I would like to avoid any type of "middle man" – pseudosudo Apr 13 '11 at 12:37
  • @pseduosudo I understand, you do realize however that SMS / MMS message you send use a middle man as well - the Telco providing connectivity, right? :-) You are always using a middle man - what you probably want is a reliable one and perhaps one that is not limited to Internet connected devices. Maybe you want something like Qualcomm Alljoyn? not sure it's suitable for you since it's proximity based. Doesn't sound like what you had in mind. – gby Apr 13 '11 at 12:47
  • @gby I'm looking for something more p2p that only uses the phone's Telco (so by my understanding internet over 3/4g would be ok). This way range is not limited to Wifi or bluetooth. – pseudosudo Apr 13 '11 at 13:00
  • It simply isn't possible with 3/4G. Like already pointed out you won't be able to use IP addresses due to NAT. – Octavian A. Damiean Apr 13 '11 at 13:03
  • Right, I commented without thinking. – pseudosudo Apr 13 '11 at 13:10
2

True P2P isn't possible over 3G.

In your question, you mention that you currently use messages. I assume that you mean SMS.

What you could do instead is using mails and attachments with a custom mime type, say application/foobar-data.

Within your app one could launch a SEND intent containing this attachment. The user would then have to choose his email program (or this could maybe be automatic), and send it to whoever he/she likes. You may also specify the To: address, and the subject in your intent. This would be rather straightforward.

The remote user would then receive this mail and tap on the attachment. Your app would be registered to handle the application/foobar-data mimetype, using an intent filter in the manifest, and would then automatically launch and receive the data. The body of the mail generated earlier could also be pre-filled with informations about your app and how to install it, such as "You need FooBar to view the attachment. You can install it from...".

And so, in the end, your app could both send custom data and receive it, without relying on a dedicated server.

olivierg
  • 10,054
  • 4
  • 25
  • 33
  • 2
    Can you justify the statement 'True P2P isn't possible over 3G.' with some evidence? I am inclined to think this statement incorrect. – Tom Jun 10 '11 at 00:39
  • 1
    I'm not an expert about 3G, but it seems like, depending on the carrier, 1. the IP isn't guaranteed to be public and 2. incoming connections are pretty much filtered if not completely blocked. In this context, a peer cannot establish a connection with another peer reliably. It may work in some rare case but who knows. The connection would need to be mediated by a server. This isn't true P2P. – olivierg Jun 10 '11 at 09:36
  • Thankyou for your explanation. Based on your statement 'It may work in some rare case but who knows.', I have edited your answer to reflect the subjective nature of your claim. – Tom Jun 10 '11 at 12:51
0

Look at ShazzleMail. You can download their app and communicate p2p over a smartphone. Addressing is done through a middleman, but all content goes p2p.

Cliff
  • 1
  • It would appear that @pseudosudo was looking to develop an app for the specific task therefore using a mail app would not suit. – Peter Apr 11 '17 at 21:35