2
votes

I have implemented android native code in codename of reading sim serial number using telephonyManager.getSimSerialNumber().Its working on android version 6.0 and above but on below version its not working .Getting runtime exception in below version.When we developed app using android studio and implemeted this functinality then its worked on all OS of android but when I implemented same android code in native using codename one then getting above issues .Its not working on all OS. Can you please help me to solved this issues?

1
What's the exception error in the devices that are failing? Connect a cable and check - Shai Almog

1 Answers

1
votes

There's a library written by Fabricio Cabeca a while ago for that. Search the Codename Extensions Library for Telephony (Right-click project -> Codename One -> CodenameOne Settings -> Extensions). Use this cn1LIb.

If there's still an issue with Android below 6.0, add android.xpermissions=<uses-permission android:name="android.permission.READ_PHONE_STATE"/> to your build hint.

Also, make sure you're not testing on Dual sim device, as this could problematic.