With more and more users of mobile devices, Android phones have more than 1.3 million activations per day, so our webapp for mobile terminals are starting to follow. This paper mainly introduces the knowledge and experience of webapp development and debugging, and gives several alternative solutions.
I. Basic CONCEPTS
(1) CSS pixels and device pixels
CSS Pixels: An abstract unit used by browsers to draw content on a Web page.
Device pixels: Displays the smallest physical unit of the screen,
Editor's note: This article is following the Service-aware network architecture based on SDN,NFV For further analysis of DPI , the three deployment scenarios that may occur in SDN are analyzed, and the 4-7 The business requirements of the tier and the business-aware network architecture are described in depth. 650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/58/A2/wKiom1S2HUTguLXUAAK9f2hn5gg396.jpg "style=" float: none; "title=" 1.jpg "a
Qt on Android: how to adapt to different screen sizes
How can I use Android apps developed by Qt to adapt to various screen sizes of Android smartphones?
Speaking of the screen size, there are mobile phone screens from 2.8 to 8.9, which is more painful for programmers. The Android project has taken this issue into consideration. resource files and comparison labels all have ldpi, mdpi, hdpi, and xhdpi versions. The Android framework automatically selects corresponding icons Based on the screen s
Qt on Android: how to adapt to different screen sizes, qtandroid
How can I use Android apps developed by Qt to adapt to various screen sizes of Android smartphones?
Speaking of the screen size, there are mobile phone screens from 2.8 to 8.9, which is more painful for programmers. The Android project has taken this issue into consideration. resource files and comparison labels all have ldpi, mdpi, hdpi, and xhdpi versions. The Android framework automatically selects corresponding icons Based on t
the ImageView height to get the picture to show the proportional normal in this particular simulator:The actual pixel size of the above image is: 828*314, the ratio of width to height is about 2.43, and the simulator we use here is 480*800 (px, or pixel), that is, the width of the pixel is 480, So we're going to set the height of this imageview to how many dips can make it fit exactly 2.43 of the scale.the relationship between PX (pixel), dpi (pixel
automatically adjusts the size and position of the control as the content and window sizes change, and the following is a detailed analysis. Aspects of change, namely the areas that need to be adaptive include: 1. The window size will change, corresponding to the full screen interface is the display resolution changes, that is, the overall layout of the outer space will change. 2. Content size will change, including how much text will change, the size of the image will change, the list of items
WebApp development in the early days, will encounter the PC-side development of the page in the mobile display too big problem, here need to add META tags in the HTML head to control the zoomHere are specific instructions for this tag:Viewport Syntax Introduction:The content contains several properties:height = [Pixel_value | Device-height] ,width = [Pixel_value | device-width],Initial-scale = Float_value,Minimum-scale = Float_value,Maximum-scale = Float_value,user-scalable = [yes | no],target-d
. They also have to consider the image resources optimized for high density and low density screens. The center of this blog is how Android supports different densities of screens.Android's basic design idea is to ensure that the elements in the user interface have the same physical size, regardless of the screen density. Why is it? Very simply, no matter what the screen density, the physical size of a user's finger is constant. Keys or elements that can be pressed on any device should render th
screen of 800 pixels.You can use For example, the following HTML snippet specifies that the viewport width must strictly match the screen width, and the zoom-in function is disabled:This is an example of defining two viewports. The following syntax shows all the supported viewport properties and basic data attributes accepted by each nature:Content ="Height = [pixel_value | device-height],Width = [pixel_value | device-width],Initial-scale = float_value,Minimum-scale = float_value,Maximum-scale
DpThis is the most common but also the most difficult to understand the size of units. It is closely related to "pixel density", soFirst, let's explain what pixel density is. If you have a cell phone with a physical size of 1.5 inches x2 inches and a screen resolution of 240x320, we can calculate the screen on this phone,The number of pixels per inch is 240/1.5=160dpi (landscape) or 320/2=160dpi (portrait), 160dpi is the pixel density of the phone, and the unit
only two viewport attributes. The following syntax shows all supported viewport attributes and the general type of each accepted valueContent ="Height = [pixel_value | device-height],Width = [pixel_value | device-width],Initial-scale = float_value,Minimum-scale = float_value,Maximum-scale = float_value,User-scalable = [Yes | no],Target-densitydpi = [dpi_value | device-DPI |High-DPI | medium-
With the prevalence of high-end mobile phones (andriod,iphone,ipod,winphone, etc.), the development of mobile Internet applications is becoming more and more important, and it is the best choice to develop mobile applications with HTML5. However, each phone has a different resolution, different screen size, how to make our development of the application or page size can be suitable for a variety of high-end mobile phone use it? Learning the use of HTML5 viewport can help you do this ...Viewport
First, let us know an unfortunate message: pixels cannot be directly converted into inches or centimeters, and must be converted under DPI!
Two types of resolution conversion in Photoshop72 pixels/inch = 28.346 pixels/centimeter300 pixels/inch = 118.11 pixels/centimeter1 CM = 0.3937 inch1 inch = 2.54 cmCompare with common 1024 pixels:
1024 pixels = 3.413 inch = 8.67 cm (300 pixels/inch DPI ≈ 0.003333 in
With the prevalence of high-end mobile phones (andriod,iphone,ipod,winphone, etc.), the development of mobile Internet applications is becoming more and more important, and it is the best choice to develop mobile applications with HTML5. However, each phone has a different resolution, different screen size, how to make our development of the application or page size can be suitable for a variety of high-end mobile phone use it? Learning the use of HTML5 viewport can help you do this ... viewport
-scalable = [yes | no],
10
target-densitydpi = [Dpi_value | device-dpi | high-dpi | medium-dpi | low-dpi]
11
"
12
/>
1.Set widthControls the size of the viewport, you can specify a value or a special value, suc
Android resolution adaptation
The problem of Android resolution adaptation has always been a major problem for Android. Here, I refer to the official development documentation and some of the resolution processing skills in actual development to share with you.
Official resolution adaptation documentation "SupportingMultiple Screens"Overview of Screens SupportScreen size: Screen size Screen density: Screen Density Orientation: Direction Resolution: Resolution density-independent pixel (dp or dip
With the prevalence of high-end mobile phones (andriod,iphone,ipod,winphone, etc.), the development of mobile Internet applications is becoming more and more important, and it is the best choice to develop mobile applications with HTML5. However, each phone has a different resolution, different screen size, how to make our development of the application or page size can be suitable for a variety of high-end mobile phone use it? Learning the use of HTML5 viewport can help you do this ... viewport
-scalable=no" />Android 4.0 ~ 4.3As a relatively old version of Android, it has a poor support for the width attribute in meta. In Samsung Note II, for example, its device-width is 360px. If you set the width (hereinafter abbreviated) in viewport vWidth to a value that is less than or equal to 360, it will not have any effect, and a vWidth value greater than 360 will not cause the screen to scale, but a horizontal scroll bar appears.If you want to support Android 4.0 to 4.3, you still have to re
With the prevalence of high-end mobile phones (andriod,iphone,ipod,winphone, etc.), the development of mobile Internet applications is becoming more and more important, and it is the best choice to develop mobile applications with HTML5. However, each phone has a different resolution, different screen size, how to make our development of the application or page size can be suitable for a variety of high-end mobile phone use it? Learning the use of HTML5 viewport can help you do this ... viewport
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.