User Interface Classes.  Design Principles  Views & Layouts  Event Handling  Menus  Dialogs.

Slides:



Advertisements
Similar presentations
Android UserInterfaces Nasrullah Niazi. overView All user interface elements in an Android app are built using View and ViewGroup objects. A View is an.
Advertisements

Android User Interface
Programming with Android: Widgets and Events Luca Bedogni Marco Di Felice Dipartimento di Scienze dell’Informazione Università di Bologna.
Unlocking Android Chapter 4.  Understanding activities and views  Exploring the Activity lifecycle  Working with resources  Defining the AndroidManifest.xml.
 User Interface - Raeha Sandalwala.  Introduction to UI  Layouts  UI Controls  Menus and ‘Toasts’  Notifications  Other interesting UIs ◦ ListView.
Chapter 3 Tables and Page Layout
Application Fundamentals. See: developer.android.com/guide/developing/building/index.html.
Filip Debelić What is it? Android is a mobile operating system (OS) based on the Linux kernel and currently developed by Google Android,
User Interface Android Applications. Activities An activity presents a visual user interface. Each activity is given a default window to draw in. The.
Android Form Elements. Views Provide common UI functionality Form elements: text area, button, radio button, checkbox, dropdown list, etc. Date and time.
By: Jeremy Smith.  Introduction  Droid Draw  Add XML file  Layouts  LinearLayout  RelativeLayout  Objects  Notifications  Toast  Status Bar.
Cosc 4730 Android TabActivity and ListView. TabActivity A TabActivity allows for multiple “tabs”. – Each Tab is it’s own activity and the “root” activity.
Access Tutorial 8 Sharing, Integrating, and Analyzing Data
CS378 - Mobile Computing User Interface Basics MIKE!! LOOK HERE FOR intercepting the ListView items:
Android: Layouts David Meredith
Multi-Table Forms Access – Lesson 5.
CS5103 Software Engineering Lecture 08 Android Development II.
ANDROID – INTERFACE AND LAYOUT L. Grewe. Interfaces: Two Alternatives Code or XML  You have two ways you can create the interface(s) of your Application.
1 Announcements Homework #2 due Feb 7 at 1:30pm Submit the entire Eclipse project in Blackboard Please fill out the when2meets when your Project Manager.
Java Software Solutions Lewis and Loftus Chapter 10 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Graphical User Interfaces --
Frank Xu Gannon University.  Linear Layout  Relative Layout  Table Layout.
INTRODUCTION TO ANDROID. Slide 2 Application Components An Android application is made of up one or more of the following components Activities We will.
Programming Mobile Applications with Android September, Albacete, Spain Jesus Martínez-Gómez.
Android Boot Camp for Developers Using Java, 3E
Programming with Android: Layouts, Widgets and Events Luca Bedogni Marco Di Felice Dipartimento di Scienze dell’Informazione Università di Bologna.
User Interfaces: Part 1 (View Groups and Layouts).
Application Development for mobile Devices
Cosc 5/4730 Dialogs and below 3.0 and above (fragment)
Exploring Windows and Essential Computing Concepts 1 Windows Desktop u Windows Basics u Icon u Start Button u My Computer u Network Neighborhood u Recycle.
User notification Android Club Agenda Toast Custom Toast Notification Dialog.
Copyright© Jeffrey Jongko, Ateneo de Manila University Basic Views and Layouts.
Copyright© Jeffrey Jongko, Ateneo de Manila University Editing ListAdapter Data part 2.
MOBILE COMPUTING D10K-7D02 MC04: Layouts Dr. Setiawan Hadi, M.Sc.CS. Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran.
Styles, Dialog Boxes, and Menus. Styles Allow creation of a common format – placed in res/values/styles.xml – file name is incidental Can be applied.
HW#9 Clues CSCI 571 Fall, HW#9 Prototype
MOBILE COMPUTING D10K-7D02 MC05: Android UI Design Dr. Setiawan Hadi, M.Sc.CS. Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Android Drawing Units and The.
1 Android Development Lean and mean introduction Based on a presentation by Mihail L. Sichitiu.
CS378 - Mobile Computing User Interface Basics. User Interface Elements View – Control – ViewGroup Layout Widget (Compound Control) Many pre built Views.
Building User Interfaces Basic Applications
XP IT INSTRUCTOR :AHMAD HIRZALLAH 1 Microsoft Office FrontPage 2003 Creating Tables and Frames.
CS378 - Mobile Computing More UI. UI Review Containers – more formally ViewGroups – store widgets and other containers – examples: LinearLayout, RelativeLayout,
COMP 365 Android Development.  Developing for Android  XML for user interface formatting and other scripting  Java for programming.
ANDROID LAYOUTS AND WIDGETS. Slide 2 Introduction Parts of the Android screen Sizing widgets and fonts Layouts and their characteristics Buttons, checkboxes.
Android Fundamentals. What is Android Software stack for mobile devices Software stack for mobile devices SDK provides tools and APIs to develop apps.
Building UI Components Димитър Н. Димитров Astea Solutions AD.
CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren
ANDROID DIALOGS. Slide 2 Dialogs (Introduction) The Dialog class is the base class for all dialogs A dialog is a small window that prompts the user to.
Lab7 – Appendix.
Android Programming - Features
Lecture 3 Zablon Ochomo Android Layouts Lecture 3 Zablon Ochomo
CS499 – Mobile Application Development
Mobile Application Development BSCS-7 Lecture # 8
Creation of an Android App By Keith Lynn
CS499 – Mobile Application Development
Mobile Application Development Chapter 4 [Android Navigation and Interface Design] IT448-Fall 2017 IT448- Fall2017.
Android Introduction Hello Views Part 1.
Politeknik Elektronika Negeri Surabaya
Chap 7. Building Java Graphical User Interfaces
Mobile Computing With Android ACST 4550 Alerts
Chapter 3: Coding the GUI Programmatically, Layout Managers
CIS 470 Mobile App Development
CS5103 Software Engineering
Building User Interfaces Basic Applications
Android Developer Fundamentals V2
Android Developer Fundamentals V2
CIS 470 Mobile App Development
Mobile Programmming Dr. Mohsin Ali Memon.
Android Sensor Programming
Presentation transcript:

