android-Multithreading and Asynchronous Overview
multithreading in a Java
Runable
Thread
Threadpoolexector
Scheduleexector
Thread synchronization
Synchronized synchronization
Lock locks
Semaphore Signal Volume
two using multithreading in Android
1, why use multithreading
IO operations: File, network, database
Complex operations
Timed operation
For time-consuming operations, it should be run on a non-main thread to avoid blocking the main thread
To ensure a good user experience,
Recommended for more than 50ms (1000ms/50ms = 20FPS for the human eye to see the smooth picture of the minimum number of frames)
Operations are handled using threading
2, how to use multi-threaded or asynchronous, used classes
Thread
Handle
Asynctask
Asynctaskloader (used after Android 3.0)
(Cursorloader)
3, multithreading and interface interaction in the way that used to the class
Activity.runonuithread (runable)
View.post (runable)
View.postdelay (runable, long)
Handle
Asynctask
4,android UI Main thread simple principle
Do not block UI Thread
Do not manipulate the UI directly outside the UI thread
Precautions :
Async equals Multithreading
Android does not allow the UI to change directly in multiple threads
Interview questions:
1,android How is multithreading implemented?
Threads and thread pools to implement
What are the ways to implement 2,android asynchronous tasks?
Asynctask
Asynctaskloader
3,android How to ensure thread safety of the UI?
Any code that operates the UI is placed in the UI thread
Copyright NOTICE: Welcome to Exchange, QQ872785786
android-Multithreading and asynchronous overview and face questions