0

I'm going to develop an application which shows a ListView which each row have a seperate image (like personal picture for contacts list). It seems I have two options:

1- Store all images in Asset Folder and load image using setImageDrawable() command.

2- Store all images in Drawable Folder and load theme using setImageResource(R.drawable.xxx)

So my questions is does they differ in performance? And how can I speed up listView rendering such that images displayed in acceptable speed.

Community
  • 1
  • 1
VSB
  • 9,825
  • 16
  • 72
  • 145
  • If you have to load a large number of images ,it would be better to store the images on a server and load the images from server and cache them to stop reloading images everytime – user5894647 Jun 05 '16 at 11:13
  • @user5894647 Thanks for notice. I think I should use libraries like UnivrsalImageLoader for this purpose. – VSB Jun 05 '16 at 11:27
  • yup you may also use picaso or glide libraries also because they come with inbuilt image caching – user5894647 Jun 05 '16 at 11:29

2 Answers2

0

There should not much performance different to access image from Drawable or asset folder. You can see the answer too - > Android: Accessing images from assets/drawable folders

But, When you using ListView you are recreating the view . So, Where ever you store the image all the images are will not feel much different .

Community
  • 1
  • 1
Zahidul Islam
  • 3,180
  • 1
  • 25
  • 35
0

There are not so much differences. Just for coding pattern changes.

assets/

Bitmap files (.png, .9.png, .jpg, .gif) or XML files that are compiled into the following drawable resource.

drawable/

Arbitrary files to save in their raw form. To open these resources with a raw InputStream, call Resources.openRawResource() with the resource ID, which is R.raw.filename.

https://developer.android.com/guide/topics/resources/providing-resources.html#ResourceTypes