配置Android的Web应用程序

问题描述:

iPhone的网络应用程序有四个configuration 提供的功能(不包括HTML5应用程序缓存)来配置网页的行为方式,当你的网页保存到主屏幕为书签。

iPhone web apps have four configuration features available (not including the HTML5 application cache) to configure how web pages behave when you save the web page to the home screen as a bookmark.

  1. 您可以指定主页的图标。
  2. 您可以指定当加载网页时显示开机画面。
  3. 您可以隐藏浏览器的用户界面。
  4. 您可以更改状态栏的颜色。

这四个功能的工作通过添加标签的< HEAD>像这样的:

The four features work by adding tags to the <head> like this:

<link rel="apple-touch-icon" href="/custom_icon.png"/>
<link rel="apple-touch-startup-image" href="/startup.png">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />

当然,所有这些Apple苹果特定标记的做Android的任何事情。但是,有没有办法做一些相同呢? [至少,我希望用户能够添加自己的网页他们的Andr​​oid主屏幕(例如,在安卓2.0),并有一个pretty的高分辨率图标]

Naturally, none of these "apple-" specific tags do anything in Android. But is there any way to do something equivalent? [At a minimum, I want users to be able to add my web page to their Android home screen (e.g. in Android 2.0) and have a pretty hi-res icon.]

这是一个过时的问题,因为这样的答案发生了变化。 Chrome浏览器对新的机器人有它自己的meta标签这一点。 请确保您添加到主屏幕,并启动从主屏幕。 一个正常的书签是不够的。 Chrome浏览器目前使用的苹果指令数,但三底部是Android的神奇。

This is a dated question, as such the answer has changed. Chrome on newer androids has it's own meta tags for this. Make sure you Add to the Homescreen, and launch from the homescreen. A normal bookmark is not sufficient. Chrome currently uses a few of the apple directives, but the three at the bottom are the android magic.

<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-startup-image" href="startup.png">
<link rel="apple-touch-icon" href="youricon.png"/>
<link rel="apple-touch-icon-precomposed" sizes="128x128" href="youricon.png">

<meta name="mobile-web-app-capable" content="yes">
<link rel="shortcut icon" sizes="196x196" href="youriconhighres.png">
<link rel="shortcut icon" sizes="128x128" href="youricon.png">