How your app handles threads and processes has a significant impact on your app's performance. By default, when the user launches an app, the Android system creates a single thread of execution for that application. All components run in this single thread, which is known as the main thread or the UI thread.
Unless you specify otherwise, most of the operations you perform in your app run in the foreground on this main thread. Most of the time this single-thread model works fine, but if your app needs to perform particularly intensive work or long-running operations, then the main thread can become blocked. This can cause your app to freeze, display system errors, and potentially even crash.
If you're going to deliver a good user experience, then it's vital you don't block the UI thread with intensive or long-running operations. If you do need to run demanding processes, then you should create additional threads.
This involves specifying which process a certain component...