ANDROID AND MODEL / VIEW / CONTROLLER. Slide 2 Design Patters Common solutions to programming problems are called design patterns Design patterns are.

Slides:



Advertisements
Similar presentations
MWD1001 Website Production Using JavaScript with Forms.
Advertisements

CE881: Mobile and Social Application Programming Simon M. Lucas Menus and Dialogs.
TP4: S TATE M ACHINE D ESIGN P ATTERN  Definition  Infrastructure  Transition Code  Conclusion.
Android User Interface
Apache Struts Technology
App Customization. Introduction  Not all Android apps look the same  i.e. the default bland black and white look  Most have custom looks like  Background.
The Web Warrior Guide to Web Design Technologies
Or How I Learned to Stop Worrying and Love the Binding Bryan Anderson.
OOP Design Patterns Chapters Design Patterns The main idea behind design patterns is to extract the high level interactions between objects and.
Java Programming, 3e Concepts and Techniques Chapter 5 Arrays, Loops, and Layout Managers Using External Classes.
Satzinger, Jackson, and Burd Object-Orieneted Analysis & Design
Object-Oriented Analysis and Design
Application Architectures Vijayan Sugumaran Department of DIS Oakland University.
CS6320 – MVC L. Grewe THE ISSUE: Separating Implementation from Interface The business logic stays the same regardless of what the presentation is The.
Design Patterns academy.zariba.com 1. Lecture Content 1.What are Design Patterns? 2.Creational 3.Structural 4.Behavioral 5.Architectural 6.Design Patterns.
Introducing JavaBeans Lesson 2A / Slide 1 of 30 JDBC and JavaBeans Pre-assessment Questions 1.Which of the given symbols is used as a placeholder for PreparedStatement.
UNIT-V The MVC architecture and Struts Framework.
Chapter 3 Introduction to Event Handling and Windows Forms Applications.
Creating Android user interfaces using layouts 1Android user interfaces using layouts.
Dependency Injection and Model-View-Controller. Overview Inversion of Control Model-View-Controller.
A First Program Using C#
MVC pattern and implementation in java
Java Beans.
MVC and MVP. References enter.html enter.html
Model View Controller (MVC) Rick Mercer with a wide variety of others 1.
Java Programming, 3e Concepts and Techniques Chapter 3 Section 62 – Manipulating Data Using Methods – Day 1.
Chapter 2: Simplify! The Android User Interface
Tip Calculator App Building an Android App with Java © by Pearson Education, Inc. All Rights Reserved.
Chapter 2 The Android User Interface. Objectives  In this chapter, you learn to:  Develop a user interface using the TextView, ImageView, and Button.
INTRODUCTION TO ANDROID. Slide 2 Application Components An Android application is made of up one or more of the following components Activities We will.
(c) University of Washington08-1 CSC 143 Models and Views Reading: Ch. 18.
© 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.
Android Boot Camp for Developers Using Java, 3E
Resources. Application Resources Resources are strings, images, and other pieces of application information that are stored and maintained (externalized)
Chapter 6 Sub Procedures
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 2: Simplify! The Android User Interface.
© 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.
Design Patterns CSIS 3701: Advanced Object Oriented Programming.
CPSC 871 John D. McGregor Module 3 Session 1 Architecture.
Model View Controller MVC Web Software Architecture.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
CSE 332: Design Patterns Review: Design Pattern Structure A design pattern has a name –So when someone says “Adapter” you know what they mean –So you can.
Forms and Controls Part 3 dbg --- Naming conventions, Button, Event handlers, Label.
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4: Events Programming with Alice and Java First Edition by John Lewis.
MVC WITH CODEIGNITER Presented By Bhanu Priya.
© 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.
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter One An Introduction to Visual Basic 2008.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 32 JavaBeans and Bean.
SDJ INFOSOFT PVT. LTD. 2 BROWSERBROWSER JSP JavaBean DB Req Res Application Layer Enterprise server/Data Sources.
Apache Struts Technology A MVC Framework for Java Web Applications.
High degree of user interaction Interactive Systems: Model View Controller Presentation-abstraction-control.
ANDROID LAYOUTS AND WIDGETS. Slide 2 Introduction Parts of the Android screen Sizing widgets and fonts Layouts and their characteristics Buttons, checkboxes.
Android Fragments. Slide 2 Lecture Overview Getting resources and configuration information Conceptualizing the Back Stack Introduction to fragments.
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
INTRODUCTION TO ANDROID. Slide 2 Introduction I take a top-down approach to describing an application’s anatomy.
CHAPTER 1 part 1 Introduction. Chapter objectives: Understand Android Learn the differences between Java and Android Java Examine the Android project.
Chapter 2: Simplify! The Android User Interface
Design Patterns Source: “Design Patterns”, Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides And Created.
Chapter 2 – Introduction to the Visual Studio .NET IDE
MAD.
Creation of an Android App By Keith Lynn
XAML User Interface Creation in C#
What is MVC Category: System MVC=Model-View-Controller
Model-View-Controller Patterns and Frameworks
Reusability 11/29/2018© 2006 ITT Educational Services Inc.
Model-View-Controller (MVC) Pattern
Model, View, Controller design pattern
CIS 470 Mobile App Development
Presentation transcript:

