Some experiences of WebApp development (mobile front end)

Source: Internet
Author: User

#webApp开发几点体会 (Mobile front) # #前言本文旨在记录本人涉足移动webApp开发的几点体会, Welcome to share and correct. # #再见, IE678 Mobile devices, Android and the iphone is the mainstream, even if the win8 devices, bring their own IE10 above, no longer see that the browser does not follow the interpretation of the repertoire, a lot of compatibility issues can be put down, concentrate on processing business. # #HTML5/CSS3HTML5/CSS3 is already very popular on mobile devices, no longer having to think about previous versions of browsers on desktop devices. HTML5 's cross-platform, ease-of-maintenance, low-cost development makes it a very wide application on mobile devices. The appearance of PhoneGap and other mixed frames also make up for the shortcomings of WebApp and the foreground is very vast. # #viewport开发web页面时的一个基础meta属性 <meta content= "width=device-width,initial-scale=1.0" name= "viewport" > Keeping the width of the page consistent with the width of the device and scaling is prohibited, which greatly reduces the design cost of web development and makes the Web page display as appropriate. # #模拟器chrome的模拟器 (Emulation) is really a tool to develop, first on the desktop to complete the majority of development and preliminary testing, and then on the special equipment testing. # #devicePixelRatio这个是设计webApp页面时一个重要的参数, define the following window.devicepixelratio is the physical pixel on the device and the device independent pixels (device-independent pixels (        Dips)) ratio. The formula means: Window.devicepixelratio = physical pixels/dips in Samsung GALAXY Note 2, for example, we can quickly find this device in the Chrome simulator! [Samsung GALAXY Note 2] (http://images.cnitblog.com/i/84053/201405/242050294347837.jpg) The phone has 720 horizontal physical pixels and 1280 longitudinal physical pixels, but because devicepixelratio= 2, that is, the horizontal longitudinal each with two image always represents the original pixel content, the whole screen is to use four physical pixels to represent the content of a pixel, this is to make the image display more realistic. For developers, we want to fill in the content, so we have to set the transverse width as ' 720px/2=360px ',The vertical setting is ' 640px ', and the developed page will appear normal on this device. # #hover & Touch no longer has hover, and is beginning to focus on touch. This development experience is few and will be added later.
Some experiences in WebApp development (mobile front end) preface

The purpose of this paper is to record the experience of human being involved in mobile WebApp development, and to share and correct.

Bye, IE678.

Mobile devices, Android and the iphone is the mainstream, even if the WIN8 equipment, bring their own IE10 above, no longer see that the browser does not follow the interpretation of the Internet, a lot of compatibility issues can be put down, concentrate on processing business.

Html5/css3

HTML5/CSS3 is already popular on mobile devices, and it's no longer necessary to think about previous versions of browsers on desktop devices. HTML5 's cross-platform, ease-of-maintenance, low-cost development makes it a very wide application on mobile devices. The appearance of PhoneGap and other mixed frames also make up for the shortcomings of WebApp and the foreground is very vast.

Viewport

A basic meta-property when developing Web pages

    <meta content="width=device-width,initial-scale=1.0" name="viewport">

Keeping the width of the page consistent with the width of the device and scaling is prohibited, which greatly reduces the design cost of web development and makes the Web page display as appropriate.

Analog device

Chrome's Simulator (Emulation) is a great tool to do most of the development and preliminary testing on the desktop, and then on a dedicated device.

Devicepixelratio

This is an important parameter when designing the WebApp page, as defined below

    window.devicePixelRatio是设备上物理像素和设备独立像素(device-independent pixels (dips))的比例。    公式表示就是:window.devicePixelRatio = 物理像素 / dips

In Samsung GALAXY Note 2, for example, we can quickly find this device in Chrome's simulator

The phone's horizontal physical pixels have 720, the longitudinal physical pixels have 1280, but because of the devicepixelratio=2, that is, the horizontal longitudinal each with two images always represent the original pixel content, the whole screen is four physical pixels to represent the content of a pixel, This is to make the image display more realistic. For developers, we want to fill in the content, so we have to set the horizontal width 720px/2=360px , vertical, the 640px development of the page will be displayed on this device normal.

Hover & Touch

There's no more hover, and you start to focus on touch. This development experience is few and will be added later.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.