Android questions asked at Mindtree
- What are the callback methods in activity life cycle?
- Activity A calls activity B; When you return from B to A, what is sequence of callback methods?
- What are content provider?
- How do you make a query using content provider? What are the major input to passed to the API?
- What are the parameters required to make an update statement?
- How to create a new DB in android?
- Difference between DVM and JVM?
- What is major update in DVM over years of android evolution to improve its speed?
- What is ART ?
- List APIs to connect a Rest Webservice?
Experience at Huawei
- How many instances of a service can available simultaneously by default ?
- When you use
bindService
yourService
is created and tied to the lifecycle of yourActivity
. That means when yourActivity
is destroyed, so is yourService
.If you want yourService
to remain started you must first callstartService(Intent)
. You could for example call this in your applicationsonCreate()
.After that, you can still bind to yourService
and when you unbind it will remain started until Android decides to kill your process or if you callstopService(Intent)
orstopSelf()
from somewhere in your code.For better results, and having uninterrupted music playback you should set yourService
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
- What will happen when finish() method is called in onCreate() of activity?
1 comment:
Good initiative
Post a Comment