简体   繁体   English

不同网络上的两个Android设备之间的数据传输

[英]Data transfer between two android devices which are on different networks

I am working on one project in which two android devices which are in different network need to transfer some data. 我正在一个项目中,其中两个位于不同网络中的android设备需要传输一些数据。 Both device will have internet connection. 两台设备都可以连接互联网。 It will be either Wifi or GSM provider. 它将是Wifi或GSM提供商。
Consider the following cases: 考虑以下情况:

  1. If one Android device has GSM network and 如果一台Android设备具有GSM网络,并且
    another device in some other place which has Wifi network 在其他地方有Wifi网络的另一台设备
  2. If one Android device has GSM network and another device has GSM network 如果一个Android设备具有GSM网络,而另一设备具有GSM网络

How to transfer data in such cases? 在这种情况下如何传输数据?

I don't want to use server in between. 我不想在两者之间使用服务器。

Please let me know how do I solve this issue. 请让我知道如何解决此问题。 Any clue or any links which will help me. 任何有帮助的线索或链接。 So far I didn't find any such things. 到目前为止,我还没有发现任何此类东西。 Please help me... 请帮我...

Short Answer: You're going to have to use a server. 简短的答案:您将不得不使用服务器。

Long Answer: You could use bluetooth if the location is close enough or maybe Wifi Direct although I haven't personally used the latter. 长答案:如果位置足够近,您可以使用蓝牙,或者虽然我个人并没有使用Wifi Direct,但也可以使用Wifi Direct。 Although, ultimately a server will be the best option. 虽然,最终服务器将是最佳选择。 If you don't know a lot about backend development I could recommend parse.com as a good service that makes creating backends very easy and has fairly high usage limits before you have to pay. 如果您对后端开发不了解很多,我可以推荐parse.com作为一项优质服务,它使创建后端非常容易,并且使用限制相当高,您无需付费。

Unless a device has been configured with an external IP address, which is very unlikely (impossible?) on a cellular network, there won't be a way to directly contact it from an external device. 除非为设备配置了外部IP地址(在蜂窝网络上不太可能(不可能?)),否则就没有办法直接与外部设备联系。 Even on WiFi, most devices will never have an externally defined address. 即使在WiFi上,大多数设备也永远不会拥有外部定义的地址。

If you had administrative control over a directly connected and externally addressed router, you could port-forward traffic to a single device, but that's likely not the solution you're after. 如果您对直接连接的外部寻址路由器具有管理控制权,则可以将流量移植到单个设备,但这可能不是您想要的解决方案。

A much easier approach is to use one of the services that let you define a back-end w/oa lot of setup or costs. 一种更简单的方法是使用一种服务,该服务可让您定义没有很多设置或成本的后端。 The most popular one is probably Parse . 最受欢迎的可能是Parse

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM