Get IMEI

52 views
Skip to first unread message

rdvg...@gmail.com

unread,
Jul 21, 2021, 2:42:57 AM7/21/21
to CodenameOne Discussions
Hi,

How do I get the IMEI number?

I only need it on Android, I tried with "Display.getInstance().getMsisdn() ", but this does not work.

Thanks

Shai Almog

unread,
Jul 21, 2021, 10:10:11 PM7/21/21
to CodenameOne Discussions
Hi,
as far as I know Android also ended support for IMEI access without vendor permissions. This only worked on older devices.

rdvg...@gmail.com

unread,
Jul 22, 2021, 2:47:18 PM7/22/21
to CodenameOne Discussions
Hi,

I began to investigate your comment and found that as of version 10 of Android there are more severe restrictions on the information of the device.

that there is a way to access such information.

Is there a way to do this in codenameone?

It is also possible to know when the cell phone is turned off, the battery level or when the gps is turned off?

Thanks

Shai Almog

unread,
Jul 22, 2021, 11:43:33 PM7/22/21
to CodenameOne Discussions
Hi,
See: Caution: Third-party apps installed from the Google Play Store cannot declare privileged permissions.

All of those require deep permissions that Google blocks. Sure you can do all of that in Codename One. Some require native calls but that's trivial to do in Codename One using Native interfaces. But again, you won't be able to ship your app so it seems redundant.
Reply all
Reply to author
Forward
0 new messages