What is Activity?
Activity is entry point of an application. It provides user interface so that user can perform actions as well as view data.
To create activity you need to extend Activity or AppCompatActivity.
What is Context?
Context is an abstract class which has information related to application environment whose implementation is provided by Android system.
It provide access to application-specific resources and classes and application-level operations like lunching activity, broadcasting etc.
What are the android application Components?
There are 4 application components:
- Content Provider
Android OS Versions, OS Name and API Level
|OS Version||OS Name||API Level|
|2.3||Gingerbread||9 and 10|
|3.1 and 3.3||Honeycomb||12 and 13|
|4.0||Ice Cream Sandwich||15|
|4.1, 4.2 and 4.3||Jelly Bean||16, 17 and 18|
What is Intent and its type?
Intent is used for communication between different application component also it is a messaging object. It can be used to start activity/service or delivering broadcast.
There are two types of intent :
- Implicit Intent: Type of intent which is used to start component of same application by using full qualified class name is known as explicit intent.
- Explicit Intent: Type of intent which is used to start component from other/same application by broadcasting action is known as implicit intent.
Life-cycle of Activity?
What is fragment and it’s life-cycle?
Fragment provides portion of user interface after hosting by an activity. It also provides reusable user interface.
Fragment has its own life-cycle which is synced with activities life-cycle.