Why Is It Still Exciting?
What You Might Already Know
A Quick Glance
Before moving ahead, let’s take a quick look at some of the concepts and Remember, this is only a quick glance and we will detail many of these concepts later as we keep polishing our App.
Activities
Phenomenon that we will refer to, once we start working inside Android Studio to see how the magic happens.
You can think of activities as pages of your App – one page in your app corresponds to one activity.
An activity serves as a container for both the user interface and the code that runs it.
An Android application can consist of one or more activities.
Fragments
Every “page” in an Android application is a separate activity.
When the App is viewed on a phone’s small screen, it is not possible to list all tasks.
However, when on a tablet, it makes sense to let users see a list of tasks and edit them on the same page.
Android doesn’t allow you to put two activities on the screen at the same time. What to do?
The answer is Fragments. A Fragment is a part of an activity, which contributes its own UI to that activity.
Fragments are self-updating independent widgets
You can think of a fragment as a modular section of an activity, which has its own lifecycle and receives its own input events.
It can't exist independently and must always be part of an activity.
For example, when the activity is paused, so are all fragments in it, and when the activity is destroyed, so are all fragments. However, while an activity is running, you can manipulate each fragment independently, such as add or remove them.
Which of the following statements is true for activities and fragments?
Select the right answer
Activities nest inside fragments.
Fragments nest inside activities.
Activities and fragments are independent of each other.
Activities and fragments are not comparable items.
Intents
Intents make up the core message system that runs Android.
They are used to start activities and to communicate among various parts of the Android operating system.
An intent is composed of two elements:
1. The general action to be performed (such as view, edit, or dial) when the intent is received
2. The information that the action operates on, such as the name of a contact
Views
Views are a basic building block of Android user interface (UI).
A view, which is a basic element of the Android user interface, is a rectangular area of the screen that’s responsible for drawing and event handling.
Examples of some common views are TextView, ImageView, Layout, and Button.
A button is an example of _____________.
Select the right answer
A view
An activity
A fragment
An intent
Why Is It Still Exciting?
Android Development <="click"