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,就可以了.现在由于所用的插件,都需要用模块的形式进行按需加载,自然就没有以前那么安逸了. 例如,如果要在安卓平台添加一个音频 ...
随机推荐
- 【无聊放个模板系列】POJ 3678 2-SAT
#include<cstdio> #include<cstdlib> #include<cstring> #include<iostream> #inc ...
- [mock]12月28日
假设我们有一个全局升序数组,这个数组长度unlimited现在我们有一个全局的指针和一个目标target值,target和指针你不可见.但是有以下几个操作bool istag();void gorig ...
- linux系统灵活运用灯[android课程3]
1,文件如何生成: ----- ---- (二),把hello例子贴过来后,编译问题: 在编译Android 4.0驱动的时候,使用到了proc_dir_entry结构体中的owner成员,但是编译的 ...
- Git教程(9)集中式工作方式常用的设计分支的方案
Git是一个复杂的版本管理系统,管理代码有很多工作方式,如集中式,管理者式,司令/副官式 本文是假设选用集中式工作方式时,设计分支的方案. 中小型项目: 维护两个长期分支,分别是master 和 de ...
- [HIS] HIT行业常用名词及缩写定义
[HIS] HIT行业常用名词及缩写定义 1. EHR 居民个人电子健康记录 2. MPI 居民个人主索引 3. HIS 医院管理信息系统 4. CIS 医院临床信息系统 5. P ...
- Linux下修改PATH的方法
Linux下修改PATH的方法 1.直接在命令行里敲 PATH=$PATH:/path1:/path2:/pathN用户登出之后PATH恢复原样. 只是临时起作用. 2.修改~目录下bash_prof ...
- pylinter could not automatically determined the path to `lint.py`
先关闭Sublime Text 1) 到官网先下载pylinter,http://www.logilab.org/project/pylint,然后解压缩,拷贝到C盘,目录为C:\pylint-1.0 ...
- asp.net SqlParameter关于Like的传参数无效问题
按常规的思路,我们会这样写 复制代码代码如下: String searchName ="Sam"; String strSql = "select * FROM Tabl ...
- OK335xS EMMC Partition hacking
#! /bin/sh # # OK335xS EMMC Partition hacking # 说明: # 本文主要是为了解读同事对EMMC分区的写法,其中有很多写法重复了,但 # 依然尽量保留其作者 ...
- 【兼容】IE下PNG色差
IE(包括IE7)中的PNG色差问题http://bbs.blueidea.com/thread-2910513-1-1.html修正IE对PNG颜色显示错误的问题http://www.lizhenw ...