前言
最近没怎么写东西了,主要是在了解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. See
enableForegroundNdefPush()
for more information.You can enable Android Beam for your application by calling one of the two methods:
setNdefPushMessage()
: Accepts an