Building UI Components Димитър Н. Димитров Astea Solutions AD.

Slides:



Advertisements
Similar presentations
Chapter 11 Designing the User Interface
Advertisements

Android UserInterfaces Nasrullah Niazi. overView All user interface elements in an Android app are built using View and ViewGroup objects. A View is an.
CE881: Mobile and Social Application Programming Simon M. Lucas Menus and Dialogs.
Android User Interface
Programming with Android: Widgets and Events Luca Bedogni Marco Di Felice Dipartimento di Scienze dell’Informazione Università di Bologna.
INTRO TO MOBILE APP DEVELOPMENT CMSC 150: Lecture 34.
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.
User Interface Classes.  Design Principles  Views & Layouts  Event Handling  Menus  Dialogs.
Filip Debelić What is it? Android is a mobile operating system (OS) based on the Linux kernel and currently developed by Google Android,
By: Jeremy Smith.  Introduction  Droid Draw  Add XML file  Layouts  LinearLayout  RelativeLayout  Objects  Notifications  Toast  Status Bar.
Chapter 13: Designing the User Interface
Cosc 4730 Android TabActivity and ListView. TabActivity A TabActivity allows for multiple “tabs”. – Each Tab is it’s own activity and the “root” activity.
CS378 - Mobile Computing User Interface Basics MIKE!! LOOK HERE FOR intercepting the ListView items:
Android: Layouts David Meredith
CS378 - Mobile Computing What's Next?. Fragments Added in Android 3.0, a release aimed at tablets A fragment is a portion of the UI in an Activity multiple.
Mobile Programming Lecture 1 Getting Started. Today's Agenda About the Eclipse IDE Hello, World! Project Android Project Structure Intro to Activities,
Android: versions Note that: Honeycomb (Android v3.0) A tablet-only release Jelly Bean (Android v4.1) Released on July 09, 2012.
CS5103 Software Engineering Lecture 08 Android Development II.
Chapter 9: Customize! Navigating with Tabs on a Tablet App.
Prerequisites Android Studio – io.html io.html Java.
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.
CS378 - Mobile Computing More UI - Part 2. Special Menus Two special application menus – options menu – context menu Options menu replaced by action bar.
Cosc 5/4730 Android App Widgets. App Widgets App Widgets are miniature application views that can be embedded in other applications (such as the Home.
SpotOn Game App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 7: Reveal! Displaying Pictures in a GridView.
9 Persistence - SQLite CSNB544 Mobile Application Development Thanks to Utexas Austin.
User Interfaces: Part 1 (View Groups and Layouts).
Application Development for mobile Devices
Chapter 7: Reveal! Displaying Pictures in a Gallery.
Presented By: Muhammad Tariq Software Engineer Android Training course.
Silicon Valley Code Camp 2009 “Embellish Your Pictures” Build an Application for an Android Phone Jack Ha, Balwinder Kaur Oct 3, 2009 – 5:15PM Room CCL.
Cosc 4730 Android Fragments. Fragments You can think of a fragment as a modular section of an activity, which has its own lifecycle, receives its own.
UI Design and Development +Roman Nurik +Nick Butcher.
Copyright© Jeffrey Jongko, Ateneo de Manila University Custom ListAdapters.
Android Using Menus Notes are based on: The Busy Coder's Guide to Android Development by Mark L. Murphy Copyright © CommonsWare, LLC. ISBN:
MOBILE COMPUTING D10K-7D02 MC05: Android UI Design Dr. Setiawan Hadi, M.Sc.CS. Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran.
Activities Димитър Н. Димитров Astea Solutions AD.
Pearson Webcast Series
Designing user interfaces using: Simple views 1. Views Basic views – TextView – EditText – Button – ImageButton – CheckBox – ToggleButton – RadioButton.
CS378 - Mobile Computing More UI - Part 2. Special Menus Two special application menus – options menu – context menu Options menu replaced by action bar.
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
Chapter 2 Building User Interfaces and Basic Applications.
Lec 02 Activities Activity Lifecycle Multiple Activities Views Menus and Dialogs.
Class on Fragments & threads. Fragments fragment is a modular section of an activity, which has its own lifecycle, receives its own input events, and.
Introduction to Android OS Димитър Н. Димитров Astea Solutions AD.
CHAPTER 4 Fragments ActionBar Menus. Explore how to build applications that use an ActionBar and Fragments Understand the Fragment lifecycle Learn to.
Mobile Programming Lecture 4 Resources, Selection, Activities, Intents.
CS371m - Mobile Computing User Interface Basics. UI Programming with Widgets Widget is an element in a Graphical User Interface (GUI) – not to be confused.
ANDROID LAYOUTS AND WIDGETS. Slide 2 Introduction Parts of the Android screen Sizing widgets and fonts Layouts and their characteristics Buttons, checkboxes.
Android intro Building UI #1: basics. UI layout.xml Controls Layouts AdapterViews Toasts dp/sp/px Animations 2.
User Interaction Radan Ganchev Astea Solutions. Content Basic input events Gestures Drag and drop Sensors.
CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren
Android Mobile Applications Course Introduction
Open Handset Alliance.
Android – Event Handling
Widgets & Fragments Kalin Kadiev Astea Solutions AD.
Android Widget Tutorial
Mobile Application Development Chapter 4 [Android Navigation and Interface Design] IT448-Fall 2017 IT448- Fall2017.
Politeknik Elektronika Negeri Surabaya
HUJI Post PC Workshop 1 Introduction to Android Development Ari Sprung
Android SDK & App Development
CS323 Android Model-View-Controller Architecture
Building User Interfaces Basic Applications
Android Topics Custom ArrayAdapters
Midway Milestone Presentation: FlexiVoice
Mobile Programmming Dr. Mohsin Ali Memon.
Presentation transcript:

Building UI Components Димитър Н. Димитров Astea Solutions AD

In a nutshell XML and Java Views and Layouts Displaying data and Adapters Menus Events and handling user interaction App Widgets (not android.widget.*)

Declarative way for defining UI – allows clearer separation between view and controller – arguably, better for visualizing and “getting” fairly complex UI – arguably, you need to write less with XML-based UI Resource-based way for defining UI – allows greater flexibility rely on the system to choose which of all the defined layouts to use, depending on the device configuration – allows better reusability XML Layout

Java Layout OK, in some cases when adding views dynamically – still, try ViewStub first Defining your own custom component doesn’t count – you can still add it to your layout via XML Java and views mix, but not for layout declaration UI event handling complex operations on views manually inflating XML views Don’t overindulge your “coder” dark side

Where it all starts... android.view.View – the granddaddy of all views (even ViewGroup) – occupies rectangular area on the screen – Android measures, lays out and draws views for you top-down measure phase top-down layout phase drawing phase android.view.ViewGroup – the granddaddy of all container views – usually subclassed for implementing custom layouts

And an arsenal of widgets Widgets: Button TextView, EditText ImageView WebView (technically, a container) MultiAutoCompleteTextView (what a nice name) Containers: FrameLayout RelativeLayout LinearLayout Gallery ListView

Displaying data and Adapters An important question for most of the apps – Q: What’s the best way to display our model data? – A: It depends, but AdapterView is a pretty good bet. Android’s mechanism for data binding, featuring: – AdapterView - a container which creates, initializes and updates (data-wise) its views and handles their interactions – Adapter - the bridge between the existing data and the specific AdapterView we are using to display it setAdapter(), getCount(), getView(), getViewTypeCount()

Menus Options Menu – Activity-specific – Shown when hardware MENU key is pressed – Very important for navigation and for easy access to important screen- or app-specific actions Context Menu – View-specific – Most often used by AdapterView children – Very important for providing item-specific actions (edit/delete an entry from your Contacts, for example)

Events and handling user interaction View event callbacks – Create new listener of the corresponding type Implement the corresponding callback: onClick(), onLongClick(),onFocusChange(),onKey(),onTouch() – Register the corresponding event listener to the view Complex gestures recognition GestureDetector GestureDetector.OnGestureListener GestureDetector.SimpleOnGestureListener

App Widgets Specific embeddable views, which can be used in other apps – update-able, used to show the most relevant data or functionality of your app – think Weather on the Home screen or Music control panel Pros can be very useful for some apps (apply Pareto’s principle to your app) can make your app used more often and improve overall UX Cons you may not need one, if you need one, you should plan for it (design, development) can be a battery eater, if you’re doing it wrong

UI components & your application Test your UI on all devices you are targeting Try to use the built-in views, when possible – yup, their ViewSwitcher is better than yours... Profile your UI with the available Android tools layoutopt and hierarchyviewer to begin with beware of 100+ views or unnecessary layouts Your views should be easy to use and simple – don’t distract your users with overcrowded screens – check

Q&A + Feedback Questions? Feedback section: – Did you hear well? – Was there anything you didn’t understand? – What would you like changed in our next lecture?

Recommended resources ml m View.html View.html ?tag=article ?tag=article (old, but gold)