Reputation: 918
I have studied in a book that "In Android, an application can have zero or more activities. Typically applications have one or more activities...".
So what are the situations where an application can have "zero" activities? Is there any example of such an application?
Upvotes: 4
Views: 1201
Reputation: 19039
An Activity is just one of the Building Blocks of an Android Application.
For Example,Your 'Contacts' App is actually two apps - one with the Database(Content provider) and another with the UI (Activities)
You may check if the above is true by going into Settings->Applications>Installed
on your android phone/emulator
Check out the first few videos here to get a clear picture : http://marakana.com/s/android_bootcamp_series_2012_video_tutorial,1017/index.html
Upvotes: 2
Reputation: 25873
For example if you only define a Service
in an application, you don't need any Activity
.
Upvotes: 3
Reputation: 3370
When you are using some service
. Just take an example
of SoftKeyBoard
service demo provided by Android.
If you want to see, just open Eclipse File > New > Other > Android_Sample_Project > select version(2.2 o other) > SoftKeyboard >...
Upvotes: 2