简体   繁体   中英

How to handle very large drawable files in an Android Application

My client has given me very large resolution images for background and splash . He insisted that the quality of images should not be compromised.

He is looking to run application on Samsung Galaxy s5 and other small devices as well.

Now i have 17MB background image and other high resolution images as well.

I have read about hdpi , ldpi and other screen resolution android provided, but i am unable to understand if i put all these images in my drawabales then the size of my apk file will be so high.

Kindly guide me how do you manage high resolution images.

you can resize images as per the densities from android link

ldpi (low) ~120dpi

mdpi (medium) ~160dpi

hdpi (high) ~240dpi

xhdpi (extra-high) ~320dpi

xxhdpi (extra-extra-high) ~480dpi

xxxhdpi (extra-extra-extra-high) ~640dpi

如果您不希望您的应用太笨重,则可以将这些图像放置在服务器上,然后在活动开始时加载这些图像,但是为此,您需要互联网连接。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM