How can I provide a single build for all screen resolutions in Android?
I have 3 sets of images; low, medium, and high resolution. I have plac开发者_如何学Pythoned them in the android folders drawable-hdpi, -mdpi, and -ldpi respectively. My doubt is, will the android device automatically take the images according to its resolution or should I mention it in the code? Please clarify my doubt.
It will.
Note that you should also check that you don't use absolute pixels for layouts, etc. As described in http://developer.android.com/guide/practices/screens_support.html
It's automatic. From the docs:.
At runtime, the system ensures the best possible display on the current screen with the following procedure for any given resource:
- The system uses the appropriate alternative resource. Based on the size and density of the current screen, the system uses any size- and density-specific resource provided in your application.
精彩评论