Options
1) Implement your own custom View by extenting View class, and then implement onDraw method in it.
2) Take any UI control like ImageView, and draw image using canvas.
3) it is not possible to directly touch Canvas.
4) both option 1 and 2 are right
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
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.
How to pass data from activity to service?
Options
1) pass data in intent-putextras, and using setResult()
2) pass data in intent-putextras, and say startService() with that intent
3) store it in common database and access it through both activity and service.
4) can be done using both the ways 2 and 3 options.
Is it possible to have a service with multiple threads in it? How to achieve this?
Options
1) you can't have more than one thread in a service.
2) you can create multiple threads in a service
3) option 2 is possible by creating thread in onCreate()
4) option 2 is possible by creating thread in onStartCommand() of your service class.
How to update UI from a service that has threads?
Options
1) Create a thread in the Service class and directly access UI components of your activity
2) Since updating UI from other thread directly is not possible, communicate with Main UI thread for the UI updates
3) Use Intent Service
4) Either use option 1 or option 2
How to create a service with multiple threads in it?
Options
1) Create a service with creating thread in onStartCommand
2) Use Intent Service
3) Create a service with one thread in OnCreate().
4) Either use option1 or use Async task with service