Should i use AsyncTask to load and scale photos from external storage? or there is easier way to do it? Main reason why im trying to do this is becouse im getting lag when scrolling my listview. Im displaying and scaling photos using its path.
Asked
Active
Viewed 67 times
-1
-
3you can use [picasso](https://github.com/square/picasso) or [universal image loader](https://github.com/nostra13/Android-Universal-Image-Loader) for easier implementation and better performance. – Mohammad Rahchamani Nov 27 '14 at 21:20
-
At least read the training material: http://developer.android.com/training/improving-layouts/smooth-scrolling.html – Morrison Chang Nov 27 '14 at 21:24
-
but picasso and universal image loader is used to upload images from internet and i uploading images from external storage – LeTadas Nov 27 '14 at 21:27
-
`load and scale bitmap from external storage?` You should provide **pre-scaled bitmaps** in your `drawable` folders. – Phantômaxx Nov 27 '14 at 21:28
-
My app is uploading photos from gallery to listview why should i put them to drawable if i can scale them on upload? – LeTadas Nov 27 '14 at 21:46
-
you probably missunderstanded im uploading photo using its path – LeTadas Nov 27 '14 at 22:21
-
1universal image loader can load directly from files: https://github.com/nostra13/Android-Universal-Image-Loader#acceptable-uris-examples - picasso can load images from files too: http://stackoverflow.com/questions/24097576/how-to-load-image-from-sd-card-using-picasso-library – zapl Nov 27 '14 at 22:45
1 Answers
1
Yes.
It can be a long running task if the photo has a lot of detail. Be careful when dealing with detailed photos on Android, you can run out of memory.
Use the Async Task or Thread to process the photos, but keep the user notified at all times, with a progress bar or notification.

mthandr
- 3,062
- 2
- 23
- 33