Within an Android application the following main components are distinguished:
- Activities are components that interact with the user.
- Services are components that run in the background mode.
- Broadcast Receivers enable reception of intents from the system or other applications without running other activities or services of the application.
- Android Remote Interface.
The creation procedure is identical for all types of components. Upon creation, a class that implements the component is created and the new component is automatically declared in the AndroidManifest.xml file.
- In the Project view, right-click the destination package where the application classes are stored.
- On the context menu, click Android Component on the submenu. , then choose
- In the New Android Component dialog box that opens, specify the following:
- In the Name text box, type the name of the class that implements the component.
From the Kind drop-down list, choose the desired component type:
- Broadcast Receiver
- Android Remote Interface
- In the Label text box, type the component title to be displayed to the user.
- If no title is specified, the label assigned to the entire application will be displayed.
- No label is specified for a remote interface.
- For an Activity, select the Mark as startup activity check box to have the activity displayed by default when the application starts.