Cordova 如何在Eclipse中放置Sencha touch文件并使用phonegap运行?
我正在尝试与电话差距。因此,我在sencha中构建了一个应用程序,并尝试使用phonegap 1.8来访问本机功能。要使用phonegap设置我的eclipse,请执行以下链接: 然后在www文件夹中,我保存index.html,我的应用程序文件夹也保存在其中。因此,在android项目中,我的文件夹结构如下:Cordova 如何在Eclipse中放置Sencha touch文件并使用phonegap运行?,cordova,sencha-touch-2,Cordova,Sencha Touch 2,我正在尝试与电话差距。因此,我在sencha中构建了一个应用程序,并尝试使用phonegap 1.8来访问本机功能。要使用phonegap设置我的eclipse,请执行以下链接: 然后在www文件夹中,我保存index.html,我的应用程序文件夹也保存在其中。因此,在android项目中,我的文件夹结构如下: ---src | |--package name | |---------activity name |--assets | |----www |
---src
| |--package name
| |---------activity name
|--assets
| |----www
| |----app
| | |---view
| | | |----Panel.js(Sencha file)
| | |---app.js
| |-----index.html
| |-----corodova.js
|--libs
|----corodova.jar
|----touch
|----resources
| |-----css
| |----sencha-touch.css
|
|----sencha-touch-debug.js
但当我在模拟器中运行它时,它会显示白色屏幕
这是我的panel.js代码
Ext.define('MyApp.view.Panel', {
extend: 'Ext.Panel',
config: {
items: [
{
xtype: 'toolbar',
docked: 'top',
height: 52,
title: 'Feedback'
}
]
}
}))
这是我的index.html
<!DOCTYPE html>
<!-- Auto Generated with Sencha Architect -->
<!-- Modifications to this file will be overwritten. -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Listview</title>
<script src="libs/touch/sencha-touch-debug.js" type="text/javascript"></script>
<link href="libs/touch/resources/css/sencha-touch.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" id="phonegap" src="cordova-1.8.1.js"></script>
<script type="text/javascript" src="app/app.js"></script>
<script type="text/javascript">
if (!Ext.browser.is.WebKit) {
alert("The current browser is unsupported.\n\nSupported browsers:\n" +
"Google Chrome\n" +
"Apple Safari\n" +
"Mobile Safari (iOS)\n" +
"Android Browser\n" +
"BlackBerry Browser"
);
}
</script>
</head>
<body></body>
有人能帮我吗?我想不出来。我是新来的
提前感谢..当您看到白色屏幕时,这是因为您的Javascript(可能在您的app.js中)中有一些内容,例如缺少的coma或未定义的变量、函数或其他 尝试在Chrome、Safari或Firefox中启动index.html。然后启动Web inspector(通常是右键单击>inspect元素)。然后转到console选项卡,查看是否存在错误
希望这有助于在app.js之前将sench-touch.js fiel包含在index.html的头部我将sencha-touch.css与index.html放在同一个文件夹中,并添加了资源文件夹
我在博客中分享了这个解决方案:这是我的eclipse设置,我已经打开了index.html文件
有人能帮忙吗..我哪里做错了?现在我得到了referenceError..找不到Ext。我把sencha-touch-debug.jas和sencha-touch.css放在libs文件夹中。但是我在web inspector::GET中记录了这个错误file:///E:/Android%20Project/SenchaCameraAPP/assets/www/libs/touch/sencha-touch-debug.js index.html:9未捕获引用错误:未定义Ext应用程序。js:16未捕获引用错误:未定义Ext索引。html:14获取file:///E:/Android%20Project/SenchaCameraAPP/assets/www/libs/touch/resources/css/sencha-touch.css index.html:9显示web inspector并确认是否加载了sencha-touch-debug.js,我很抱歉因为这个问题。可能是您提供的部分错误或文件在您提供的位置不可用。我编辑了文件结构。看看这个,如果你有时间的话,你能告诉我index.html文件哪里做错了吗?你应该把sencha-touch-debug.js文件放在index.html和src='sencha-touch-debug.js'相同的文件夹中,你找到解决方案了吗?如果是,请与我共享。如果我在启动时检查最小phonegap项目运行正常,但当我使用sencha touch 1检查phonegap API示例时,它会显示白色的空白屏幕。@prakash_d22很抱歉延迟回复。我在博客中分享解决方案:。。。。。。。检查一下。希望对你有帮助。不,我不明白。我已经在eclipse.istart中安装了phonegap插件,单击phonegap徽标,然后我检查sencha touch 2并在index.html文件中添加代码,它显示一个白色的空白屏幕这是我的新代码Ext.Application({launch:function(){new Ext.Panel({fullscreen:true,html:“hello satara”});});现在按照谷歌和其他博客上的说明做这件事,我仍然得到一个白色空白屏幕的错误。只需按照我在博客中提到的步骤。我希望您正在安装MDS并尝试。你在哪个模拟器上运行???我试过了。意味着mds鼓掌。但对我来说,这也给了我问题。白色屏幕。这就是为什么我告诉你要遵循我博客的步骤。现在由你决定。
package com.innominds.cameraApp;
import android.os.Bundle;
import org.apache.cordova.*;
public class SenchaCameraAPPActivity extends DroidGap {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.loadUrl("file:///android_asset/www/index.html");
}
}