Get android device IMEI or SN

838 views
Skip to first unread message

Vadim Linnikov

unread,
Sep 10, 2013, 7:04:13 AM9/10/13
to kivy-...@googlegroups.com
Hello. Sorry for my bad english.

Is there possible to get android device IMEI or serial number in Kivy?
Or any info, which helps me to unique identificate the device?

Thanks.

Vadim Linnikov

unread,
Sep 10, 2013, 7:09:30 AM9/10/13
to kivy-...@googlegroups.com

Or any info, which helps me to unique identificate the device?

Bad-language-fix:  Or any info, which helps me to uniquely identify the device?

Ben Rousch

unread,
Sep 10, 2013, 7:28:27 AM9/10/13
to kivy-...@googlegroups.com
This Stackoverflow may help:
http://stackoverflow.com/questions/1972381/how-to-programmatically-get-the-devices-imei-esn-in-android

You would combine those suggestions with pyjnius to access the Android
API from Kivy. https://github.com/kivy/pyjnius
> --
> You received this message because you are subscribed to the Google Groups
> "Kivy users support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to kivy-users+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.



--
Ben Rousch
bro...@gmail.com
http://clusterbleep.net/

Vadim Linnikov

unread,
Sep 10, 2013, 7:34:56 AM9/10/13
to kivy-...@googlegroups.com
Thank you! pyjnius is that, what I was looking for.

вторник, 10 сентября 2013 г., 14:28:27 UTC+3 пользователь Ben Rousch написал:

Vadim Linnikov

unread,
Sep 10, 2013, 8:25:05 AM9/10/13
to kivy-...@googlegroups.com
When I try this to get IMEI, SN, etc.:

from jnius import autoclass

context
= autoclass('android.content.Context')
service
= context.getSystemService(context.TELEPHONY_SERVICE)
print service.getDeviceId()

I get the exception:
[WARNING           ] stderr:   File "main.py", line 83, in build
[WARNING           ] stderr:     service = context.getSystemService(context.TELEPHONY_SERVICE)
[WARNING           ] stderr:   File "jnius_export_class.pxi", line 545, in jnius.jnius.JavaMethod.__call__ (jnius/jnius.c:15501)
[WARNING           ] stderr:   File "jnius_export_class.pxi", line 500, in jnius.jnius.JavaMethod.ensure_method (jnius/jnius.c:14990)
[WARNING           ] stderr: jnius.jnius.JavaException: Unable to find a None method!

What I'm doing wrong?

Ben Rousch

unread,
Sep 10, 2013, 8:39:37 AM9/10/13
to kivy-...@googlegroups.com
Did you remember to build your APK with the READ_PHONE_STATE permission?

Vadim Linnikov

unread,
Sep 10, 2013, 8:46:45 AM9/10/13
to kivy-...@googlegroups.com
I launch my app from Kivy Launcher, not from APK.

вторник, 10 сентября 2013 г., 15:39:37 UTC+3 пользователь Ben Rousch написал:
Reply all
Reply to author
Forward
0 new messages