Android Topics Lab 5 Part II

Slides:



Advertisements
Similar presentations
Application Fundamentals. See: developer.android.com/guide/developing/building/index.html.
Advertisements

Cosc 4730 Android TabActivity and ListView. TabActivity A TabActivity allows for multiple “tabs”. – Each Tab is it’s own activity and the “root” activity.
Mobile Programming Lecture 1 Getting Started. Today's Agenda About the Eclipse IDE Hello, World! Project Android Project Structure Intro to Activities,
CS5103 Software Engineering Lecture 08 Android Development II.
Chapter 9: Customize! Navigating with Tabs on a Tablet App.
Chapter 2: Simplify! The Android User Interface
Basic Android Tutorial USF’s Association for Computing Machinery.
CS378 - Mobile Computing Intents.
Frank Xu Gannon University.  Linear Layout  Relative Layout  Table Layout.
Chapter 2 The Android User Interface. Objectives  In this chapter, you learn to:  Develop a user interface using the TextView, ImageView, and Button.
CS378 - Mobile Computing Intents. Allow us to use applications and components that are part of Android System – start activities – start services – deliver.
Create Navigation Drawer Team 2 Zhong Wang Jiaming Dong Philip Wu Lingduo Kong.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 7: Reveal! Displaying Pictures in a GridView.
Android Boot Camp for Developers Using Java, 3E
Chapter 7: Reveal! Displaying Pictures in a Gallery.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 2: Simplify! The Android User Interface.
UI Design and Development +Roman Nurik +Nick Butcher.
ANDROID – DRAWING IMAGES – SIMPLE EXAMPLE IN INTERFACE AND EVENT HANDLING L. Grewe.
NOAA Weather Patrick Wolfram. What it does Allows user to specify a zip code Performs HTTP GET requests on noaa.gov for the specified zip code Displays.
Copyright© Jeffrey Jongko, Ateneo de Manila University Custom ListAdapters.
HW#9 Clues CSCI 571 Fall, HW#9 Prototype
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
Mobile Computing Lecture#12 Graphics & Animation.
Building User Interfaces Basic Applications
David Sutton USING CONTENT PROVIDERS. TOPICS COVERED THIS WEEK  Persistence  Introduction to databases  Content providers  Cursors  Cursor adapters.
CHAPTER 4 Fragments ActionBar Menus. Explore how to build applications that use an ActionBar and Fragments Understand the Fragment lifecycle Learn to.
Database Programming Code Dissection. Layered Approach Presentation (Activity) DbSampleActivity.java DataAccess (DataSource) CommentsDataSource.java MySQLiteHelper.java.
Chapter 2: Simplify! The Android User Interface
Open Handset Alliance.
Android Programming Lecture 3.
Customizaiton of Layouts
Android Widgets 1 7 August 2018
Creation of an Android App By Keith Lynn
Mobile Application Development Chapter 4 [Android Navigation and Interface Design] IT448-Fall 2017 IT448- Fall2017.
Sensors, maps and fragments:
Free Microsoft Exam Study Material - Dumps4download.in
Android Introduction Camera.
CS323 Android Model-View-Controller Architecture
Android Programming Lecture 6
Android Layout Basics Topics
CIS 470 Mobile App Development
CS323 Android Getting Started
ANDROID LISTS.
Tip Calculator App Android How to Program
Many thanks to Jun Bum Lim for his help with this tutorial.
Explain the difference between a species and a population
Favorite Twitter Searches App
Building User Interfaces Basic Applications
Android Topics Custom ArrayAdapters
CS323 Android Topics Network Basics for an Android App
Android Topics Custom ArrayAdapters Creating an Event Listener
Android Developer Fundamentals V2
Android: Shapes.
Android Topics Threads and the MessageQueue
Android Topics Limited Resources and why we need to consider them.
Android Developer Fundamentals V2
HNDIT2417 Mobile Application Development
Favorite Twitter Searches App
CIS 470 Mobile App Development
Android SDK & App Development
ListView ? BaseAdapter ?.
Title Layout Subtitle.
Korea Software HRD Center
Title Layout Subtitle.
Title Layout Subtitle.
CS 240 – Advanced Programming Concepts
Title Layout Subtitle.
Android Sensor Programming
Presentation transcript:

Android Topics Lab 5 Part II Build an app containing a Scrollable Contact List Dynamically populate the list with 20 friend (family) contacts

App Structure Add the drawable Resources.

Build the Layouts friend_layout.xml: contact_item.xml: Scrollable Contains an internal LinearLayout TIP: Research ScrollView contact_item.xml: LinearLayout

friend_layout.xml: The main activity layout. components ScrollView LinearLayout Root View Internal LinearLayout that will hold a list of contacts.

contact_item.xml: The visual display of a contact. components LinearLayout ImageView LinearLayout TextView TextView

Data Model: Contact.java public String name; public String relationship; public int imageID;

Controller: MainActivity.java Task 1: Instantiate a layout inflater to inflate individual friend contacts (contact_item) Task 2: Create a list of 20 Contact objects. Each Contact object should consist of a name, relationship, and a photo. Task 3: Reference the internal LinearLayout in the main activity. This is where the list of contacts will be displayed. Task 4: Dynamically create a View for each Contact object in the ArrayList and add it to the scrolling internal LinearLayout. Step a) Inflate a contract_item layout. Step b) Reference the ImageView and TextViews in the contact_item. Step c) Add content to the inflated contact_item. Step d) Add the contact_item to the internal LinearLayout.

Controller: MainActivity.java Task 1: Instantiate a layout inflater to inflate individual friend contacts (contact_item) LayoutInflater layoutInflater = (LayoutInflater) getSystemService (Context.LAYOUT_INFLATER_SERVICE);

Controller: MainActivity.java Task 2: Create a list of 20 Contact objects. Each Contact object should consist of a name, relationship, and a photo. ArrayList<Contact> contactList = new ArrayList<Contact>(); contactList.add(new Contact("Arthur Weasley", "father", R.drawable.male1)); .

Controller: MainActivity.java Task 3: Reference the internal LinearLayout in the main activity. This is where the list of contacts will be displayed.

Controller: MainActivity.java Task 4: Dynamically create a View for each Contact object in the ArrayList and add it to the scrolling internal LinearLayout. Step a) Inflate a contract_item layout.

Controller: MainActivity.java Task 4: Step b) Reference the ImageView and TextViews in the contact_item. TextView name_text = (TextView) myContactItem.findViewById(R.id.textView1); . Example: Inflated contract_item layout

Controller: MainActivity.java Task 4: Step c) Add content to the inflated contact_item. name_text.setText(contactList.get(i).name); .

Controller: MainActivity.java Task 4: Step d) Add the contact_item to the internal LinearLayout.