获取设备信息(device_name,device_os,device_uuid,device_model,device_version)在BB10 Webworks SDK中

时间:2016-09-08 08:03:48

标签: cordova blackberry-webworks

美好的一天,我正在使用BB10 Webworks和bbui.js开发应用程序

我已经安装了

org.apache.cordova.device

我还修改了最初的index.html文件,指向这个使用此插件的cordova.js文件,如下所示:

<script type="text/javascript" src="../platforms/blackberry10/www/cordova.js"></script> 

我尝试初始化全局&#34;设备&#34;使用此变量:

  <script type="text/javascript">
var device_name,device_os,device_uuid,device_model,device_version;
   document.addEventListener("deviceready", onDeviceReady, false);


  function onDeviceReady() {
    console.log("Dev name"+device.name);
   device_name=device.name;

问题是当页面加载时......我收到以下错误:

ripple.js:50 Uncaught NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://localhost:8472/Device/getDeviceInfo'.

 deviceready has not fired after 5 seconds.

cordova.js:980 Channel not fired: onNativeReady

cordova.js:980 Channel not fired: onPluginsReady

cordova.js:980 Channel not fired: onCordovaReady

cordova.js:987 deviceready has not fired after 5 seconds.

 cordova.js:980 Channel not fired: onCordovaInfoReady

如何在BB10网络中获取所需的设备信息?

0 个答案:

没有答案