User Interface Classes

 Design Principles  Views & Layouts  Event Handling  Menus  Dialogs

 Activities usually include a user interface  Android provides many classes for constructing user interfaces

 Building block for UI components  Views occupy a rectangular space on screen  Responsible for drawing themselves and for handling events  Common operations  Set properties  Set focus  Attach Listeners  Set visibility

 Many predefined widgets  Buttons  Text field  Editable text field  Check box  Radio buttons  Toggle Button  Rating Bar

 When user interacts with view, callback methods are invoked  Some examples with simplified description  onClick() – focus & press view  onLongClick() – touch, press & hold view  onFocusChange() – navigate in/out of view  onKey() – focus, press & release key

Date PickerTime Picker

SpinnerAuto CompleteGallery

 Provides a scrollable list of items  User can select one item at a time  Items added to Spinner with a ListAdapter

Web ViewMapView

 A View class that can contain other views  Used for grouping & organizing a set of views  Base class for layouts & view containers

 Child views are arranged in a single horizontal or vertical row

<LinearLayout … android:orientation="vertical" android:layout_width="fill_parent” android:layout_height="fill_parent”> … …

 Child views are positioned relative to each other and to parent view

<RelativeLayout… android:layout_width="fill_parent” android:layout_height="fill_parent"> <TextView android:text="Type here:" android:layout_width="fill_parent” android:layout_height="wrap_content”/> <EditText android:layout_width="fill_parent” android:layout_height="wrap_content" <Button android:layout_width="wrap_content” android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_marginLeft="10dip" android:text="OK" /> <Button android:layout_width="wrap_content” android:layout_height="wrap_content" android:text="Cancel" />

 Child views arranged into rows & columns

<TextView android:layout_column="1" android:text="Open...” android:padding="3dip" /> … …

 Child views arranged in a two-dimensional, scrollable grid  Child views added to layout via ListAdapter

 Allows multiple Activities to share single content area  Layout is divided into tab & content areas  Each Tab is associated with one Activity  Exactly one tab is selected at any given time  Activity corresponding to the selected tab is visible in the content area

 ViewGroup containing a scrollable list of items  Items can be selected  ListView can filter list of items based on text input  List items inserted using a ListAdapter

 Activities can include menus  Can add items to a menu  Can handle clicks on the menu items

 Options – Primary menu shown when user presses the menu button  Context – View-specific menu to be shown when user touches and holds the view  Submenu – A menu activated when user touches a visible menu item

 Define Menu resource in XML file  Store in res/menu/filename.xml  Inflate menu resource using MenuInflater in appropriate onCreate…Menu() methods  Handling item selection in appropropriate on…ItemsSelected() methods

 Many other features supported  Grouping menu items  Binding shortcut keys to menu items  Binding Intents to menu items

 Independent subwindow used by Activities to communicate with user  Dialog subclasses  AlertDialog  ProgressDialog  DatePickerDialog  TimePickerDialog

AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage(”Do you wish to exit?”).setCancelable(false).setPositiveButton("Yes", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { MyActivity.this.finish(); } }).setNegativeButton("No", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alert = builder.create(); alert.show();

ProgressDialog progressDialog = new ProgressDialog(this); progressDialog.setMessage("Activity Shutting Down."); progressDialog.show();