Hello i am developing an application that downloads images from the internet asynchronous and after that it shows them in a Gridview. I am using a HashMap that stores the images and i don’t store them in the sd card or somewhere else except the hashmap because i want to leave this option to the user. I have two questions.
1) i want to show an image in a full screen after it has been clicked and in the best case to pass all the images in the new fullscreen activity which is an imageswitcher starting showing images from the selected image and switching between the others. how can i do this? is it good solution to use a hashmap method to get the hashmap in the new activity or it is fatal for the memory?
2) how can i download all the images and bind them with every imageview in the gridview? i mean that i want all images to get download in the beginning and not only when the getview is called.
Sorry for my english!
Hello i am developing an application that downloads images from the internet asynchronous and
Share
You will want to save the images to a disk cache.
You don’t have a ton of memory to work with Bitmaps on Android devices. Your app may have as little as 16MB total on some devices. So if you are storing all of them in memory you will quickly run out of memory.
Once saved to disk, decode them to memory as needed. You can use an in memory LRU cache to have the last 10 or so in memory pre-decoded.
Start by reading: http://developer.android.com/training/displaying-bitmaps/index.html