Search code examples
androidbackground-imagepicasso

Background Image gets blurry when loaded into LinearLayout - Android


I have a background image with 4 diff dpi placed in different folders.

  • drawable-xxhdpi contains 1630x1052
  • drawable-xhdpi contains 970x609
  • drawable-hdpi contains 603x402
  • drawable-mhdpi contains 450x290

And here is the full resolution image: Original Image

But When I view this image in Android Application using mobile or tablet it becomes blurry as shown below.

Background Image in Android

I am loading this image using Picasso:

Picasso.with(drawFigure.this).load(R.drawable.back)
.memoryPolicy(MemoryPolicy.NO_CACHE)                 
.networkPolicy(NetworkPolicy.NO_CACHE).into(mCustomLayout);

Please correct me if anyone finds any mistake. Else, is there any any other way to show perfect image. Regards!


Solution

  • Try following

                           ldpi     mdpi     hdpi    xhdpi    xxhdpi       xxxhdpi
    Launcher And Home      36*36    48*48   72*72    96*96    144*144     192*192
    Toolbar And Tab        24*24    32*32   48*48    64*64    96*96       128*128
    Notification           18*18    24*24   36*36    48*48    72*72       96*96 
    Background             240*320  320*480 480*800  768*1280  1080 *1920  1440*2560