At the beginning, the simulator I selected was WVGA854 with a resolution of 854*480. After the development, I felt very OK when I installed it on a 800*480 mobile phone, but when I installed it on a 480*320 or 320*240 resolution mobile phone, many interfaces were distorted, at this time, I felt the importance of app self-adaptation.
Adaptive mainly encounters two major problems: switching between the landsc
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
Display.getmetrics (DM) is basically applied to get the real screen size. It is good to remember that.
Note: The constructor displaymetrics does not need to pass any arguments, and after calling Getwindowmanager () the handle of the existing activity is obtained. Diplay then stores the resulting wide-high dimension in the Displaymetrics object, and the resulting wide-high dimension is in
Dip or DP (density-independent pixels)Length (true length): inches, inchPixels per inch dpi (screen density)Pixels: pxDip formula: px/dip=dpi/160 (screen pixel/dip = screen density/160), inch = Px/dpi,dip=160*inchScreen 320*480, the number of
New ipad release, many friends have a variety of 2048x1536 resolution (pixel) worry. For example, if you are worried about designing a new ipad application interface, you need to equip your designer with a larger display device. For example, because of the resolution to deal with the adaptation and worry about the development of increased difficulty.
All sorts of worries are no less than the kinds of complaints we often hear about the multiple resolutions of Android devices.
Is it
Mobile phone horizontal screen prompt, mobile phone horizontal
[Project address]: http://dwz.cn/RYgq7
[Mobile Phone QR code ]:
[Effect ]:
[Code]
For better experience, use the vertical screen
/* Put the style at the end to prevent congestion caused by base64 images */@ K
JS obtains the current webpage size and screen resolution. js currently
The effect is as follows:
The Code is as follows:
The code is illustrated as follows:
How can I obtain the screen width of a mobile phone from a js webpage?
I don't know if it is the screen resolution:
1. Get the phone screen width:Displaymetrics New displaymetrics (); Getwindowmanager (). Getdefaultdisplay (). Getmetrics (DM); int screenwidth = dm.widthpixels; int screenheight = dm.heightpixels;22. Set the dynamic setting height for the control according to the screen width:= imageview.getlayoutparams (); Params.height=SCREENWIDTH/10; =SCREENHEIGHT/10;
IPhone 4
IPhone 5
IPhone 6
IPhone 6 Plus
Display Size
3.5 in
4 in
4.7 in
5.5 In
Screen Size
x 480 Points
X 568 points
375 x 667 points
414 x 736 Points
Rendered Pixels
640 x 960 (@2x)
640 x 1136 (@2x)
X 1334
Screen size1. Different layoutAndroid phone screen size is different, there are 480x320,640x360,800x480. How can I get the app to adapt to various screens automatically? In fact, it is very simple to create a different layout folder in the Res directory, such as: layout-640x360,layout-800x480, all layout files will be compiled after compilation Write to the R.jav
Screen Size1. Different Layout
The screen sizes of Android mobile phones vary by 480X320,640x360,800 X. How can an app automatically adapt to different screens? In fact, it is very simple, just need to create different layout folder under the res directory, such as: layout-640x360, layout-800x480, all the layout files will be written to R after compilation. java,
The concepts of PX, dip, SP, and DP are vague. I checked it online and found it clearly in theory.
1. PX (pixels): the point on the screen, which is related to the density. The density is high, and the PX size per unit area is large.
2. Dip or DP (pixels unrelated to density ). This is related to the hardware of th
Mobile phones in various Android operating systems are a wide array of screens, and the differences in screen resolutions can be imagined. Currently, WVGA = 800x480, hvga = 480x320, and qvga = 320x240. Of course, there are also meizu M9 dvga = 960x640, and Motorola's fwvga = 854x480.
In fact, do you use a lot of padding in your layout XML file? If so, it hurts. This layout will never adapt to all cell phone
Generally, the LCD screen of a mobile phone is made of TFT material. VGA WVGA qvga hvge XGA only indicates the screen resolution. It is a code and it does not matter with the material.
Resolution table:
Code
Resolution
Code
Resolution
Qvga
320*240 pixels
Wqvga
400*
Android discussion --- getting the phone screen size
SurfaceView simple example
Go to Android --- UI --- ZoomControls to zoom in and out images
For more information, here is a summary of the operations on the mobile phone screen in android:
1. Get the screen resolution (beca
This question is not complex, but there are a lot of people asking, so I should concentrate on answering it.
Starting from Android 3.2 (API Level 13), use the following method in the activity to obtain the screen size (in pixels ):
Display display = getwindowmanager (). getdefaultdisplay ();//Activity # getwindowmanager ()Point
This article illustrates how Android gets the size of a mobile screen. Share to everyone for your reference, specific as follows:
There are mainly three objects TextView, buttons, and Displaymetrics, where Displaymetrics is the key class to get the size of the phone screen
One, resolution Independent1. Using DP (DPI)Android uses density-independent pixels (DP) to specify the screen size, which allows zooming to achieve the same effect on devices with different pixel densities and the same screen size. (No problem with different
Web page Production WEBJX article introduction: small screen mobile device web design considerations.
In the past, small screen mobile device Web pages are often called WAP pages, or WAP stations.The reason is that this kind of web page originates from a wireless protocol called WAP.WAP can run on a var
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.