android in practice_Threads and concurrency
2012-12-28 11:29
471 查看
you can run services in separate processes, but that isn’t a requirement. In fact, unless you specify a process ID explicitly, they won’t.
one golden rule about user interfaces is to always remain responsive.
When launching your application, Android will spawn a single system process running a single thread of execution.this thread is called the main application thread,
main user interface thread, or UI thread.
![](http://img.my.csdn.net/uploads/201212/28/1356665597_9249.jpg)
Writing code like this may freeze your application—Android can’t continue drawing your application’s user interface until the download completes because both download and UI code run in the same thread.
Any non-blocking or fast operation is fine to execute on the main application thread that’s running when an application starts. Anything else should be executed on a different thread.
one golden rule about user interfaces is to always remain responsive.
When launching your application, Android will spawn a single system process running a single thread of execution.this thread is called the main application thread,
main user interface thread, or UI thread.
![](http://img.my.csdn.net/uploads/201212/28/1356665597_9249.jpg)
Writing code like this may freeze your application—Android can’t continue drawing your application’s user interface until the download completes because both download and UI code run in the same thread.
Any non-blocking or fast operation is fine to execute on the main application thread that’s running when an application starts. Anything else should be executed on a different thread.
相关文章推荐
- 《Java Concurrency in Practice》ch11 Performance and Scalability
- 4 ways to do concurrency in Java: Threads, Executors, ForkJoin and Actors
- Processes and Threads in android
- java concurrency in practice读书笔记---ThreadLocal原理
- Java Concurrency in Practice中对象锁重入问题的理解
- Java Concurrency In Practice
- 《Java Concurrency in Practice》之Volatile variables
- Creating and deleting threads dynamically in eCos
- [Android-Camera] If there is no flash setting option in Android stock camera apk, find the code and change it.
- android in practice_Communicating with a Service (portfolio project)
- Android 进程 和 线程 Process and Threads
- Java Concurrency In Practice - Chapter 1 Introduction
- android in practice_Basic threading(simpleImageDownload project)
- Support for EAP-SIM and EAP-AKA in Android.
- A2DP Sink, AVRCP Controller and HFP Client in Android L
- 【Android】Do not requestWindow.FEATURE_SUPPORT_ACTION_BAR and set windowActionBar to false in your th
- Java Concurrency in Practice 读书笔记 第十章
- [Java Concurrency in Practice]第六章 任务执行
- Java theory and practice: More flexible, scalable locking in JDK 5.0
- Android:Bundles in Activities and Fragments