Android 未调用phonegap设备就绪函数
我对PhoneGap Android比较陌生,我有一个iPhone应用程序,需要迁移到Android应用程序。我已经将www从iPhone应用程序添加到Android应用程序,并添加了清单权限,甚至用config.XML和cordova.XML复制了XML文件夹,但问题是我的设备就绪功能没有被调用 这是我的index.html代码Android 未调用phonegap设备就绪函数,android,cordova,Android,Cordova,我对PhoneGap Android比较陌生,我有一个iPhone应用程序,需要迁移到Android应用程序。我已经将www从iPhone应用程序添加到Android应用程序,并添加了清单权限,甚至用config.XML和cordova.XML复制了XML文件夹,但问题是我的设备就绪功能没有被调用 这是我的index.html代码 <!DOCTYPE html> <html> <head> <meta n
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link
href="http://code.jquery.com/mobile/1.0rc2/jquery.mobile-1.0rc2.min.css"
rel="stylesheet" />
<script src="scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
<link href="css/style.css" type="text/css" rel="stylesheet" />
<link href="css/index.css" type="text/css" rel="stylesheet" />
<script src="scripts/app.js" type="text/javascript"></script>
<script type="text/javascript"
src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script type="text/javascript"
src="http://code.jquery.com/mobile/1.0rc2/jquery.mobile-1.0rc2.min.js"></script>
<script src="scripts/gallery_handler.js" type="text/javascript"></script>
<script src="scripts/itpoverlay.js" type="text/javascript"></script>
<script src="scripts/sqlite.js" type="text/javascript"></script>
<script src="scripts/jquery.exif.js" type="text/javascript"></script>
</head>
<body id="body">
<div class="app" style="display: none;">
<div id="deviceready">
<p class="status pending blink">Connecting to Device</p>
<p class="status complete blink hide">Device is Ready</p>
</div>
</div>
<div data-role="page" id="gallerypage" data-theme="a">
<div data-role="header">
<h1 class="headtitle">NG DESIIGNS</h1>
</div>
<div data-role="content" id="pagecontent">
<ul id="gallery" class="gallery">
</ul>
</div>
</div>
<script type="text/javascript" src="cordova-2.0.0.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript">
alert("app to be initialized");
app.initialize();
document.addEventListener('deviceready', function() {
alert("device ready called");
db.transaction(queryDB, errorCB, successCB);
}, false);
document.addEventListener("offline", function() {
alert("Your Device is offline");
}, false);
</script>
</body>
</html>
这是导致错误的原因:
10-08 10:46:41.994: E/Cordova(763): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=gap://ready }
系统无法通过调用deviceReady函数找到处理数据显示的意图。这让我觉得你的项目设置可能有错误
再次检查您是否已使用
将代码从ios迁移到android时,请确保您已撤销了可能对安装文件等所做的任何iphone特定更改。这是导致错误的原因:
10-08 10:46:41.994: E/Cordova(763): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=gap://ready }
系统无法通过调用deviceReady函数找到处理数据显示的意图。这让我觉得你的项目设置可能有错误
再次检查您是否已使用
在将代码从ios迁移到android时,请确保您已经撤销了可能对安装文件等进行的任何iphone特定更改。您必须将www文件夹中的cordova.js更改为android cordova.js中的一个您必须将www文件夹中的cordova.js更改为android cordova.js中的一个
10-08 10:46:41.994: E/Cordova(763): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=gap://ready }