Tips for optimizing a website for Android's browser? [closed]

╄→гoц情女王★ 提交于 2019-11-27 08:59:55

问题


I'm looking for tips, tricks and resources on optimizing a website design for Android's browser.

I'm building an Android app and some of the functionality will be accessible through a web interface.


回答1:


I rely on two elements to optimize websites for mobile browsers (especially Android and iPhone):

Meta tags: HandheldFriendly and viewport

Usually I want pages not to have a page width of 800 to 900 pixels, as the Android and iPhone browsers set it to by default. To have the page width the same as the device width, I set the following meta tags:

<meta name="HandheldFriendly" content="true" />
<meta name="viewport" content="width=device-width, height=device-height, user-scalable=no" />

CSS media queries

I adapt the design to the page width. For instance, having a 2 column content for large screens and 1 column for small screens and print. So I include into the main main css-file further css-includes with media queries:

@import url(style-screen.css) screen;
@import url(style-small.css) print, handheld;
@import url(style-large.css) screen and (min-width: 801px);
@import url(style-small.css) screen and (max-width: 800px);



回答2:


I found it went a long way to add these two meta tags to my site:

<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
<meta name="HandheldFriendly" content="True" />

Here's more info on them: http://learnthemobileweb.com/2009/07/mobile-meta-tags/




回答3:


Regarding jQuery, there is a version optimized for mobile browsers: http://jquerymobile.com/




回答4:


dev.opera has some articles, not for android of course but for mobile web sites in general. For example:

Making small devices look great

Designing and Developing mobile web sites in the real world




回答5:


As all mobile web pages keep every thing slimmed as mutch as you can..




回答6:


I don’t know of any decent Android resources, but I wouldn’t go too crazy on the JavaScript. If Android is anything like the iPhone, (current) JavaScript performance will be much worse than you might be used to on desktops.



来源:https://stackoverflow.com/questions/548892/tips-for-optimizing-a-website-for-androids-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!