[置顶] Firefox OS 学习——manifest.webapp结构分析
2013-08-26 19:56
295 查看
在Firefox OS 学习——Gaia 编译分析 这篇文章多次提到manifest.webapp文件,对于做过android app 开发的人来说,都很熟悉Android.mk 和Manifest.xml文件。在Firefox OS中,manifest.webapp的作用是综合了android 中的Android.mk 和Manifest.xml的作用。下面就具体说说manifest.webapp的结构及其内容。
manifest.webapp采用的是json的数据格式(键值对的形式),它描述了app 的name,icon,loacl,premissions等相关的信息。先看一个相对完整的manifest.webapp的格式及其内容:
属性
上述code清单中的各种属性,用法,含义,下面做详细介绍。这些属性必须包含String,其实它的属性大致可以分为两类:强制属性,可选属性。
1.强制属性
name:默认locale下,web app的名称,显示在设备中app的名称,最大支持128字符
description:默认locale下,web app的简短描述(查询了一些资料,没发现它的功能)最大支持1024字符
default_locale:设置默认的locale,确定name,description的语言环境。
2.可选属性
launch_path:指定web app被打开时,首先加载的东西,一般都是"/index.html".如果值缺省了(即"/"),将加载域名的东西。
version:web app的版本号,
type:确定这个app 和manifest如何被runtime解析,还有所使用的安全机制。它的值只能是下面三个中一个:
* web:正常的web app可以单独存在,在应用商店可以下载安装,并且会列举有限的权限。type 不指定时,默认是web。
* privileged:就像android Ios 一样单独存在的app,会在本地安装一个文件包。它需要通过应用商店的审核。
* certified:不用于第三发app中,属于系统级别的东西,例如系统设置,拨号器,电源管理等。类似android:sharedUserId 作用把。
icons:app icon,支持 16 x 16, 32 x 32, 48 x 48, 64 x 64, 128 x 128 and 256 x 256
developer:开发者相关的信息,包括开发者名称,及其URL。
installs_allowed_from:指定app可以从那些应用商店安装,"*"可以从任何地方安装," "无法从任何网站商店安装。
appcache_path:
待续
manifest.webapp采用的是json的数据格式(键值对的形式),它描述了app 的name,icon,loacl,premissions等相关的信息。先看一个相对完整的manifest.webapp的格式及其内容:
{ "name": "MozillaBall", "description": "Exciting Open Web development action!", "launch_path": "/", "version": "1.0", "type": "privileged", "icons": { "16": "/img/icon_16.png", "48": "/img/icon_48.png", "128": "/img/icon_128.png" }, "developer": { "name": "Mozilla", "url": "https://mozilla.org/en-US" }, "installs_allowed_from": [ "https://marketplace.mozilla.org" "https://marketplace.example.org" ], "appcache_path": "/cache.manifest", "locales": [ "es": { "description": "¡Acción abierta emocionante del desarrollo del Web!", "developer": { "url": "https://mozilla.org/es-ES" } } "it": { "description": "Azione aperta emozionante di sviluppo di fotoricettore!", "developer": { "url": "http://it.mozillalabs.com/" } } ], "default_locale": "en", "screen_size": { "min_width": "600", "min_height": "300" }, "required_features": [ "touch", "geolocation", "webgl" ], "orientation": "landscape", "permissions": { "contacts": { "description": "Required for autocompletion in the share screen", "access": "read" } }, "fullscreen": "true", "activities": { "share": { "filters": { "type": ["image/png", "image/gif"] } "href": "/share.html", "disposition": "window" } } }
属性
上述code清单中的各种属性,用法,含义,下面做详细介绍。这些属性必须包含String,其实它的属性大致可以分为两类:强制属性,可选属性。
1.强制属性
name:默认locale下,web app的名称,显示在设备中app的名称,最大支持128字符
description:默认locale下,web app的简短描述(查询了一些资料,没发现它的功能)最大支持1024字符
default_locale:设置默认的locale,确定name,description的语言环境。
2.可选属性
launch_path:指定web app被打开时,首先加载的东西,一般都是"/index.html".如果值缺省了(即"/"),将加载域名的东西。
version:web app的版本号,
type:确定这个app 和manifest如何被runtime解析,还有所使用的安全机制。它的值只能是下面三个中一个:
* web:正常的web app可以单独存在,在应用商店可以下载安装,并且会列举有限的权限。type 不指定时,默认是web。
* privileged:就像android Ios 一样单独存在的app,会在本地安装一个文件包。它需要通过应用商店的审核。
* certified:不用于第三发app中,属于系统级别的东西,例如系统设置,拨号器,电源管理等。类似android:sharedUserId 作用把。
icons:app icon,支持 16 x 16, 32 x 32, 48 x 48, 64 x 64, 128 x 128 and 256 x 256
developer:开发者相关的信息,包括开发者名称,及其URL。
installs_allowed_from:指定app可以从那些应用商店安装,"*"可以从任何地方安装," "无法从任何网站商店安装。
appcache_path:
待续
相关文章推荐
- Firefox OS 学习——manifest.webapp结构分析
- [置顶] Firefox OS 学习——Gaia 编译分析
- 学习: Delphi FireMonkey 结构性初略分析
- 内存结构分析学习笔记
- 学习笔记4-项目的目录结构与安装及启动过程分析
- H264分析源码学习之结构体篇——h264_stream_t结构体
- UE4入门学习2:工程结构分析
- JDK源码学习之HashMap (一) : 底层存储结构分析
- [置顶] MySQL数据库主从同步存在问题的分析与学习
- [置顶] 生成学习算法、高斯判别分析、朴素贝叶斯、Laplace平滑——斯坦福ML公开课笔记5
- java学习个人笔记---常见的垃圾回收器及存储结构分析
- Launcher2分析(一)---整体结构和配置文件AndroidManifest.xml
- C++MFC学习心得(五)——单文档视图结构分析
- android学习-应用结构-AndroidManifest.xml
- 学习笔记4-项目的目录结构与安装及启动过程分析
- Linux netfilter 学习笔记 之三 ip层netfilter的table、rule、match、target结构分析
- [置顶] Firefox OS 学习——简单了解知识
- Android开发学习总结(五)——Android应用目录结构分析
- 04-S3C2440u-boot学习之u-boot分析(2)之Makefile结构分析
- 框架学习:ibatis框架的结构和分析