Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Increasing the PNG quality in Android

I am a beginner in Android Development and am trying to understand how to use PNG or vector drawable (XML) files in my Android App. To practice, I create an App with both images below:

https://imgur.com/RWxaMGt (link to see the res repository)

The purpose was to compare the quality of both structures. The result can be viewed below:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

https://i.imgur.com/jMgmsc5.png (link to see the result in the device emulator)

In my device, the image above represents a PNG file while the other (the image below with better quality) represents the vector drawable file.
My question is simple: is there some way to increase the quality of the PNG file in my device activity?
Note: I am using Kotlin and a simple ConstraintLayout

>Solution :

for shwoing high qualitu image you have to choose higher quality image but have to do following for loading that image in all types of devices.

suppose you have a png image

  1. You have to choose the higher quality image for import like 1920 x 1080.

  2. then You have to use batch drawable importer to import that image into your android studio project

  3. it will create appropriate versions of that high-quality image to show on different devices.

  4. use Glider for loading images it will show images effectively.

here is link for how to use batch drawable importer:

https://youtu.be/toHF8fOceoc

https://akexorcist.dev/android-drawable-importer-plugin/

it will create folders and images of all sizes

xxxhdpi: 1280x1920 px
xxhdpi: 960x1600 px
xhdpi: 640x960 px
hdpi: 480x800 px
mdpi: 320x480 px
ldpi: 240x320 px
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading