Question

Describe in detail the process for maintaining a list of items on an activity layout. Discuss...

Describe in detail the process for maintaining a list of items on an activity layout. Discuss each of the components used. Be sure to discuss how data is bound to a list with a custom layout .. Android Studio

Homework Answers

Answer #1

Explanation::

An activity is nothng but asingle screen of user interface like a window. While Building an App in Android studio it is one of the crucial component. Activities are launched and they are put together is the fundamental part.

A layout defines the structure for the user interface in the app.

The layout for the list item has been kept in a separate layout file so that the adapter can create view items and can edit their contents independently from the layout of Activity.

In other programming languages the apps are launched using main() method but in android studio initiates the code in Activity instance using various callback methods which are included in lifecycle stages.

Activity serves as an entry point to the application for the user. One activity implements one screen and one activity can loosely coupled with the other activities in an application.

Intent filters provides the ability to launch the activities.

Managing the process or maintaining the items include the activity lifecycle in which activity goes through series of steps:

OnCreate() : when system Creates activity our app should create views and bind data to lists where this method gets in the use.

OnStart() :The activity is visible to the user as soon as OnCreate() exits in this state.

OnResume(): when the activity starts interacting with users this callback occurs.

OnPause(): When the activity is going to loose its focus or loosed its focus then OnPause() callback is called. After this callback eighther the Onstop or onResume gets called.

OnStop(): When the activity is no longer visible to the user then this callback occurs.

OnRestart(): OnRestart() can restores the state of activity in which it was resumed or stopped.

OnDestroy():This system invokes this callback before the activity is destroyed.It ensures that all the resources are released.

The four main components used in application are:

Activities,Services,Broadcast Receivers,Content providers.

Activities handles the UI part which is going to interact with users.

Services mainly handles the background process running in the app.

Broadcast receivers handles the communication between Application and operating system.

content providers deals with database managment issues.

The easiest way to display information to the users can be dne via ListView Component.

Unique set of information in scrollable region can be seen via ListView.

We can create our own data layout using ListViews.

ArrayAdapter are used to manage the data for the ListView. i.e via The adapter is assigned to the ListView via the setAdapter method on the ListView object.

ArrayAdapther class allows removes all lemets in underlying data structure.

The Data Binding Library is a support library that allows us to bind UI components in our layouts to data sources in the app using a declarative format rather than programmatically.

Layouts are often defined in activities with code that calls UI framework methods.

The Data Binding Library automatically generate the class which are going to required to bind the views inside the  layout with data objects. The library provides features :imports, variables, and includes that we can use in our layouts.

While creating and binding custom layout we need to perform the steps:

  1. Extend class from viewGroup class.
  2. Override OnLayout method
  3. Override OnMeasure method(it will be used to determine the size of viewGroup)
  4. OnMeasure and OnLayout method will organize child views within parent Layout.

I hope this will help you,If not please comment below i will help you.

Please do not foorget to Upvote the answer!!

Happy Learning.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
In detail describe the influence of nationalism on the 20th century. List and discuss all major...
In detail describe the influence of nationalism on the 20th century. List and discuss all major events that occurred in the 20th century that were affected by nationalism, starting with WWI and ending with decolonization.
Describe the anatomical position in detail, including positions of hands/feet. Describe the coronal, transverse, axial, sagittal,...
Describe the anatomical position in detail, including positions of hands/feet. Describe the coronal, transverse, axial, sagittal, lateral, midline, and midsagittal planes. What is the difference between ligaments and tendons? List the components of the axial skeleton and name each bone. List the components of the appendicular skeleton and name each bone. What are the five sections of the spinal column, from superior to inferior, and list how many vertebrae are in each section. What are the first two cervical vertebrae...
Describe in detail the classical conditioning components involved in smoking. Discuss how spontaneous recovery can cause...
Describe in detail the classical conditioning components involved in smoking. Discuss how spontaneous recovery can cause the reoccurrence of a smoking habit.
Describe the circular flow of the Economy. Also describe in detail how each of the resources...
Describe the circular flow of the Economy. Also describe in detail how each of the resources is used in the productive process. What do the owners of the resources receive in payment?  
from the book "The Handmaid's Tale", List and describe in detail the different gender roles we...
from the book "The Handmaid's Tale", List and describe in detail the different gender roles we see in the book. Then, discuss what those roles say about the values and beliefs of society? How do those roles allow society to function? Who benefits? Who sacrifices? EXPLAIN BRIEFLY.
1) Please post an original macromolecule You will list 6 items; 2 lipids, 2 Carbs, 2...
1) Please post an original macromolecule You will list 6 items; 2 lipids, 2 Carbs, 2 proteins. We won't list Nucleic Acids, since there are only two; DNA and RNA.   List 2 Lipids. 1 must be a food and 1 must not be a food. Describe in detail what the non-food lipid does/its purpose and how it functions. List 2 Proteins. 1 must be a food and 1 must not be a food. Describe in detail what the non-food protein...
1. Describe the cycle of obtaining merchandise. Include the process from ordering through paying for the...
1. Describe the cycle of obtaining merchandise. Include the process from ordering through paying for the merchandise. Identify forms prepared for each phase of the cycle including possible ways items may be received and ways in which payments may be made. 2. Discuss the purpose of the trial balance and what the organization uses it for. What individuals would be the users of the trial balance in an organization? go into detail
Discuss in detail how Trimeric G-protein signaling pathways would be influenced by the following: A)Please describe...
Discuss in detail how Trimeric G-protein signaling pathways would be influenced by the following: A)Please describe the molecular switches that are applied in G-protein coupled receptor signaling pathways, and compare the molecular switches in detail. B)Consider cells injected with a small molecule that blocks the association of the G-Protein Coupled-Receptor with its Trimeric G-protein: -What would be the effect of this small molecule on the activity of the Trimeric G-proteins in this cell? -Why? Be specific about how the receptor...
Discuss how a nursing diagnosis guides the nursing practice. Describe how the diagnostic process includes critical...
Discuss how a nursing diagnosis guides the nursing practice. Describe how the diagnostic process includes critical analysis and interpretation of assessment data that reveal a patient’s response to health problems, identification of patient needs, and formulation of nursing diagnoses.
1. Describe two mnemonic devices that would enable you to remember the following list of grocery...
1. Describe two mnemonic devices that would enable you to remember the following list of grocery items: milk, eggs, margarine, oranges, rhubarb, ice cream, eggplant, and sausage. Explain why each would be effective. 2. Describe several heuristics that you might use or that you have used when deciding whether you should (a) study especially hard for a test and (b) ask someone for a date (or accept a date). Under what circumstances are these heuristics likely to contribute to poor...