Android screen adaptation (resolution adaptation)

Source: Internet
Author: User

For new Android newcomers and developers who have just come to the Android technology post, when they are familiar with the project, they will face a major challenge when they are finished, and that is the screen fit problem. Of course, what we call the screen adaptation refers to the different resolutions that are suitable for all kinds of phones. Of course, if you are familiar with the official website (URL: developer.android.com), then you will find that the official online has actually explained how to do.

Of course, first you need to know how to open the URL, because of the big celestial system, you want to go directly to the Android Developer's official website, then really difficult. This is a small tool to use. For example: Freedoor, seashells and some other free or charge agent can also be modified your Hosts file (do not ask me how to modify, in fact, Niang or pretty good), first out of the country!!!

Well, if you can already go abroad now, then congratulations, the first step is completed, next is in your browser to visit the Android Developer website (developer.android.com), now use the picture to teach you how to find the relevant content:

Now see is the homepage of the Android official website, you follow my arrow, will step by step you learn how to find, first click Develop text, enter the following screen:

Well, this is the effect after entering, according to my tips. Please do it. When you have completed the third step, you will be introduced to this interface (if you say that the third step is not found, then in Gettiing started this column scroll down)

Now this is where the specific document interface has come into being. In this document interface, please register my frame up section, there is a tips tip in this place, overall for you to summarize how to achieve

Resolution adaptation.

Adaptation scenarios: 1. Create different layouts

2. Create a different picture

In fact, you have to have a different resolution of the picture and fit the values of different resolutions. That is, you want to derive a different resolution folder in the Drawable folder, and the file name is not the same. However, the contents of the resources are the same, and you will be in the layout file to use the value, write it in the res under the custom Dimens.xml file, then directly by referring to "@demiens/xxx" in the layout file. Let's show you how to do it.

• First, the values folder

In your custom dimens, all numeric units are in DP or dip units Oh!

drawable Folder

In these folders, you can store all your picture resources and copy them to a different package in turn.

Well, as for adaptation, what we usually use is to adapt it to the official website, and now I have a problem. This is a good resolution adaptation, but doing so will cause the apk to be too large to install the package file. If you have a better method, both for the resolution and not the installation package file too large, then please contact me, we discuss the next.

Android screen adaptation (resolution Adapter)

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.