://developer.android.com/resources/dashboard/screens.html) 3 shows, the current is mainly to the resolution of 800*480 and 854*480 mobile phone users mostly
Figure 3
From the above screen size distribution, we can only consider mobile phones with a density of 1 and 1.5 between 3-inches.
4. uidesign
From the perspective of development, the application provides three sets of UI layout files based on the screen of three types of
Android adaptation, before the work is to 1280*720 interface to adapt to work, but now the resolution of the mobile phone into the 2K era, so now art are 1920*1080 to do interface design. Based on previous work experience, summed up the appropriate plan.1. Tools: Markman This is a must-have measurement tool (do not update the download after installation, otherwise the measured data will not be saved)2. Und
Li huaming himiOriginal, reprinted must be explicitly noted:Reprinted from[Heimi gamedev block]Link: http://www.himigame.com/android-game/356.html
A question asked by the brothers in the group just now, I will share it with you here: the new emulator is configured as a device simulator with a resolution of 800*480 FOR THE waga800, when we obtain its height and width in our program, we find that it is alway
is smaller than the actual screen size, because the pixels occupied by the system are invalid for the UI of the user application. Therefore, this value should be the minimum actual size required for the application layout (normally, this value is the minimum width supported by the layout regardless of the current direction of the screen ).
The following are some common screen sizes that can be used: 1.320, devices configured for the following screens:
240x320ldpi (QVGA handheld device)
320x480
specified size (size-specific), specifying Density (density-specific) that you provide.The appropriate resource for the specified size (size-specific) refers to small, normal, large, and XLarge.The appropriate resource for specifying density (density-specific) refers to ldpi (low), MDPI (Medium), hdpi (High), and xhdpi (Extra high).Android has an automatic match
Android asynchronous loading full resolution introduces a level-1 cache, android asynchronous loadingIntroducing cache for Android asynchronous loading full resolutionWhy do we need to cache images through scaling? We have implemented asynchronous loading and Optimization for large images. However, the current App is n
xhdpi. Their standard values are 120 dpi, 160 dpi, 240 dpi, and 320 dpi.
The preceding Division indicates a range:
After adding the above restrictions to the Resource Directory, you can specify a specific applicable platform for the resource, as shown below:
Indicates a large screen. In the medium density layout, select the main. xml above, and the ultra-large screen. In the medium density layout, select the main. xml below.
In actual development, the screen size is not intuitive enough.
platforms with various resolutions to run these programs directly, the Android platform classifies all screens by density and resolution, they are divided into three types:· Three major dimensions: Large, normal, and small;· Three different density types: high (hdpi), medium (mdpi), and low (ldpi ).If needed, the program can provide different resources (mainly l
Restore Heap Memory overflow errorFirst, restore the heap memory overflow error. First put a photo on the SD card, the resolution is (3776 X 2520), the size of 3.88MB, is my own camera took a picture. The layout of the application is simple, a button is ImageView, and then in the usual way, use bitmapfactory to load a picture and use a imageview display.The code is as follows:
Copy Code code as follows:
Btn_loadimage.setonclicklistene
intervention by programmers.
Screen Aspect RatioThe ratio of the physical length of the screen to the physical width. The program can provide materials for the screen with a aspect ratio. You only need to use the resource categories provided by the system, long and notlong.
ResolutionTotal number of pixels on the screen. Note that although the resolution is expressed as "width x length" in most cases, the resolut
Mobile device Too many, the resolution is not the same, see most of the Internet to adapt to the font method is defined values320x480 or value-hdpi way to deal with.Use the first kind of miserable, a lot of equipment resolution is not the same, do you want to define each kind?Using the second type of tablet is not effective.Finally, the code of the way convenient
Android Browser default preview mode browsing will be reduced to the original size in the page WebViewAndroid Browser and webview default to MDPI. hdpi equivalent to mdpi 1.5 times times ldpi equivalent to 0.75 times timesThree solutions: 1 viewport attribute 2 CSS control 3 JS control1 viewport attributes are placed in the HTML codeThe attributes of viewport in Meta are as followsHTML code2 CSS Control device densityCreate a separate style sheet for
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
//////////////////////////////////1. drawable -(
Hdpi, Mdpi, ldpi)
DPI is the abbreviation of "dot Per Inch". The number of dots per inch.
Four density classifications: ldpi (low), mdpi (medium ),Hdpi(High), and xhdpi (extra high)
Normal screen: ldpi is 120, mdpi is 160,HdpiIt is 240, and xhdpi is 320.
2. Differences between WVGA, hvga, and qvga
VGA is "video graphics array", and the display standard is 64
API means that the display does not match up on high-end machines (with a high version configuration).There are three ways to get a screen size as follows://acquired via WindowManagerdisplaymetrics dm = new Displaymetrics ();Getwindowmanager (). Getdefaultdisplay (). Getmetrics (DM);//Acquired through Resourcesdisplaymetrics dm2 = Getresources (). Getdisplaymetrics ();//Get the default
An example of this article describes the method of Android programming to achieve screen adaptive direction size and resolution. Share to everyone for your reference, specific as follows:
Android screen Adaptive direction size and resolution, including screen interface layout, multiresolution support, get screen size,
Android's resolution adaptation issue has always been a major problem for Android, referring to the official development documentation and some of the techniques for dealing with resolution in the actual development to communicate with you.Official document on resolution adaptation "Supportingmultiple Screens"Overview
versions, it is assumed that the system will only run on a device with a resolution-hvga (320x480) Resolution. The size is 3.2. Since the system can only work on one screen, developers can write their own programs for that screen, without having to consider the display of programs on other screens.However, since Android 1.6, the system has introduced support for
also similar to 1080 p (that is, the resolution is 1920*1080 pixels). In fact, the p here is progressive scan, that is, row-by-row scan.Generally, the actual screen display effect depends on the relationship between the screen size and resolution. That is, when the screen size is fixed, the larger the Resolution, the more delicate the display effect, the
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.