1.拷贝cordova.jar到libs目录
2.在assets目录下新建www文件夹,把例子中的cordova.js index.html拷贝到该目录,修改 index.html为:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<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>Hello World</title>
</head>
<body>
<div class="app">
Hello world
</div>
</div>
<script type="text/javascript" src="cordova.js"></script>
</body>
</html>
3.把例子中的xml文件拷贝到res目录下
4.添加以下代码到AndroidManifest中的<manifest> </manifest>子项中
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true"
android:resizeable="true"
android:anyDensity="true"
/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.RECORD_VIDEO"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
5.MainActivity中修改代码为:
import org.apache.cordova.DroidGap;
import android.os.Bundle;
public class MainActivity extends DroidGap {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.loadUrl("file:///android_asset/www/index.html");
}
}
分享到:
相关推荐
NULL 博文链接:https://linshiquan.iteye.com/blog/1709842
PhoneGap Mobile Application Development Cookbook Preface 1 Chapter 1: Movement and Location: Using the Accelerometer and Geolocation Sensors 7 Introduction 7 Detecting device movement using the ...
This book will guide you through the process of creating a complex data-driven hybrid mobile application using PhoneGap, web technologies, and third-party plugins. A good foundation is critical, so ...
This book gives you practical lessons on how to build a world class mobile application using PhoneGap. Whether you are a brand new to mobile application development, a web developer expert, or a ...
Use PhoneGap to build cross-platform mobile ...Chapter 5: First PhoneGap Application Chapter 6: Accessing Native APIs Chapter 7: Accessing Media Content Chapter 8: Application Development Workflow
PhoneGap Application is very interesting to learn a developer fast mobile
IONIC+PhoneGap项目源码,爱下不下
phoneGAP就是Cordova,据说执行起来比网页快, Android, ios通吃
PhoneGap 3.x Mobile Application Development Hotshot.2014.pdf
一个完整的phonegap与android的例子。用在pad上,包含一些自定义插件。
phonegap,cordova2.9源代码,以及自带的示例程序
This book will guide you through the process of creating a complex data-driven hybrid mobile application using PhoneGap, web technologies, and third-party plugins. A good foundation is critical, so ...
PhoneGap html5 拍照上传DEMO
基于android ,phonegap调用照相机拍照,图片保存
PhoneGap 2.9.0
使用phonegap基于jquery mobile、jqMobi的相关Demo实例。
phonegap 最新桌面版,版本号:6.3.0
phoneGap手机安装apk,开发phoneGap项目 的时候方便调试
phonegap-cli, PhoneGap和 PhoneGap/构建 命令行 接口 PhoneGap命令行接口和 node.js 库。命令行命令行要求安装 node.js 版本 >=4.0.0安装 iOS sim 将应用程序部署到iOS模拟器。安装$ npm install