phonegap Overview
PhoneGap 和 Cordova的关系阐述
是PhoneGap贡献给Apache后的开源项目,是从PhoneGap中抽出的核心代码,是驱动PhoneGap的核心引擎。你可以把他想象成类似于Webkit和Google Chrome的关系。
Apache Cordova is an open-source mobile development framework. It allows you to use standard web technologies such as HTML5, CSS3, and JavaScript for cross-platform development, avoiding each mobile platforms' native development language. Applications execute within wrappers targeted to each platform, and rely on standards-compliant API bindings to access each device's sensors, data, and network status.
Apache Cordova graduated in October 2012 as a top level project within the Apache Software Foundation (ASF). Through the ASF, future Cordova development will ensure open stewardship of the project. It will always remain free and open source under the Apache License, Version 2.0. Visit cordova.apache.org for more information.
Use Apache Cordova if you are:
a mobile developer and want to extend an application across more than one platform, without having to re-implement it with each platform's language and tool set.
a web developer and want to deploy a web app that's packaged for distribution in various app store portals.
a mobile developer interested in mixing native application components with a WebView (browser window) that can access device-level APIs, or if you want to develop a plugin interface between native and WebView components.
Basic Components
Apache Cordova applications rely on a common config.xml
file that provides information about the app and specifies parameters affecting how it works, such as whether it responds to orientation shifts. This file adheres to the W3C's Packaged Web App, or widget, specification.
The application itself is implemented as a web page, named index.html by default, that references whatever CSS, JavaScript, images, media files, or other resources are necessary for it to run. The app executes as a WebView within the native application wrapper, which you distribute to app stores.
The Cordova-enabled WebView may provide the application with its entire user interface. On some platforms, it can also be a component within a larger, hybrid application that mixes the WebView with native application components. (See Embedding WebViews for details.)
A plugin interface is available for Cordova and native components to communicate with each other. This enables you to invoke native code from JavaScript. As of version 3.0, plugins provide bindings to standard device APIs. Third-party plugins provide additional bindings to features not necessarily available on all platforms. You can find these third-party plugins in the plugin registry and use them in your application. You can also develop your own plugins, as described in the Plugin Development Guide. Plugins may be necessary, for example, to communicate between Cordova and custom native components.
Development Paths
As of version 3.0, you can use two basic workflows to create a mobile app. While you can often use either workflow to accomplish the same task, they each offer advantages:
Cross-platform workflow: Use this workflow if you want your app to run on as many different mobile operating systems as possible, with little need for platform-specific development. This workflow centers around the
cordova
utility, otherwise known as the Cordova CLI, that was introduced with Cordova 3.0. The CLI is a high-level tool that allows you to build projects for many platforms at once, abstracting away much of the functionality of lower-level shell scripts. The CLI copies a common set of web assets into subdirectories for each mobile platform, makes any necessary configuration changes for each, runs build scripts to generate application binaries. The CLI also provides a common interface to apply plugins to your app. For more details on the CLI, see The Command-Line Interface. Unless you have a need for the platform-centered workflow, the cross-platform workflow is recommended.Platform-centered workflow: Use this workflow if you want to focus on building an app for a single platform and need to be able to modify it at a lower level. You need to use this approach, for example, if you want your app to mix custom native components with web-based Cordova components, as discussed in Embedding WebViews. As a rule of thumb, use this workflow if you need to modify the project within the SDK. This workflow relies on a set of lower-level shell scripts that are tailored for each supported platform, and a separate Plugman utility that allows you to apply plugins. While you can use this workflow to build cross-platform apps, it is generally more difficult because the lack of a higher-level tool means separate build cycles and plugin modifications for each platform. Still, this workflow allows you greater access to development options provided by each SDK, and is essential for complex hybrid apps. See the various Platform Guides for details on each platform's available shell utilities.
When first starting out, it may be easiest to use the cross-platform workflow to create an app, as described in The Command-line Interface. You then have the option to switch to a platform-centered workflow if you need the greater control the SDK provides. Lower-level shell utilities are available at cordova.apache.org in a separate distribution than the CLI. For projects initially generated by the CLI, these shell tools are also available in the project's various platforms/*/cordova
directories.
NOTE: Once you switch from the CLI-based workflow to one centered around the platform-specific SDKs and shell tools, you can't go back. The CLI maintains a common set of cross-platform source code, which on each build it uses to write over platform-specific source code. To preserve any modifications you make to the platform-specific assets, you need to switch to the platform-centered shell tools, which ignore the cross-platform source code, and instead relies on the platform-specific source code.
Installing Cordova
The installation of Cordova will differ depending on the workflow above you choose:
Cross-platform workflow: see The Command-Line Interface.
Platform-centered workflow: see the Platform Guides.
After installing Cordova, it is recommended that you review the Platform Guides for the mobile platforms that you will be developing for. It is also recommended that you also review the Privacy Guide, Security Guide, and Next Steps. For configuring Cordova, see The config.xml File. For accessing native function on a device from JavaScript, refer to the Plugin APIs. And refer to the other included guides as necessary.
phonegap Overview的更多相关文章
- 构建通过 Database.com 提供技术支持的 PhoneGap 应用程序
要求 其他必要产品 Database.com account 用户级别 全部 必需产品 PhoneGap Build 范例文件 Database.Com-PhoneGap-Sample 在这篇文章中, ...
- phonegap与google analytics整合
用phonegap开发的app接近尾声,需要整一个谷歌分析进去. 1.首先申请一个GA帐号,在“what would you like to track”下选择APP
- phonegap环境配置与基本操作
一.开发环境配置: 1.工具环境安装: 安装java sdk 1.6以上版本号,Android Development Tools.ant,系统变量 Path后面加入 新增名稱 JAVA_HOME 值 ...
- [原] KVM 虚拟化原理探究(1)— overview
KVM 虚拟化原理探究- overview 标签(空格分隔): KVM 写在前面的话 本文不介绍kvm和qemu的基本安装操作,希望读者具有一定的KVM实践经验.同时希望借此系列博客,能够对KVM底层 ...
- Activity之概览屏幕(Overview Screen)
概览屏幕 概览屏幕(也称为最新动态屏幕.最近任务列表或最近使用的应用)是一个系统级别 UI,其中列出了最近访问过的 Activity 和任务. 用户可以浏览该列表并选择要恢复的任务,也可以通过滑动清除 ...
- Nova PhoneGap框架 第一章 前言
Nova PhoneGap Framework诞生于2012年11月,从第一个版本的发布到现在,这个框架经历了多个项目的考验.一直以来我们也持续更新这个框架,使其不断完善.到现在,这个框架已比较稳定了 ...
- Nova PhoneGap框架 总结
Nova PhoneGap Framework 是完全针对PhoneGap应用程序量身定做的,在这个框架下开发的应用程序很容易实现高质量的代码,很容易让程序拥有很好的性能和用户体验. 在经历了多个项目 ...
- Nova PhoneGap框架 第十章 开发环境
10.1 Visual Studio + ReSharper PhoneGap程序由HTML.CSS和JS编写而成,这3种语言的编写你都可以用记事本来完成,但显然效率比较低,出错的概率也比较大.一个强 ...
- PhoneGap/cordvoa如何添加Media插件
phonegap由2.7升级到3.7之前,只要引入一个cordova.js,就可以了.现在由于所用的插件,都需要用模块的形式进行按需加载,自然就没有以前那么安逸了. 例如,如果要在安卓平台添加一个音频 ...
随机推荐
- hdu 2516 取石子游戏 博弈论
很显然的nim游戏的变形,很好找规律 先手败:2,3,5,8,13…… 其他先手胜.即满足菲波拉数列. 代码如下: #include<iostream> #include<stdio ...
- mvc学习
视频: http://edu.51cto.com/index.php?do=lession&id=14581 博客: http://www.cnblogs.com/chsword/archiv ...
- iOS中关于KVC与KVO知识点
iOS中关于KVC与KVO知识点 iOS中关于KVC与KVO知识点 一.简介 KVC/KVO是观察者模式的一种实现,在Cocoa中是以被万物之源NSObject类实现的NSKeyValueCodin ...
- 219. Contains Duplicate II
题目: Given an array of integers and an integer k, find out whether there are two distinct indices i a ...
- SRM 586 DIV1 L1
可以化简为求n条线段的最大覆盖问题,需要注意的是对于实数而言. #include <iostream> #include <vector> #include <strin ...
- R语言学习笔记:数据的可视化
本文参考数据挖掘与R第二章节 读入数据 方法1,下载Data mining with r的配套包 install.packages('DMwR') 方法2,下载txt数据,并且读入数据.方法见上文. ...
- (转)详解LVS负载均衡之三种工作模型原理和10种调度算法
原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://linuxnx.blog.51cto.com/6676498/1195379 LV ...
- Git教程(2)官方命令文档及常用命令表
http://www.cnblogs.com/angeldevil/archive/2013/11/26/3238470.html 1,官方命令文档 http://www.git-scm.com/do ...
- NFC(9)NDEF文本格式规范及读写示例(解析与封装ndef 文本)
只有遵守NDEF文本格式规范的数据才能写到nfc标签上. NDEF文本格式规范 不管什么格式的数据本质上都是由一些字节组成的.对于NDEF文本格式来说. 1,这些数据的第1个字节描述了数据的状态, 2 ...
- regsvr32提示模块加载失败 请确保二进制
微软官方的一部分解释 https://support.microsoft.com/en-us/kb/249873 关于32位和64位的说明 http://csi-windows.com/blog/al ...