- UI components, such as TextView, Buttons, etc.
Viewobject.
- Containers controlling how their child views are positioned.
ViewGroupobject.
Defines position of each view based on sibling and parent view constraints. This is the preferred method for creating responsive views.
Every widget is placed relatively to the layout and other widgets.
Contains all your UI strings. File is called strings.xml.
A linear group of views with bidirection constraint. You can use it to evenly space views out.
The width of a view expands to meet the definition of the horizontal constraints. The width of the textbox fills the horizontal space after all margins are accounted for.
Activity: Create a UI that contains a text box and a button. When the user clicks the button, the text box string must be displayed on the next page. Code a back button on the next page. The following rules apply:
- Must use
ConstraintLayout. - The top margin must be 16 DP. The left margin of the text box and the space between the text box and the button must be 16 DP. The left margin of the button must be 16 DP.
- Constrain the text box and button widgets in a horizontal alignment (Hint: use baselines).
- Make the text box responsive to the width of different screen sizes (Hint: use chaining).
- The text view in the second activity must be centralized.
- Assign a string value to the text box and button via the string resource file.
- A message that activates broadcast receivers, activities and services.
- Binds individual components to each other at runtime.
- For activities and services - Intent defines the action to be performed. Eg. View or send something.
- Broadcast receivers - Defines announcement being broadcast.
- Activity - Entry point for interacting with the user. Eg. A screen with a UI.
- Services - Keeps an app running in the background for all kinds of reasons. Eg. An app that fetches data over the network without blocking user interaction. There are 2 types of services: Started and Bound services.
- Broadcast receivers - Delivers events to the app, outside of a regular user flow. System can deliver broadcasts, even if app is not running. Eg. An app can schedule an alarm to post a notification. The app does not have to be running.
- Content providers - manages a shared set of app data that you can store in the file system, SQLLite, web or persistant location. Eg. The system provides a content provider for managing contact information. Any app with proper permission can access the content provider.
- Instead of developing a camera app, you can use the component of the Android's built-in camera app.
- From App B, you can start the activity from App A.
- When completed, the photo is returned to App B.
- Declares all components.
- - Elements for activities.
- - Elements for services.
- - Elements for broadcast receivers.
- - Elements for content providers.
