CS378 -Mobile Computing. User Interface Basics

Similar documents
CS371m - Mobile Computing. User Interface Basics

Praktikum Entwicklung Mediensysteme. Implementing a User Interface

CS 528 Mobile and Ubiquitous Computing Lecture 2a: Introduction to Android Programming. Emmanuel Agu

CS 4518 Mobile and Ubiquitous Computing Lecture 2: Introduction to Android Programming. Emmanuel Agu

Hello World. Lesson 1. Android Developer Fundamentals. Android Developer Fundamentals. Layouts, and. NonCommercial

CS 528 Mobile and Ubiquitous Computing Lecture 2a: Android UI Design in XML + Examples. Emmanuel Agu

Android Layout Types

ANDROID APPS DEVELOPMENT FOR MOBILE GAME

CS260 Intro to Java & Android 05.Android UI(Part I)

User Interface: Layout. Asst. Prof. Dr. Kanda Runapongsa Saikaew Computer Engineering Khon Kaen University

CS260 Intro to Java & Android 05.Android UI(Part I)

Building User Interface for Android Mobile Applications II

Overview. What are layouts Creating and using layouts Common layouts and examples Layout parameters Types of views Event listeners

Android UI DateBasics

Views & View Events View Groups, AdapterViews & Layouts Menus & ActionBar Dialogs

CS 528 Mobile and Ubiquitous Computing Lecture 2: Intro to Android Programming Emmanuel Agu

Mobile User Interfaces

Programming with Android: Introduction. Layouts. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna

Android Programming Lecture 2 9/7/2011

04. Learn the basic widget. DKU-MUST Mobile ICT Education Center

ANDROID USER INTERFACE

Android UI: Overview

Android Application Development 101. Jason Chen Google I/O 2008

GUI Design for Android Applications

CS 528 Mobile and Ubiquitous Computing Lecture 2: Intro to Android Programming Emmanuel Agu

A view is a widget that has an appearance on screen. A view derives from the base class android.view.view.

EECS 4443 Mobile User Interfaces. More About Layouts. Scott MacKenzie. York University. Overview (Review)

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I)

Mobile Programming Lecture 2. Layouts, Widgets, Toasts, and Event Handling

Mobile Application Development Android

Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology

(c) Dr Sonia Sail LAJMI College of Computer Sciences & IT (girl Section) 1

Announcements. Android: n-puzzle Walkthrough. Tommy MacWilliam. Dynamic GUIs. ListViews. Bitmaps. Gameplay. Saving State. Menus

EECS 4443 Mobile User Interfaces. More About Layouts. Scott MacKenzie. York University

Chapter 8 Positioning with Layouts

LECTURE 08 UI AND EVENT HANDLING

Mobile App Design Project Doodle App. Description:

Lab 1 - Setting up the User s Profile UI

Android Application Development

06. Advanced Widget. DKU-MUST Mobile ICT Education Center

Programming Android UI. J. Serrat Software Design December 2017

Chapter 2 Welcome App

Introductory Android Development

GUI Widget. Lecture6

Android App Development. Mr. Michaud ICE Programs Georgia Institute of Technology

Programming with Android: Layouts, Widgets and Events. Dipartimento di Scienze dell Informazione Università di Bologna

CS 4518 Mobile and Ubiquitous Computing Lecture 5: Data-Driven Views and Android Components Emmanuel Agu

Android Basics. Android UI Architecture. Android UI 1

Beginning Android 4 Application Development

Mobile Software Development for Android - I397

MOBILE COMPUTING 1/20/18. How many of you. CSE 40814/60814 Spring have implemented a command-line user interface?

Mobile Programming Lecture 1. Getting Started

Mobile Computing Practice # 2a Android Applications - Interface

Let s take a display of HTC Desire smartphone as an example. Screen size = 3.7 inches, resolution = 800x480 pixels.

Fragments were added to the Android API in Honeycomb, API 11. The primary classes related to fragments are: android.app.fragment

Event Driven UIs and Model-View-Controller

User Interface Development. CSE 5236: Mobile Application Development Instructor: Adam C. Champion Course Coordinator: Dr.

Android Programming: More User Interface. CS 3: Computer Programming in Java

Have a development environment in 256 or 255 Be familiar with the application lifecycle

ListView (link) An ordered collection of selectable choices. key attributes in XML:

O X X X O O X O X. Tic-Tac-Toe. 5COSC005W MOBILE APPLICATION DEVELOPMENT Lecture 2: The Ultimate Tic-Tac-Toe Game

Android UI Development

Sizing and Positioning

Spring Lecture 7 Lecturer: Omid Jafarinezhad

ListView Containers. Resources. Creating a ListView

CS371m - Mobile Computing. More UI Action Bar, Navigation, and Fragments

CS 4518 Mobile and Ubiquitous Computing Lecture 4: Data-Driven Views, Android Components & Android Activity Lifecycle Emmanuel Agu

Programming with Android: Introduction. Layouts. Luca Bedogni. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna

Android User Interface Android Smartphone Programming. Outline University of Freiburg

Graphical User Interfaces

CS371m - Mobile Computing. More UI Navigation, Fragments, and App / Action Bars

