[Android game development 27] describes the hdpi, mdpi, and ldpi resource folders under game development and projects.

Source: Internet
Author: User

 

[Android game development] explains the hdpi, mdpi, and ldpi resource folders under game development and projects, as well as the game HD version settings. Today, a developer asks me why I want to delete the hdpi under the game development project., mdpi, and ldpi folders; the following is a detailed answer:

 

First, if the kids shoes read [Android game development 21] Android OS device lie resolution solution I wrote! In this section, we should all know that Android ranges from 1.6 to higher. Google has added the automatic adaptation function to facilitate developers to transplant various resolution models;

The principle of automatic adaptation is very simple. If you create a project of 1.6 or higher, you will see three folders under the project: drawable-hdpi, drawable-mdpi, and drawable-ldpi, these three folders are respectively placed with high-resolution, medium-resolution, and low-resolution resource files. If your project runs on high-resolution, resources in the drawable-hdpi folder are indexed by default;

"Watermark" is placed in drawable-mdpi, the system will enlarge the image by default; otherwise, if you load an image at a low resolution, once you put the image into the high-definition drawable-dpi, the system will narrow down the image by default;

To sum up, if your application wants to adapt to high, medium, and low resolutions, you need to put three sets of images in the corresponding folder so that the system can load them intelligently; if you don't want the system to be intelligently scaled, there are two solutions:

1. Delete the drawable-hdpi, drawable-mdpi, and drawable-ldpi folders and create a drawable folder;

2. Put the resource file into assets, because the Resource System in assets will never generate an id for it, so it will not be intelligently scaled;

------------------- The following describes how to make your game application HD

In fact, it is still in [Android game development 21] Android OS device lie resolution solution! According to the introduction in, after android 1.6, the screen width and height you get are actually inaccurate due to smart judgment, for details, refer to [Android game development 21] Android OS device lie resolution solution! "; Here we need to add:

If you define <uses-sdk android: minSdkVersion = "4"/> In AndroidMainFest, it will be OK! You will find that your image is clear, but it is also caused by android auto scaling. As mentioned above, the resolution obtained is generally abnormal (smaller than the correct one) once you add this sentence, your resolution will be normal, so it is obvious that the quality of the game is a high level.

 

Once you define <uses-sdk android: minSdkVersion = "4"/>, you cannot install your program on your 1.5SDK mobile phone;

 

OK. Keep busy. Please try again ~

 

Himi original, you are welcome to reprint, please note clearly! Thank you.

Address: http://blog.csdn.net/xiaominghimi/article/details/6753961

Related Article

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.