在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的格式及其内容:
{
"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/

本文详细介绍了Firefox OS中manifest.webapp的结构和内容,它结合了Android的Android.mk和Manifest.xml的功能。manifest.webapp使用JSON格式,包含了app的名称、图标、权限、屏幕方向等信息。文章列举了强制属性如name、description、default_locale,以及可选属性如launch_path、version、permissions等,并解释了各自的作用。此外,还讨论了屏幕方向、权限管理、全屏设置以及针对privileged和certified类型app的特性。

4887

被折叠的 条评论
为什么被折叠?