Stanislav Rost CSAIL, MIT

Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology

Creating a User Interface

Android User Interface

ConstraintLayouts in Android

Mobile Computing Practice # 2c Android Applications - Interface

UI, Continued. CS 2046 Mobile Application Development Fall Jeff Davidson CS 2046

Activities and Fragments

South Africa

CSS Selectors. element selectors. .class selectors. #id selectors

Required Core Java for Android application development

Computer Science E-76 Building Mobile Applications

Android Programming (5 Days)

GUI Components: Part 1

Dreamweaver Tutorials Working with Tables

Lab 3. Accessing GSM Functions on an Android Smartphone

MC Android Programming

TextView. A label is called a TextView. TextViews are typically used to display a caption TextViews are not editable, therefore they take no input

UI (User Interface) overview Supporting Multiple Screens Touch events and listeners

Comparative Study on Layout and Drawable Resource Behavior in Android for Supporting Multi Screen

Contents. Orientation SearchBar and Gallery List Advanced Multiple Form Multi Touch Animations Layout Designing UI using UI Builder

When programming in groups of people, it s essential to version the code. One of the most popular versioning tools is git. Some benefits of git are:

Warping & Blending AP

Tabs, Tables & Columns

Netscape Composer: Working with Tables

CS3240 Human-Computer Interaction Lab Sheet Lab Session 2

CHAPTER 4. Fragments ActionBar Menus

Laying Out Controls in Containers

Week 5 Creating a Calendar. About Tables. Making a Calendar From a Table Template. Week 5 Word 2010

Transcription:

CS378 -Mobile Computing User Interface Basics

User Interface Elements View Control ViewGroup Layout Widget (Compound Control) Many pre built Views Button, CheckBox, RadioButton TextView, EditText, ListView Can be customized by extending and overriding ondraw()

XML UI Configuration Layouts can specify UI elements (provided and custom) res/layout "Design by Declaration"

Layouts Layouts are subclasses of ViewGroup FrameLayout simplest type of layout object fill with a single object (such as a picture) that can be switched in and out child elements pinned to top left corner of screen and cannot be move adding a new element / child draws over the last one

LinearLayout aligns child elements (such as buttons, edit text boxes, pictures, etc.) in a single direction orientation attribute defines direction: android:orientation= "vertical"

Gravity center right Child element's gravity attribute where to position in the outer container

layout_weight attribute "importance" of a view default = 0 if set > 0 takes up more of parent space Weight BTW, scale emulator Run -> Run Configurations -> target -> command line options "-scale 0.7

Another Weight Examples button and bottom edit text weight of 2 button weight 1 and bottom edit text weight of 2

LinearLayout-Horizontal Orientation padding background color margins

TableLayout rows and columns rows normally TableRows TableRowscontain other elements such as buttons, text, etc.

RelativeLayout children specify position relative to parent or to each other (specified by ID) First element listed is placed in "center" other elements placed based on position to other elements

RelativeLayout XML

RelativeLayout XML

Other Layouts -GridView Two Dimensional Scrollable Grid Items inserted into layout via a ListAdapter

Other Layouts -TabLayout Uses a TabHostand TabWidget Swap between views in same activity or switch between different activities

Other Layouts -ListView Creates a list of scrollable items Items added via a ListAdapteras in GridView

Gallery Other Views -Layouts horizontal scrolling display of images from a list SurfaceView provide access to a "drawing" surface. Intended to draw pixels, not display other views / widgets

Concrete Example Tip Calculator What kind of layout to use? Widgets: TextView EditText SeekBar

TextViews

EditText All but top EditText are uneditable Alternative? TextViews?

SeekBar

Layout TableLayout row 0 row 1 row 2 row 4 row 3 row 5

Layout Attributes android:background #RGB, #ARGB, #RRGGBB, #AARRGGBB can place colors in res/values/colors.xml

Color Resources Good Resource / W3C colors http://tinyurl.com/6py9huk

StretchColumns columns 0 indexed columns 1, 2, 3 stretch to fill layout width column 0 wide as widest element, plus any padding for that element

Initial UI Done via some Drag and Drop, Outline view, and editing XML Demo outline view properties

Changes to UI Outline multiple select properties all TextViews' textcolorset to black #000000 change column for %DD labels use center gravity for components

change bill total and seekbarto span more columns Changes to UI gravity and padding for text in column 0 align text with seekbar set seekbarprogress to 18 set seekbarfocusable to false -keep keyboard on screen

Prevent Editing in EditText Changes to UI focusable, long clickable, and cursor visible properties to false Set text in EditTextto 0.00 Change weights to 1 to spread out

Functionality oncreateinstance variables assigned to components found via ids update standard percents:

Functionality -Saving State onsaveinstance save BillTotaland CustomPercentto the Bundle check for these in oncreate

Functionality Responding to SeekBar customseekbarlistenerinstance variable Of type OnSeekBarChangeListener

Create an Anonymous Inner Class Class notified when seek bar changed and program updates custom tip and total amount must register with the seekbarinstance variable in oncreate!

Functionality -Total EditText Another anonymous inner class implement ontextchangedto convert s to double and call update methods register with EditText for total in oncreate()!