I have a custom gallery in my app for which I'm using my own thumbnail directory. Here I'm caching the image thumbnail and storing it on my own sdcard directory and showing the thumbnail by loading it from custom image directory. It works well, but if it has more pictures it takes too long to load. Is there any way to load it faster and i don't use android's default thumbnail directory. | ||||
I guess you are loading them on the main thread. Try using an AsyncTask to load each thumbnail. First check if the thumbnail is cached and return it. If not - download, cache and return. | |||
Have you tried using something like Smart Image View? It already caches an image and save to external (in case you are trying to get an image from a server, for example). It also uses a thread pool executor, so you won't have problems with asynctask (like here). But smart image view is just an example, there are lot's of projects out there. | |||
You can also try ImageLoader Library. It caches images transparently with a two-level in-memory/SD card caching strategy. Images are fetched in a background thread, keeping your UI responsive. There is also great documentation and a demo application. | |||
You can use AsyncTask to load image in dynamic drawable faster as you want. | |||
default
.
stackoverflow.comm
No comments:
Post a Comment