Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/224.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 我的“英特尔xdk”项目在模拟时有效,但在生成apk时无效_Android_Cordova_Intel_Intel Xdk - Fatal编程技术网

Android 我的“英特尔xdk”项目在模拟时有效,但在生成apk时无效

Android 我的“英特尔xdk”项目在模拟时有效,但在生成apk时无效,android,cordova,intel,intel-xdk,Android,Cordova,Intel,Intel Xdk,我试图在intel xdk中创建一个应用程序,我在行乞,我的代码在编译或调试时工作,但在生成apk时不工作。我只想在一段时间内,当我点击一个按钮时,我的连接类型会显示在下面,但当我安装apk时,这在我的真实设备中不起作用 我试着在Nexus7上安装安卓5.0.2,在三星GalaxyACE上安装安卓2.3.6 这里是一个视频,我与我的所有权限和插件项目。 这是html <!DOCTYPE html> <html> <head> <title>Bla

我试图在intel xdk中创建一个应用程序,我在行乞,我的代码在编译或调试时工作,但在生成apk时不工作。我只想在一段时间内,当我点击一个按钮时,我的连接类型会显示在下面,但当我安装apk时,这在我的真实设备中不起作用

我试着在Nexus7上安装安卓5.0.2,在三星GalaxyACE上安装安卓2.3.6

这里是一个视频,我与我的所有权限和插件项目。

这是html

<!DOCTYPE html>
<html>
<head>
<title>Blank Hybrid App Project Template</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<style>
    ev.w3.org/csswg/css-device-adapt/ */
    @-ms-viewport { width: 100vw ; zoom: 100% ; }                           @viewport { width: 100vw ; zoom: 100% ; }
    @-ms-viewport { user-zoom: fixed ; }                                    @viewport { user-zoom: fixed ; }
</style>
<link rel="stylesheet" href="css/app.css">
</head>


<body>
<h1 class="align-center">A Blank Project Template</h1>
<p class="align-center">
    To use this template as a starter app, start with init-app.js and app.js for your JavaScript code.
    See the README.md file for more details and the comments inside index.html, app.js and init-app.js.
</p>
<br>
<p class="align-center"><input type="button" id="id_btnHello" value="Touch Me"></p>
<p class="align-center"><input type="button" id="bt_test" value="Teste" onclick="conn()"></p>
<p class="align-center" id="desc">testt</p>
<script src="intelxdk.js"></script>    
<script src="cordova.js"></script>     
<script src="xhr.js"></script>         

<script src="js/app.js"></script>      
<script src="js/init-app.js"></script> 

<script src="xdk/init-dev.js"></script>
 </body>
</html>

您不需要添加权限,这是一个非常罕见的要求。在大多数情况下,插件将提供所需的适当权限,这就是您在构建日志中获得重复消息的原因

关于您的APK不工作,您是否选择了适当的Intel XDK插件?无论是否已在插件设置中选择,它们都会自动包含在模拟器中,但除非已选择(在项目选项卡上插件部分的右栏中),否则不会包含在构建中;这是仿真选项卡()中的一个已知缺陷

您指出的API需要intel.xdk.device插件()


我建议您在执行操作时使用Cordova API,intel.xdk.device API中的某些函数将被弃用,因为它们与Cordova核心函数重叠。等效的Cordova函数是,它是插件设置屏幕左侧core Cordova列表中“连接”插件的一部分。

您是否可以将APK发布到某个地方,以便我测试它?ADB/LogCat应该让您知道设备上是否存在JS错误。
function myEventHandler() {
"use strict" ;

var ua = navigator.userAgent ;
var str ;

if( window.Cordova && dev.isDeviceReady.c_cordova_ready__ ) {
        str = "It worked! Cordova device ready detected at " + dev.isDeviceReady.c_cordova_ready__ + " milliseconds!" ;
}
else if( window.intel && intel.xdk && dev.isDeviceReady.d_xdk_ready______ ) {
        str = "It worked! Intel XDK device ready detected at " + dev.isDeviceReady.d_xdk_ready______ + " milliseconds!" ;
}
else {
    str = "Bad device ready, or none available because we're running in a browser." ;
}
alert(str) ;
}

function conn()
{
    document.getElementById('desc').innerHTML = intel.xdk.device.connection;
}