简体   繁体   English

多部手机/设备之间的通信

[英]communication between multiple phones/devices

I would like to create an application where near phones/devices can send data between each other. 我想创建一个应用程序,使附近的手机/设备之间可以相互发送数据。

it should look like that all devices except one turn on some listening function. 看起来除了打开一台监听功能外,所有设备都应打开。 One device create game and add each of devices from list to game. 一个设备创建游戏并将每个设备从列表添加到游戏。

I know how to accomplish this task with use of intermediary server. 我知道如何使用中介服务器来完成此任务。 But I would like to achieve this in a different way without server. 但是我想在没有服务器的情况下以其他方式实现这一目标。 For example I can create app which find near ibeacons and displays them in a list, and get data from them. 例如,我可以创建一个在ibeacon附近找到并显示在列表中并从中获取数据的应用程序。 Is it possible to make to way communication by bluetooth between phones with bluetooth? 使用蓝牙的手机之间是否可以通过蓝牙进行通讯?

Maybe other technologies? 也许其他技术? I do not want to use NFC, because range is to short. 我不想使用NFC,因为范围太短了。 Another limitation is that, this solution should be an cordova/phonegap plugin? 另一个限制是,此解决方案应该是cordova / phonegap插件吗?

Edit: I need to communicate between users devices. 编辑:我需要在用户设备之间进行通信。 For example I want to make app where two users standing near each other chat together. 例如,我要制作一个使两个彼此靠近的用户在一起聊天的应用程序。 Messages should be send between phones, without server. 消息应在没有服务器的情况下在电话之间发送。

It sounds like iBeacons is the perfect solution for what you're attempting to achieve. 听起来iBeacons是您要实现的理想解决方案。 It doesn't require NFC or a server–only devices that have Bluetooth 4.0 LE (Low Energy). 它不需要具有蓝牙4.0 LE(低能耗)的NFC或仅服务器的设备。

If you're unhappy with iBeacons, I recommend the Multipeer Connectivity framework that also became available in iOS7: 如果您对iBeacons不满意,建议您在iOS7中使用Multipeer Connectivity框架:

https://developer.apple.com/library/ios/documentation/MultipeerConnectivity/Reference/MultipeerConnectivityFramework/ https://developer.apple.com/library/ios/documentation/MultipeerConnectivity/Reference/MultipeerConnectivityFramework/

Here's a good tutorial on AppCoda: 这是有关AppCoda的很好的教程:

http://www.appcoda.com/intro-multipeer-connectivity-framework-ios-programming/ http://www.appcoda.com/intro-multipeer-connectivity-framework-ios-programming/

Another benefit to using the Multipeer Connectivity framework as opposed to iBeacons, is that it doesn't require Bluetooth 4.0 LE, which isn't available on iPad 2 and iPhone 4 devices. 与iBeacons相比,使用Multipeer Connectivity框架的另一个好处是它不需要Bluetooth 4.0 LE,而iPad 2和iPhone 4设备则不支持。

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

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