Ideas:
1. Compress pictures
Compress local Pictures: get the ImageView you want to display, and set the appropriate insamplesize
Compress Network pictures:
A. HDD cache on/off direct download to SD card, then use local compression scheme
B. hard disk cache off, using Bitmapfactory.decodestream (IS, null, opts);
2. Picture Loading architecture
Picture compression loaded---put LRUCache----set to ImageView
1, a singleton, including a lrucache for managing our images;
2, Task queue, every time we load a picture request, we will encapsulate into a task to deposit our taskqueue;
3, contains a background thread, this thread is started the first time the instance initialization, and then will be running in the background; What about the task? Remember we have a task queue, there is a queue to save the task, someone has to work ah; So, when every time we load a picture request, we send a message to the background thread, the background thread to use the thread pool to Taskqueue to fetch a task execution;
4, scheduling strategy; 3 said that the background thread to Taskqueue to fetch a task, this task is not random, there are strategies to choose, one is FIFO, one is LIFO, I tend to the latter.
Android Custom Picture Loading frame