An android component is simply a piece of code that has a well defined life cycle e.g. Activity, Receiver, Service etc.
The core building blocks or fundamental components of android are activities, views, intents, services, content providers, fragments and AndroidManifest.xml.
Activity
An Activity is an application component that provides a screen with which users can interact in order to do something, such as dial the phone, take a photo, send an email, or view a map. Each activity is given a window in which to draw its user interface. The window typically fills the screen, but may be smaller than the screen and float on top of other windows.
View
A view is the UI element such as button, label, text field etc. Anything that you see is a view.
Intent
An Intent is a messaging object you can use to request an action from another app component.
Intent is used to invoke components. It is mainly used to:
Intent intent=new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse("http://www.javatpoint.com"));
startActivity(intent);
Service
A Service is an application component that can perform long-running operations in the background and does not provide a user interface. Service is a background process that can run for a long time.
Content providers manage access to a structured set of data. They encapsulate the data, and provide mechanisms for defining data security. Content providers are the standard interface that connects data in one process with code running in another process.
A Fragment represents a behavior or a portion of user interface in an Activity. You can combine multiple fragments in a single activity to build a multi-pane UI and reuse a fragment in multiple activities.
It contains informations about activities, content providers, permissions etc. It is like the web.xml file in Java EE.
Android Virtual Device (AVD)
It is used to test the android application without the need for mobile or tablet etc. It can be created in different configurations to emulate different types of real devices.
The core building blocks or fundamental components of android are activities, views, intents, services, content providers, fragments and AndroidManifest.xml.
Activity
An Activity is an application component that provides a screen with which users can interact in order to do something, such as dial the phone, take a photo, send an email, or view a map. Each activity is given a window in which to draw its user interface. The window typically fills the screen, but may be smaller than the screen and float on top of other windows.
View
A view is the UI element such as button, label, text field etc. Anything that you see is a view.
Intent
An Intent is a messaging object you can use to request an action from another app component.
Intent is used to invoke components. It is mainly used to:
- Start the service
- Launch an activity
- Display a web page
- Display a list of contacts
- Broadcast a message
- Dial a phone call etc.
Intent intent=new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse("http://www.javatpoint.com"));
startActivity(intent);
Service
A Service is an application component that can perform long-running operations in the background and does not provide a user interface. Service is a background process that can run for a long time.
- There are two types of services local and remote. Local service is accessed from within the application whereas remote service is accessed remotely from other applications running on the same device.
Content providers manage access to a structured set of data. They encapsulate the data, and provide mechanisms for defining data security. Content providers are the standard interface that connects data in one process with code running in another process.
- Content Providers are used to share data between the applications.
A Fragment represents a behavior or a portion of user interface in an Activity. You can combine multiple fragments in a single activity to build a multi-pane UI and reuse a fragment in multiple activities.
- Fragments are like parts of activity. An activity can display one or more fragments on the screen at the same time.
It contains informations about activities, content providers, permissions etc. It is like the web.xml file in Java EE.
Android Virtual Device (AVD)
It is used to test the android application without the need for mobile or tablet etc. It can be created in different configurations to emulate different types of real devices.
0 comments:
Post a Comment