ICS中的Android NFC功能 [英] Android NFC function in ICS

查看:136
本文介绍了ICS中的Android NFC功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android ICS中,有3种通过P2P共享数据的方式. 1. enableForegroundNdefPush(存在于姜饼中) 2. setdefPushMessage 3. setNdefPushMessageCallback

In Android ICS, there are 3 ways to share data by P2P. 1. enableForegroundNdefPush(existed from gingerbread) 2. setdefPushMessage 3. setNdefPushMessageCallback

如我所试,在Android ICS中,如果启用了轻按共享"设置,则调用enableForegroundNdefPush弹出轻按共享" UI可以传输数据. 是否有任何方法可以通过P2P共享数据而无需弹出点击共享" UI,即使启用了点击共享"设置(如enableForegroundNdefPush在Android姜饼中所做的一样).

As I tried, in Android ICS, calling enableForegroundNdefPush pop "Tap to share" UI to beam the data if "Tap to share" setting is on. Is there any way to share data by P2P without popping "Tap to share" UI even if "Tap to share" setting is on as enableForegroundNdefPush did in Android gingerbread.

此外,setLocalNdefMessage已从ICS中删除, 还有其他我可以用来替代它的API吗?

Moreover, setLocalNdefMessage is removed from ICS, is there other API I could use to replace it?

感谢您的帮助.

推荐答案

不,目前没有共享P2P数据时禁用UI的API.

No, at this moment there is no API to disable the UI when sharing P2P data.

setLocalNdefMessage()不再存在,因为默认情况下几乎所有应用程序现在都将通过NFC共享某些内容-如果应用程序本身不共享任何内容,则框架将自动共享指向该应用程序的链接.

setLocalNdefMessage() no longer exists, because almost every application will now share something over NFC by default - if the app itself doesn't share anything, the framework will automatically share a link to the app.

这篇关于ICS中的Android NFC功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