[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