我们可以下载使用在手机与HCE比Android洁吉4.4.x到下一个支付应用? [英] Can we download a payment application that uses HCE in phones with lower than Android Kit-Kat 4.4.x?

查看:360
本文介绍了我们可以下载使用在手机与HCE比Android洁吉4.4.x到下一个支付应用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从Android官方网站了解 https://developer.android.com/大约/版本/ kitkat.html 它说, Android 4.4系统的介绍了,通过主机卡仿真安全的基于NFC的交易(HCE),付款新平台的支持,... 的说我们不能比Android洁吉4.4.x到低的设备使用HCE。

I understand from the official android web site https://developer.android.com/about/versions/kitkat.html which says that "Android 4.4 introduces new platform support for secure NFC-based transactions through Host Card Emulation (HCE), for payments,..." that we can not use HCE in the devices lower than Android Kit-Kat 4.4.x.

但我要问,如果我们可以的下载的它使用/ Android应用程序包含HCE并且具有版本低于的 Android的洁吉4.4设备上的相关类。 X

But I want to ask if we can download an Android application which uses/contains HCE and its related classes on the device which has a version that lower than Android Kit-Kat 4.4.x?

我的项目清单文件具有安卓的minSdkVersion =14的android:targetSdkVersion =21,但通过我的项目的清单中使用的HCE SDK具有安卓的minSdkVersion =19的android:targetSdkVersion =21 。所以,我的项目实际上有安卓的minSdkVersion 设置为14或19

My project manifest file has android:minSdkVersion="14" and android:targetSdkVersion="21" but the HCE SDK used by my project's manifest has android:minSdkVersion="19" and android:targetSdkVersion="21". So does my project actually have android:minSdkVersion set to 14 or 19?

推荐答案

是的,如果你的应用程序指定一个安卓的minSdkVersion 低于19(Android 4.4系统),如果你的应用程序没有的需要的行政总监功能(也就是说,如果你不指定

Can I download an application that makes use of HCE functionality to a pre-KitKat device?

Yes, if your application specifies a android:minSdkVersion lower than 19 (Android 4.4) and if your application does not require the HCE feature (i.e. if you don't specify

<uses-feature android:name="android.hardware.nfc.hce" android:required="true" />

在应用程序清单)。

in the application manifest).

在这种情况下,builing您的应用程序应该失败。清单合并工具应该发现你的应用程序的机器人之间的不匹配:的minSdkVersion 和你的库依赖安卓的minSdkVersion 属性。但是,您可以用的东西压倒一切的明确特定的库的SDK要求这样的重写此:

In that case, builing your application should fail. The manifest merger tools is supposed to discover the mismatch between your application's android:minSdkVersion and your library dependencies' android:minSdkVersion attributes. However, you could override this by explicitly overriding the SDK requirements of specific libraries with something like this:

<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19"
          tools:overrideLibrary="package.name.of.the.library" />

在使用这个,你的应用程序将能够针对一个较低的API版本。但是,如果库利用不在的设备的API版本的一部分API调用,这些调用会导致错误/异常。

When using this, your application will be able to target a lower API version. However, if the library makes use of API calls that are not part of a device's API version, these calls will lead to errors/exceptions.

在这种情况下,所有的的android:需要属性相结合,与逻辑的的。因此,如果一个人的清单表示该HCE特征是必需的,你的wholöe应用将要求属性。因此,应用程序不会为pre-奇巧设备可用(例如Play商店将只列出它具有HCE功能,从而有效地限制可用性设备与Android 4.4 +设备)。

In that case, all android:required attributes are combined with logical OR. Hence, if one manifest indicates that the HCE feature is required, your wholöe application will require that attribute. Consequently, the application won't be available for pre-KitKat devices (e.g. Play Store will only list it for devices that have the HCE feature, which effectively limits availability to devices with Android 4.4+).

这取决于你的应用程序的功能。 HCE不会在pre-奇巧的设备。因此,如果HCE是您的应用程序的核心组件,应用程序将不会没有有用的话,那是没有意义的,以具有可用于pre-奇巧设备的应用程序。

That depends on the functionality of your app. HCE won't work on pre-KitKat devices. Hence, if HCE is the core component of your app and the app won't be useful without it, then it does not make sense to have the app available for pre-KitKat devices.

但是,如果应用程序可以切换为pre-奇巧设备之外的通信机制(如逆读卡方式,对等网络模式,QR codeS /酒吧codeS),那么它可能是有意义的有一个安卓的minSdkVersion 低于19(和标记HCE功能为可选的的android:要求=假),使可用于pre-奇巧设备您的应用程序。

However, if the app can switch to other communication mechanisms for pre-KitKat devices (e.g. inverse reader mode, peer-to-peer mode, QR codes/barcodes), then it could make sense to have a android:minSdkVersion lower than 19 (and to mark the HCE feature as optional with android:required="false") in order to make your app available for pre-KitKat devices.

这篇关于我们可以下载使用在手机与HCE比Android洁吉4.4.x到下一个支付应用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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