Is peer-to-peer communication over 3G/4G possible for smart phones?
Asked Answered
E

3

7

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?

Eudy answered 13/4, 2011 at 12:12 Comment(0)
A
3

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.

Ayakoayala answered 13/4, 2011 at 13:18 Comment(3)
Can you justify the statement 'True P2P isn't possible over 3G.' with some evidence? I am inclined to think this statement incorrect.Thymelaeaceous
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.Ayakoayala
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.Thymelaeaceous
K
1

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

Kneel answered 13/4, 2011 at 12:14 Comment(8)
This is a server-based solution.Pontiff
@PaulSasik It is but you don't need to buy expensive hardware.Hog
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.Kneel
My mistake for being unclear, I would like to avoid any type of "middle man"Eudy
@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.Kneel
@Kneel 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.Eudy
It simply isn't possible with 3/4G. Like already pointed out you won't be able to use IP addresses due to NAT.Hog
Right, I commented without thinking.Eudy
C
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.

Convivial answered 11/4, 2017 at 21:16 Comment(1)
It would appear that @Eudy was looking to develop an app for the specific task therefore using a mail app would not suit.Ammieammine

© 2022 - 2024 — McMap. All rights reserved.