我可以访问采用Android HCE从运行Android 4.3(或更低)的设备的设备? [英] Can I access a device using Android HCE from a device running Android 4.3 (or below)?

查看:185
本文介绍了我可以访问采用Android HCE从运行Android 4.3(或更低)的设备的设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发了一个应用程序,采用了Android HCE和应用程序访问(读取)这个模拟卡模拟一个接触式智能卡。双方在Android 4.4(奇巧)及以上运行。

I have developed an app that emulates a contactless smartcard using Android HCE and an app that accesses (reads) this emulated card. Both run on Android 4.4 (KitKat) and above.

没有我想开发的阅读器端为运行Android 4.3(或更低)的设备。是否有可能访问使用Android的HCE从与API级别℃的设备的设备; 19?我不希望使用Android的光束特性。

No I would like to develop the reader-side for devices that run Android 4.3 (or lower). Is it possible to access a device that uses Android HCE from a device with an API level < 19? I do not want to use the Android Beam feature.

推荐答案

没有,那是不可能的。默认情况下,两款Android设备(时一起举行)交流会在的对等模式的。是这种情况,即使一个或两个装置支持主机卡模拟。一旦Android设备成功建立一个对​​等模式的链接,它的不会尝试使用读/写器模式的对同一目标。

No, that's not possible. By default, two Android devices (when held together) will communicate in peer-to-peer mode. This is the case even if one or both devices support host card emulation. Once an Android device successfully established a peer-to-peer mode link, it won't try to use reader/writer mode on the same target.

为了允许Android的HCE-模拟卡是可见的(可从)第二Android设备,即第二装置必须停用它的对等模式的功能和操作仅在读/写器模式

In order to permit the Android HCE-emulated card to be visible to (accessible from) a second Android device, that second device must disable its peer-to-peer mode capabilities and operate only in reader/writer mode.

这正是你做的是Android阅读器模式的API(你似乎在你的阅读器应用程序来使用Android 4.4系统)是什么。使用 NfcAdapter.enableReaderMode()的标志 FLAG_READER_NFC_A FLAG_READER_NFC_B Android的力量采取行动在读/写模式,并的禁用的的对等模式。

This is exactly what you do with the Android reader mode API (that you seem to use in your reader app for Android 4.4). Using NfcAdapter.enableReaderMode() with the flags FLAG_READER_NFC_A and FLAG_READER_NFC_B forces Android to act in reader/writer mode and to disable peer-to-peer mode.

由于这种API(或其它等值)不可用在Android 4.3及以下(即API级别19之前),你也没办法编程 1 禁用的对等模式。因此,在Android 4.3读者的应用程序不能与Android的HCE模拟卡进行通信。

As this API (or something equivalent) is not available on Android 4.3 and below (i.e. before API level 19), you have no means to programmatically1 disable peer-to-peer mode. Consequently, your reader app on Android 4.3 can't communicate with an Android HCE emulated card.


1 )请注意,禁用Android的光束中设置的不会或者禁用的对等模式。这将只禁用,将上的对等体模的顶部通常运行梁能力

1) Note that disabling Android Beam in Settings won't disable peer-to-peer mode either. This will just disable the Beam capabilities that would normally run on top of peer-to-peer-mode.

这篇关于我可以访问采用Android HCE从运行Android 4.3(或更低)的设备的设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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