Android Beam 详细实现步骤

本文详细介绍了Android Beam的实现步骤,包括如何设置NDEF消息、启用Beam功能,以及 Beam工作所需的条件。文章重点解析了官方文档中关于Beam的使用指南,并分享了一段基于官方例子调试出的 Beam 实战代码,适用于API 10及更高版本的设备。需要注意,启用Beam会禁用标准intent调度系统,但配合前台调度仍能扫描匹配的标签。
摘要由CSDN通过智能技术生成

前言

       最近没怎么写东西了,主要是在了解Beam这个东东。找到一些高手写的文章,奈何水平有限看的云里雾里的。没办法,只好去复习官方文档。


正文: 

先摘取一部分官方文档:

Beaming NDEF Messages to Other Devices


Android Beam allows simple peer-to-peer data exchange between two Android-powered devices. The application that wants to beam data to another device must be in the foreground and the device receiving the data must not be locked. When the beaming device comes in close enough contact with a receiving device, the beaming device displays the "Touch to Beam" UI. The user can then choose whether or not to beam the message to the receiving device.

Note: Foreground NDEF pushing was available at API level 10, which provides similar functionality to Android Beam. These APIs have since been deprecated, but are available to support older devices. SeeenableForegroundNdefPush() for more information.

You can enable Android Beam for your application by calling one of the two methods:

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值