- cd into your project directory
- Use the cmd line
phonegap local plugin add https://github.com/DusanMilko/PhonegapAndroidImei.git
You should now see it in your plugins folder PROJECT/plugins/com.dusan.imei.DeviceInfo
If using phonegap 3.3 of later use "cordova ..." not "phonegap ..."
Anytime after your device is ready at this into any js file
if( plugins.DeviceInfo ){
plugins.DeviceInfo.imeiNumber(function(imei){
alert("imei "+ imei);
});
}
You build the project
phonegap build android
Then check your platforms/android/ folder
Under src/com/dusan/imei should be the DeviceInfo.java file
Under assets/www/plugins/com.dusan.imei.DeviceInfo/www should be the deviceinfo.js file
If these files aren't there you installed incorrectly
Your res/xml/config.xml has
<plugins>
<plugin name="DeviceInfo" value="com.dusan.imei.DeviceInfo"/>
</plugins>
Your AndroidManifest.xml has
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>