3

I'm developing with the Open Mobile API but so far haven't found a list of devices that support the API by default (by default being using the OEM ROM).

I realise that since API level 21, Android telephony supports sending APDUs via basic and logical channels dirctly through the TelephonyManager. But I'd like to know about devices running pre-API level 21 too.

So, has a list already been compiled of devices with built-in support or is there a way to find out for myself?

Michael Roland
  • 39,663
  • 10
  • 99
  • 206
AReubens
  • 77
  • 1
  • 5

2 Answers2

5

I'm not aware of any complete list. However, there is a not so comprehensive one in our report Open Mobile API: Accessing the UICC on Android Devices and there is another one (though now unmaintained) in the SEEK-for-Android Wiki.

If you have access to each of the devices you are interested in, you could, of cource, check if the smartcard system service is available on them:

final String SMARTCARD_SERVICE_PACKAGE = "org.simalliance.openmobileapi.service";
try {
    PackageInfo pi = getPackageManager().getPackageInfo(SMARTCARD_SERVICE_PACKAGE, 0);
    // smartcard service present
} catch (PackageManager.NameNotFoundException ex) {
    // smartcard service NOT present
}

Or you could simply create an app that declares to require the Open Mobile API library by adding the following uses-library entry to its AndroidManifest.xml:

<uses-library android:name="org.simalliance.openmobileapi" android:required="true" />

If that app can be installed on a device, this indicates that the device contains the Open Mobile API library.

This may also be a way to obtain a more comprehensive list of supported devices: You could create such an app and publish it on Google Play. Google Play will filter based on <uses-library /> entries that have the required attribute set to true (android:required="true"); see also <uses-library> and Filters on Google Play. This means, that once you uploaded such an app to Google Play, you should be able to get a list of suuported devices that essentially matches all devices that have the Open Mobile API library available on them.

Michael Roland
  • 39,663
  • 10
  • 99
  • 206
  • Thanks very much, your report was one of the first sources I came across and has been a great help. I decided to create a Google Play Developer Console account (one-time $25 fee) and currently looks like building for API level 16 ~1/4 of devices are supported (3099/13128). – AReubens Aug 08 '16 at 09:00
  • @AReubens Note that I'm not sure how reliable the detection mechanism through Google Play is... – Michael Roland Aug 08 '16 at 10:54
3

While @Michael Roland response still stands, it's also worth noting that since Android 9 Pie, Open Mobile API is part of the Android.

So for API level 28 and higher, every phone has OMAPI by default and there is no need for explicit check.

michalbrz
  • 3,354
  • 1
  • 30
  • 41
  • 2
    Mind that, even if the OMAPI is present, a device can choose to not expose it's readers. Pixel 1 & 2 behave this way. Pixel 3 exposes its reader. – Patrick Nov 27 '18 at 16:58
  • And consequently there is no longer any `` or `` required. (Please confirm.) – TT-- Jul 16 '19 at 14:54