Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
277 views
in Technique[技术] by (71.8m points)

html - Configuring Android Web Applications

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. You can specify the home page icon.
  2. You can specify a startup image that displays while the web page is loading.
  3. You can hide the browser UI.
  4. You can change the status bar color.

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" />

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.]

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

When you create a shortcut on the home screen to a bookmark, Android will use a apple-touch-icon-precomposed if present (but not apple-touch-icon) as a high-res icon:

<link rel="apple-touch-icon-precomposed" href="/custom_icon.png"/>

As for the rest of the features, I don't think there's any way to do this at present without publishing an Android app that acts as a wrapper for your website.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...