Interview questions - Android


Android questions asked at Mindtree

  1. What are the callback methods in activity life cycle?
  2. Activity A calls activity B; When you return from B to A, what is sequence of callback methods?
  3. What are content provider?
  4. How do you make a query using content provider? What are the major input to passed to the API?
  5. What are the parameters required to make an update statement?
  6. How to create a new DB in android?
  7. Difference between DVM and JVM?
  8. What is major update in DVM over years of android evolution to improve its speed?
  9. What is ART ?
  10. List APIs to connect a Rest Webservice?
Experience at Huawei
  1. How many instances of a service can available simultaneously by default ?
    • When you use bindService your Service is created and tied to the lifecycle of your Activity. That means when your Activity is destroyed, so is your Service.
      If you want your Service to remain started you must first call startService(Intent). You could for example call this in your applications onCreate().
      After that, you can still bind to your Service and when you unbind it will remain started until Android decides to kill your process or if you call stopService(Intent) or stopSelf() from somewhere in your code.
      For better results, and having uninterrupted music playback you should set your Service to run in foreground mode (see this).
      Keep in mind that it will STILL be possible for Android to kill your process and stop the music playback, but if you are in foreground mode the chances are very very slim.
    • ReadMore
  2. What will happen when finish() method is called in onCreate() of activity? 

1 comment:

Post a Comment