1

I am porting android app to BB 10.I am not able to retrieve IMEI number from this android porting application ,Is there any way i can use PhoneGap script file in android app ,by creating a local html and using java script to retrieve the IMEI number using Phone Gap using the below concept

http://developer.android.com/guide/webapps/webview.html#BindingJavaScript

Presently, I tried using javascript below to retrieve IMEI no

   <script type="text/javascript" charset="utf-8" src="js/phonegap.js"></script>
</head>
<script type="text/javascript">
    function showAndroidToast(toast) {  
    Android.showToast('kkkkkkk');       
    var idno = device.uuid ;
var string = device.version;
Android.showToast('idno' + string); 
Android.showToast('string ' + idno); 
toast = toast + idno;
    Android.showToast(toast);
    }
</script>

I am getting the value of null,I am testing it in BB 10 dev Alpha device.

Is there any other workaround for it?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Rakesh
  • 14,997
  • 13
  • 42
  • 62
  • Is there any thing,That i can do with PhoneGap scripts or any other to retreive the IMEI number – Rakesh Apr 05 '13 at 09:42

2 Answers2

0

IMEI is not available to 3rd party apps. What are you trying to do with that info?

The reason I ask is because we just published an extension for BlackBerry WebWorks (like PhoneGap) here that retrieves the Mobile Network Code (MNC) which can identify the current carrier. How comfortable are you with building custom-plugins? If so, you may be able to port this native code into a PhoneGap plugin:

https://github.com/blackberry/WebWorks-Community-APIs/tree/master/BB10/deviceInfo

Adam Stanley
  • 1,875
  • 1
  • 15
  • 16
  • I am not able to retreive IMEI number of device thr android java code,So If i use your extension file in my local/res folder,and put the local html in assests folder ,try accessing using your extension ,Will it work?Rather creating an WebWorks sort of application using your extension. – Rakesh Apr 10 '13 at 08:09
0

Issue fixed in Blackberry 10.1 versions.IMEI number is retreived from this OS versions using native android code.

Rakesh
  • 14,997
  • 13
  • 42
  • 62