monika kapil
monika kapil

Reputation: 31

How to use single drawable folder in android

How to use single drawable folder for all images by which apk size can be reduced ,I have seen many posts but every post says that its necessary to use all folders(hdpi,ldpi...etc).Is their any way to use single folder and get good quality images

Upvotes: 1

Views: 461

Answers (6)

Avinash Verma
Avinash Verma

Reputation: 2762

Put the Image in Drawable Folder. It will use the Same image for All Devices. But Quality will vary for Devices to device. The image may get Blur as Big Screen increase the width and height of images.

Upvotes: 0

Dixit Panchal
Dixit Panchal

Reputation: 3436

Leave Eclips and Start with Android Studio will provide this facility.

Upvotes: 0

ALI RAZA
ALI RAZA

Reputation: 33

if you want to reduce apk size then i will suggest you to place images on server and call them using RestApi. after getting all the json data by calling RestApi you will get the imageurl. here is the link Picaso Image Loader you can load image on ImageView from url by using Picaso Image Loader. all the details are mentioned in link.

Upvotes: 0

UserName_Untold
UserName_Untold

Reputation: 165

Different drawable folders are used for a purpose, i.e when you want your app to be compatible across number of devices. There will not be any issue even when you use a single folder for all images, but when u test or run the app across number of devices you can see that sometimes the image is big and sometimes small.

So its always advisable to create multiple folder so that you'll get the perfect image for that resolution device.

Upvotes: 3

Dong Wang
Dong Wang

Reputation: 344

  1. you can use drawable in xml such as shape. It's only use drawable folder.
  2. If you want use only one folder, then you can chose the xhdpi or xxhdpi folder. Zoom in bitmap is better than the zoom out bitmap when it display on Android device.
  3. .9.png is recommanded. It can use only in drawable folder.

Upvotes: 0

Related Questions