怎样“撞”?技术工作?

发布于 2024-09-12 21:37:35 字数 31 浏览 4 评论 0原文

有关于进行设备到设备数据传输的好的文档或文章吗?

Any good documentation or articles out there about doing device-to-device data transfer?

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

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

发布评论

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

评论(3

来世叙缘 2024-09-19 21:37:35

非常非技术性,但他们的常见问题解答提供了一些有关该技术的信息:

问:凹凸如何工作?

答:Bump 有两个部分:在您的设备上运行的应用程序和在我们的云服务器上运行的智能匹配算法。手机上的应用程序使用手机的传感器来“感觉”碰撞,并将该信息发送到云端。匹配算法会监听世界各地手机的碰撞情况,并将感受到相同碰撞的手机配对。然后我们只需在每对中的两部手机之间路由信息。

问:不可能。如果其他人同时碰撞怎么办?

答:方式。我们使用各种技术来限制潜在匹配的池,包括位置信息和碰撞事件的特征。如果您在特别密集的区域(例如,在会议上)碰撞,并且我们无法在单次碰撞后解决唯一匹配,我们只会要求您再次碰撞。我们的首席技术官拥有量子力学博士学位,可以展示其背后的数学原理,但我们建议下载 Bump 并亲自尝试!

问:为什么 Bump 要使用我的位置?

答:我们现在在全球拥有数百万用户。我们使用位置信息作为限制必须检查以确定正确匹配的其他手机数量的方法之一。基本上,如果您在芝加哥,我们会使用该信息,这样我们就不必将您的颠簸与来自日本、欧洲、纽约等地的颠簸进行比较。因此,我们要求打开定位服务,并且用户授权使用其位置信息。如果您不授权使用位置信息,Bump 将无法工作,抱歉。

问:Bump 是否还需要激活我的蓝牙?

答:不! Bump 根本不使用蓝牙来工作;您所需要的只是通过 wifi、3G 或 Edge 连接互联网。

Pretty non-technical, but their FAQ gives some information on the technology:

Q: How does Bump work?

A: There are two parts to Bump: the app running on your device and a smart matching algorithm running on our servers in the cloud. The app on your phone uses the phone's sensors to literally "feel" the bump, and it sends that info up to the cloud. The matching algorithm listens to the bumps from phones around the world and pairs up phones that felt the same bump. Then we just route information between the two phones in each pair.

Q: No way. What if somebody else bumps at the same time?

A: Way. We use various techniques to limit the pool of potential matches, including location information and characteristics of the bump event. If you are bumping in a particularly dense area (ex, at a conference), and we cannot resolve a unique match after a single bump, we'll just ask you to bump again. Our CTO has a PhD in Quantum Mechanics and can show the math behind that, but we suggest downloading Bump and trying it yourself!

Q: Why does Bump want to use my location?

A: We've got millions of users worldwide now. We use location information as one of the ways we limit the number of other phones we have to check to determine the correct match. Basically, if you are in Chicago, we use that info so we don't have to compare your bump with bumps coming in from Japan, Europe, New York, etc. For this reason, we require that location services be turned on and that users authorize the use of their location information. If you do not authorize use of location information, Bump won't work, sorry.

Q: Does Bump require that my Bluetooth is activated also?

A: Nope! Bump doesn't use Bluetooth to work at all; all you need is an Internet connection through wifi, 3G or Edge.

奢欲 2024-09-19 21:37:35

您可能对凹凸的功能感到困惑。我的理解是,加速度计和地理位置数据用于识别候选“碰撞”或设备对。联系人数据本身是通过互联网传输的,而不是通过蓝牙或 WiFi 在本地传输。

You may be confusing how Bump functions. My understanding is that accelerometer and geolocation data is used to identify candidate "bumps," or device pairs. The contact data, itself, is transferred over the Internet, not locally via Bluetooth or wifi.

_失温 2024-09-19 21:37:35

来自 https://github.com/bumptech/bump-api-ios 的完整示例

- (void) configureBump {
// userID is a string that you could use as the user's name, or an ID that is semantic within your environment
[BumpClient configureWithAPIKey:@"your_api_key" andUserID:[[UIDevice currentDevice] name]];

[[BumpClient sharedClient] setMatchBlock:^(BumpChannelID channel) { 
    NSLog(@"Matched with user: %@", [[BumpClient sharedClient] userIDForChannel:channel]); 
    [[BumpClient sharedClient] confirmMatch:YES onChannel:channel];
}];

[[BumpClient sharedClient] setChannelConfirmedBlock:^(BumpChannelID channel) {
    NSLog(@"Channel with %@ confirmed.", [[BumpClient sharedClient] userIDForChannel:channel]);
    [[BumpClient sharedClient] sendData:[[NSString stringWithFormat:@"Hello, world!"] dataUsingEncoding:NSUTF8StringEncoding]
                              toChannel:channel];
}];

[[BumpClient sharedClient] setDataReceivedBlock:^(BumpChannelID channel, NSData *data) {
    NSLog(@"Data received from %@: %@", 
    [[BumpClient sharedClient] userIDForChannel:channel], 
    [NSString stringWithCString:[data bytes] encoding:NSUTF8StringEncoding]);
}];


// optional callback
[[BumpClient sharedClient] setConnectionStateChangedBlock:^(BOOL connected) {
    if (connected) {
        NSLog(@"Bump connected...");
    } else {
        NSLog(@"Bump disconnected...");
    }
}];

// optional callback
[[BumpClient sharedClient] setBumpEventBlock:^(bump_event event) {
    switch(event) {
        case BUMP_EVENT_BUMP:
            NSLog(@"Bump detected.");
            break;
        case BUMP_EVENT_NO_MATCH:
            NSLog(@"No match.");
            break;
    }
}];

}

Complete Example from https://github.com/bumptech/bump-api-ios

- (void) configureBump {
// userID is a string that you could use as the user's name, or an ID that is semantic within your environment
[BumpClient configureWithAPIKey:@"your_api_key" andUserID:[[UIDevice currentDevice] name]];

[[BumpClient sharedClient] setMatchBlock:^(BumpChannelID channel) { 
    NSLog(@"Matched with user: %@", [[BumpClient sharedClient] userIDForChannel:channel]); 
    [[BumpClient sharedClient] confirmMatch:YES onChannel:channel];
}];

[[BumpClient sharedClient] setChannelConfirmedBlock:^(BumpChannelID channel) {
    NSLog(@"Channel with %@ confirmed.", [[BumpClient sharedClient] userIDForChannel:channel]);
    [[BumpClient sharedClient] sendData:[[NSString stringWithFormat:@"Hello, world!"] dataUsingEncoding:NSUTF8StringEncoding]
                              toChannel:channel];
}];

[[BumpClient sharedClient] setDataReceivedBlock:^(BumpChannelID channel, NSData *data) {
    NSLog(@"Data received from %@: %@", 
    [[BumpClient sharedClient] userIDForChannel:channel], 
    [NSString stringWithCString:[data bytes] encoding:NSUTF8StringEncoding]);
}];


// optional callback
[[BumpClient sharedClient] setConnectionStateChangedBlock:^(BOOL connected) {
    if (connected) {
        NSLog(@"Bump connected...");
    } else {
        NSLog(@"Bump disconnected...");
    }
}];

// optional callback
[[BumpClient sharedClient] setBumpEventBlock:^(bump_event event) {
    switch(event) {
        case BUMP_EVENT_BUMP:
            NSLog(@"Bump detected.");
            break;
        case BUMP_EVENT_NO_MATCH:
            NSLog(@"No match.");
            break;
    }
}];

}

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