智能手机可以通过 3G/4G 进行点对点通信吗?

发布于 2024-11-01 00:55:23 字数 218 浏览 7 评论 0原文

我正在尝试编写一个应用程序,将数据从一个 Android 设备传输到另一个 Android 设备 - 但这些设备很可能位于城市、州或国家的不同部分。 (直接的方法是拥有一台中央服务器(或任何类型的服务器),但我试图避免使用中央服务器)。

我试图传递的数据是文本、图片或两者的组合。

到目前为止,我找到的解决方案是使用特殊格式的文本或图片消息进行通信;但这似乎远非最佳。还有更好的解决方案吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

盗心人 2024-11-08 00:55:23

真正的 P2P 在 3G 上是不可能的。

在您的问题中,您提到您当前使用消息。我假设你指的是短信。

您可以做的是使用具有自定义 MIME 类型的邮件和附件,例如 application/foobar-data

在您的应用程序中,人们可以启动包含此附件的 SEND 意图。然后,用户必须选择他的电子邮件程序(或者这可能是自动的),并将其发送给他/她喜欢的任何人。您还可以指定收件人:地址以及您的意图的主题。这会相当简单。

然后,远程用户将收到该邮件并点击附件。您的应用程序将使用清单中的意图过滤器注册为处理 application/foobar-data mimetype,然后自动启动并接收数据。之前生成的邮件正文还可以预先填充有关您的应用程序以及如何安装它的信息,例如“您需要 FooBar 来查看附件。您可以从...安装它”。

因此,最终,您的应用程序可以发送和接收自定义数据,而无需依赖专用服务器。

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.

浅暮の光 2024-11-08 00:55:23

使用 Amazon Simple Queue Service

亚马逊简单队列服务(亚马逊
SQS)提供可靠、高度
可扩展的托管队列用于存储
消息在之间传播时
电脑。通过使用 Amazon SQS,
开发人员可以简单地移动数据
的分布式组件之间
他们的应用程序执行
不同的任务,不丢失
消息或需要每个组件
始终可用

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

宁愿没拥抱 2024-11-08 00:55:23

看看 ShazzleMail。您可以下载他们的应用程序并通过智能手机进行点对点通信。寻址是通过中间人完成的,但所有内容都是 p2p 的。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文