What is the difference between broadcast receiver and a service?
Options
1) BroadReceiver - is like gateway for other components, can do small back ground functionality with in 10 seconds. Services - can do long running operation in the background with out having UI, and no time limit for it.
2) Service - is like gateway for other components, can do small background functionality with in 10 seconds. BroadcastReceiver - can do long running operation in the background with out having UI, and no time limit for it.
3) Option 1 is right, but both receiver and service both can interact with UI if they want to. Broadcast Receivers have time limit of 10 seconds, and they respond to broadcasted messages.
4) Option 1 is right, but a service can interact with UI if it wants. Its not mandatory that service should not have UI.
Options
1) It a component of android which responds to system wide broadcast announcements.
2) It acts like a gateway between outside world and your application.
3) both are true
4)none
Options
1) yes every thread by default will have looper
2) no only handler threads will have loopers
3) only handler threads will have loopers, but we can prepare normal threads looper also.
4) only main thread will have looper
How to avoid synchronization problems in threads?
Options
1) Use synchronized block
2) Use Synchronized methods
3) Use synchronized threads
4) both option 1 and 2 is right.
What is the difference between task, process, application, and thread?
Options
1) task, process, and application every thing is same, but thread is a part of process.
2) process and application are same. Task may contain 1 or more applications, thread is an internal part of a process created by OS.
3) process and task are same. application means program, thread is part of task.
4)process and thread are same. similarly application and thread are same.
What is the difference between thread and handler thread, in android?
Options
1) Thread will have looper and Message Queue. Default this looper will be prepared to handle incoming messages from other threads.
2) Handler thread will have looper and MessageQueue, but looper is prepared to handle incoming message.
3) Both are same. No difference, but HandlerThread is sub class of Thread class.
4) Both are same. No difference, But HandlerThread is super class of Thread class.
Every application will have by default one thread. True or false?
Options
1) false, by default no threads available for a given application
2) True, always any given application will have default one main thread.
3) True, but it is not always, some times it may not have any thread.
4) both 2 and 3
How to monitor service connection status in bound services?
Options
1) using isServiceConnected(), it returns true if service is connected
2) using onServiceDisConnected(), this function will be called if connection is broken
3) client can keep polling to service if it is available or not.
4) using ServiceConnection class.