Can we download a payment app that uses HCE on phones lower than Android Kit-Kat 4.4.x?

I understand from the official android website https://developer.android.com/about/versions/kitkat.html which says that "Android 4.4 introduces a new platform to support NFC-based secure transactions via Host Card Emulation (HCE), for payments, ... "which we cannot use HCE on devices below Android Kit-Kat 4.4.x.

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

The project manifest file has android:minSdkVersion="14"

and android:targetSdkVersion="21"

, but the HCE SDK used by my project manifest has android:minSdkVersion="19"

and android:targetSdkVersion="21"

. Does my project really have an android:minSdkVersion

equal to 14 or 19?

0


source to share


2 answers


Can I download an app that uses the HCE functionality for a pre-KitKat device?

Yes, if your application is android:minSdkVersion

below 19 (Android 4.4) and if your application does not require the HCE function (i.e. if you do not specify

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

      

in the application manifest).

What if any of the libraries I'm using sets a higher one android:minSdkVersion

?

In this case, the creation of your application should fail. The merge manifest tools are expected to detect a mismatch between application android:minSdkVersion

attributes and your library attributes android:minSdkVersion

. However, you can override this by explicitly overriding library-specific SDK requirements like this:

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

      



By using this app, your app will be able to target a lower API version. However, if the library makes use of API calls that are not part of the device API version, these calls will result in errors / exceptions.

What if any of the libraries I am using sets an attribute android:required

for the HCE function?

In this case, all attributes are android:required

combined with a logical OR. Hence, if one manifest indicates that an HCE feature is required, your wholΓΆe application will require this attribute. Consequently, the app will not be available for pre-KitKat devices (for example, the Play Store will only display it for devices with the HCE function, which effectively limits the availability of devices with Android 4.4+).

Does it make sense to have an app that uses HCE for pre-KitKat devices?

It depends on the functionality of your application. HCE will not work on pre-KitKat devices. Hence, if HCE is the main component of your application, and the application would not be useful without it, then there is no point in using a pre-KitKat device application.

However, if the app can switch to other communication mechanisms for pre-KitKat devices (e.g., read-back mode, peer-to-peer mode, QR codes / barcodes) then it makes sense to have android:minSdkVersion

lower than 19 (and mark the HCE function as optional with android:required="false"

) to make your app available to pre-KitKat devices.

+1


source


I think host card emulation (HCE) requires driver / lower level framework changes. So if a device supports HCE below KitKat (4.4), it is probably something special that the device manufacturer has introduced, similar to once Marshmallow (6.0) has the Fingerprint Reader API but Samsung has an API to use it in the SDK for their devices.



TL; DR: Without the usual API provided by the Android platform, any such app would need to implement every vendor SDK for NFC HCE and then only work for devices that support each vendor SDK.

+2


source







All Articles