Skip to content

Latest commit

 

History

History
42 lines (41 loc) · 2.33 KB

services.md

File metadata and controls

42 lines (41 loc) · 2.33 KB

Services Interview Questions

  1. What is a service in Android ?
  2. What is the purpose of Service?
  3. On what thread does the service gets executed ?
  4. Name different types of services in Android.
  5. How can we start a service ?
  6. What are started services in Android ?
  7. Describe the lifecycle of a service when applicatio starts.
  8. Describe the lifecycle of a service when user exits the application
  9. What are system services ? Can you name some of them ?
  10. How to communicate with an activity from a service ?
  11. What is a Forground Service ?
  12. What does inter-process communication mean ?
  13. What types of tasks are suitable for delegating to a service ?
  14. When the Android OS will kill the service ?
  15. What is the Android process model ?
  16. What is AIDL file and What does it do ?
  17. What is the purpose of ServiceConnection class ?
  18. What is the difference between startService() and startForegroundService() ?
  19. What is an IntentService ?
  20. On what thread does the IntentService gets executed on ?
  21. How would you pass data to an IntentService ?
  22. How can we make the AlarmService run forever even after device reboot
  23. What is an alarm service and explain it’s need with real-world example
  24. How can we make the AlarmService run forever even after device reboot ?
  25. What is the difference between startService and bindService ?
  26. How to pass a callback to a bounded service using AIDL structure ?
  27. What does oneway mean in AIDL syntax ?
  28. What does in mean in AIDL syntax ?
  29. How does IntentService works under the hood ?
  30. Will invoking unbindService() stops a bound service ?
  31. Can a service start an activity and vice versa ?
  32. Can we show a dialog from a service ?
  33. Can we send a broadcast message from a service ? How about registering a broadcast receiver ?
  34. Can we inflate a layout from a service ?
  35. Can we load resource values from a service ?
  36. Design a music player that shows a now-playing notification, with pause, stop and resume buttons, using a service.
  37. How to make a service run in another process rather than the activity process ?
  38. How to start or bind to a service that is running in another process ?
  39. Design an application with an exported bound service, which other applications can bind to.
  40. How to protect an exported bound service with custom permission ?