开发者

App communication in nearby devices without user intervention

Is it possible to communicate two instances of an app:

  • In nearby devices (Android or iPhone)
  • 开发者_如何学Python
  • Without user intervention (aside from starting the app once)
  • Without internet (but not network) connection?

How?

  • Android to Android?
  • iPhone to iPhone?
  • Android to iPhone and vice-versa?


Let us ignore the issues associated with implementing the network communication at the application level and focus on the system design problem your question raises.

You want an application on one device to connect to another associated application on another device without any user intervention/interaction beyond launching the device. In order for this to work your system is going to need a 3rd party separate from the two devices/applications that provides a lookup service.

What will need to happen is each application will need to communicate with this service, ask for the data regarding other device it should connect to, if it exists, and then attempt that connection. This is basically how a bittorrent tracker works.

Keep in mind that there's quite a bit more involved in the implementation than that simple scenario suggests. For example, the proper registering/unregistering of devices, registration timeouts, security, etc.


Unless I misunderstand your question, you should be able to just use standard sockets (TCP or UDP depending on your needs) for communication between any/all devices. For iPhone, you could probably use the NSStream classes and for Android you'd use the Socket classes.


Can the new NFC feature be an answer to this?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