Jul.11
Interview: Android – Thread
Question: What is Asynchronous Programming?
Asynchronous programming is a form of parallel programming in which a unit of work runs separately from the main application thread and notifies the calling thread of its completion, failure or progress.
Question: What is Functional Programming?
Functional programming is a process of constructing software by composing pure functions. It avoid concepts of shared state, mutable data and other side-effects. It emphasize on expressions and declarations rather than execution of statements.
Question: What is the difference between AsyncTask and AsyncTaskLoader?
We use AsyncTask class to implement an asynchronous, long-running task on a worker thread. Worker thread is any thread which is not the main thread. AsyncTask uses local context and it destroys itself upon screen orientation changes.
AsyncTaskLoader is equivalent of AsyncTask. But it uses application context. Upon completion, results are automatically delivered to the main thread. Change of screen orientation doesn’t effect AsyncTaskLoader.
Question: What is IntentService?
IntentService is a base class for Services that handle asynchronous requests on demand. IntentService performs certain task in the background and once done, the instance of IntentService terminate itself automatically.
Question: What is RxJava?
RxJava is a Java VM implementation of ReactiveX (Reactive Extensions): a library for composing asynchronous and event-based programs by using observable sequences.