ANDROID AND MODEL / VIEW / CONTROLLER

Slide 2 Design Patters Common solutions to programming problems are called design patterns Design patterns are characterized as: Structural patterns that depict the bigger picture of how classes (things) fit together Adapter, MVC Creational patterns depict how objects are created Factory pattern Behavioral patterns describe the interaction between objects

Slide 3 MVC (Introduction) Design pattern with a clear separation between application logic and the user interface In Android, all objects fall into either a model view controller

Slide 4 MVC (Model - 1) The model manages the information and notifies the observers when the information changes It represents the data on which the application operates The model provides the persistent storage of data, which is manipulated by the controller In this chapter, we are modeling a true / false question

Slide 5 MVC (Model - 2) Model has no knowledge of the user interface That’s the responsibility of the view In Android, these are custom classes that you typically create

Slide 6 MVC (View) The view displays the data It takes input from user It renders the model data into a form (screen) to display to the user There can be several views associated with a single model Usually for different devices If it’s visible to the user, it’s a view

Slide 7 MVC (View) The view knows how to draw itself on the screen Together, all of the different view objects make up the view layer Rendering a view is often called inflating a view

Slide 8 MVC (Controller 1) The controller handles all requests coming from the view or (user interface) The data flow to whole application is managed by the controller It forwards the request to the appropriate handler Only the controller is responsible for accessing the model and rendering it into various UIs (views)

Slide 9 MVC (Controller 2) The controller ties the model and views together Controllers are designed to respond to various events triggered by view objects and to manage the flow of data to and from model objects and the view layer

Slide 10 MVC (Illustration)

Slide 11 Chapter 2 MVC Implementation

Slide 12 MVC Benefits Separates the business logic from the user interface We can have multiple views for different devices Applications tend to be more structured thereby making them easier to understand Code reusability tends to increase

Slide 13 Adding a Java Class (1) The project in the first chapter had a single class In this chapter, you will add a second class that will implement the model

Slide 14 Adding a Java Class (2) Click File, New, Class to create a new class Give the class a name

Slide 15 Adding a Java Class (3)

Slide 16 Accessors and Mutators In C# we create what are called property procedures to implement properties Remember that properties store data about an object In Java, we create method pairs called accessors and mutators Accessers read a property Mutators update a property

Slide 17 Accessors Both store data in a hidden variable Accessors typically begin with the prefix get Boolean accessors typically begin with the prefix is Typically the value is stored in a hidden variable

Slide 18 Mutators Both store data in a hidden variable Mutators typically begin with the prefix “set”

Slide 19 Example The following contain accessors and mutators

Slide 20 Icons (Introduction) Icons are stored as external files Multiple versions of an icon are typically needed to support different resolutions Medium (mdpi) (about 160 dpi) High (hdpi) (about 240 dpi) Extra-high (xhdpi) (about 320 dpi) Low density devices are considered obsolete

Slide 21 Icons (Implementation) Icons are stored in the res folder By convention, there are subdirectories that store icons of the various resolutions Android figures out which icon (resource) to use based on the device resolution png, jpg, gif formats are supported among others

Slide 22 Icons (Illustration)

Slide 23 Reading Resources in XML The syntax to read a resource is similar to the process to read a string A reference to a string resource begins A reference to a drawable resource begins

Slide 24 Reading a Resource (Example) Read and display the resource named arrow_right