我是Phonegap的新用户,我很困惑一切如何运作。我已经在c://ProjectName
上创建了项目,并且为android构建了它。我打开我的ADT(Eclipse)并从现有代码创建一个项目,然后我有两个项目文件夹:ProjectName和ProjectName-CordovaLib。
当我修改index.html文件并在模拟器中运行应用程序时,它似乎没有任何效果。在ADT中,检查自动重建选项。我怎么能修改文件? 在:ProjectName.java
public class ProjectName extends CordovaActivity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
super.init();
// Set by <content src="index.html" /> in config.xml
super.loadUrl(Config.getStartUrl());
super.loadUrl("file:///android_asset/www/index.html");
}
}
我认为这些是我目前的问题。你能帮我吗? 我的index.html文件(已修改):
<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
<title>MY APP</title>
</head>
<body>
<div class="app">
<h1>MY</h1>
<div id="deviceready" class="blink">
<p class="event listening">Hi !</p>
<p class="event received">Hello Sekai</p>
</div>
</div>
<script type="text/javascript" src="phonegap.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript">
//there was something here but I deleted it.
// there was an app.init()
</script>
</body>
</html>
答案 0 :(得分:1)
First Ans:什么是ProjectName-CordovaLib
? - &GT;这是图书馆ot cordoava。在oldversion phongap中将提供.jar和现在的andorid 3.3.0,它将提供一个库。
Second Ans:我在ProjectName>www ->
中有多个平台中使用的基本公共代码,
在Android中,您可以在资产forlder中看到www。如果没有阅读&#34; _where-is-www.txt
&#34;文件并遵循实践。