IMEI PhoneGap Plugin in Android

2019-08-06 07:24发布

问题:

I am trying to retrieve the IMEI in android using PhoneGap. I have followed this one PhoneGap Plugin for IMEI

The output is "It works...". I am not getting the imei.

Where do I put the imei.js?

Thanks in advance.

回答1:

In order to run that example, you need to build a custom plugin.

How to build a custom plugin?? Here is the way Plugin development

Using these tutorials you need to build a custom plugin and then put java and js files in the right places.(Not only js, you need a java file too as shown in you link)

(N.B. If you need exact IMEI, then you'll need some third party plugin. But if you just need an unique number to recognize each device individually, I would suggest you should use the UUID That will avoid the hassle of creating custom plugin. Here is the example Get UUID)

And you can see the answers of this question to find out more about getting IMEI.

How to get IMEI number in phonegap?