Mobile Application Development BSCS-7 Lecture # 8

Slides:



Advertisements
Similar presentations
Chapter 3 – Web Design Tables & Page Layout
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.
All About Android Introduction to Android 1. Creating a New App “These aren’t the droids we’re looking for.” Obi-wan Kenobi 1. Bring up Eclipse. 2. Click.
 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.
User Interface Android Applications. Activities An activity presents a visual user interface. Each activity is given a default window to draw in. The.
More on User Interface Android Applications. Layouts Linear Layout Relative Layout Table Layout Grid View Tab Layout List View.
By: Jeremy Smith.  Introduction  Droid Draw  Add XML file  Layouts  LinearLayout  RelativeLayout  Objects  Notifications  Toast  Status Bar.
Android: Layouts David Meredith
1 The Structure of a Web Table beginning of the table structure first row of three in the table end of the table structure table cells You do not need.
Introduction to Android Programming Content Basic environmental structure Building a simple app Debugging.
Android Development: Application Layout Richard S. Stansbury 2015.
Introducing the Sudoku Example
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Introduction to Android (Part.
PROG Mobile Java Application Development PROG Mobile Java Application Development Developing Android Apps: Components & Layout.
ANDROID UI – FRAGMENTS. Fragment  An activity is a container for views  When you have a larger screen device than a phone –like a tablet it can look.
Chapter 2: Simplify! The Android User Interface
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.
Understanding Hello Android 1 CS300. Activity  Similar to a form  Base class for the visual, interactive components of your application  Android API.
Frank Xu Gannon University.  Linear Layout  Relative Layout  Table Layout.
Mobile Computing Lecture#11 Adapters and Dialogs.
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.
Android Dialog Boxes AlertDialog - Toast
Designing a Web Page with Tables. A text table: contains only text, evenly spaced on the Web page in rows and columns uses only standard word processing.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 7: Reveal! Displaying Pictures in a GridView.
Object Oriented Software Development 9. Creating Graphical User Interfaces.
Android Boot Camp for Developers Using Java, 3E
UI Resources Layout Resources String Resources Image Resources.
User Interfaces: Part 1 (View Groups and Layouts).
Application Development for mobile Devices
Chapter 7: Reveal! Displaying Pictures in a Gallery.
Android – Fragments L. Grewe.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 2: Simplify! The Android User Interface.
Graphic User Interface. Graphic User Interface (GUI) Most of us interact with computers using GUIs. GUIs are visual representations of the actions you.
CIS234A- Lecture 7 Instructor Greg D’Andrea. Tables A table can be displayed on a Web page either in a text or graphical format. A text table: – contains.
MOBILE COMPUTING D10K-7D02 MC05: Android UI Design Dr. Setiawan Hadi, M.Sc.CS. Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran.
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.
20-753: Fundamentals of Web Programming 1 Lecture 6: Advanced HTML Fundamentals of Web Programming Lecture 6: Advanced HTML.
Positioning Objects with CSS and Tables
Building User Interfaces Basic Applications
ANDROID LAYOUTS AND WIDGETS. Slide 2 Introduction Parts of the Android screen Sizing widgets and fonts Layouts and their characteristics Buttons, checkboxes.
CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren
Android 9: Layouts Kirk Scott.
Laying out Elements with CSS
Chapter 2: Simplify! The Android User Interface
Lab7 – Appendix.
Java FX: Scene Builder.
Open Handset Alliance.
Android 9: Layouts Kirk Scott.
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.
ANDROID UI – FRAGMENTS UNIT II.
Chap 7. Building Java Graphical User Interfaces
Graphical User Interfaces -- Introduction
CIS 470 Mobile App Development
CS5103 Software Engineering
AWT Components and Containers
Using HTML Tables SWBAT: - create tables using HTML
Tutorial 6 Creating Dynamic Pages
Building User Interfaces Basic Applications
Android Topics Limited Resources and why we need to consider them.
Mobile Computing With Android ACST 4550 Toast
CIS 470 Mobile App Development
Introduction to Android
Mobile Programmming Dr. Mohsin Ali Memon.
CSc 337 Lecture 5: Grid layout.
Android Sensor Programming
Presentation transcript:

Mobile Application Development BSCS-7 Lecture # 8

Mobile Design Principles – 1. Who? User requirements

Mobile Design Principles – 2. Cues

Mobile Design Principles – 3. Fingers

Mobile Design Principles – 4. Clean Use a grid

Mobile Design Principles – 5. Color, Size, Shape

Mobile Design Principles – 6. Feedback

UI Layouts Basic building block for UI is a View object which is created from View class and occupies a rectangular area on screen and is responsible for drawing and event handling. View is base class for widgets, which are used to create interactive UI components like buttons, text fields, etc. ViewGroup is a subclass of View and provides invisible container that hold other Views or other ViewGroups and define their layout properties. At third level we have different layouts which are subclasses of ViewGroup class and a typical layout defines visual structure for an Android UI and can be created either at run time using View/ViewGroup objects or you can declare your layout using simple XML file main_layout.xml which is located in the res/layout folder of your project. Once your layout is defined, you can load layout resource from your application code, in your Activity.onCreate() callback implementation as shown below: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); }

UI Layouts - Types S.N. Layout & Description 1 Linear Layout a view group that aligns all children in a single direction, vertically or horizontally. 2 Relative Layout a view group that displays child views in relative positions. 3 Table Layout a view that groups views into rows and columns. 4 Absolute Layout enables you to specify exact location of its children. 5 Frame Layout a placeholder on screen that you can use to display a single view. 6 List View a view group that displays a list of scrollable items. 7 Grid View a ViewGroup that displays items in a two-dimensional, scrollable grid.

UI Layouts - View Input Events Two aspects of a UI are screen layout (made up of View objects, such as text and button) event handling A view object may have a unique ID assigned to it which will identify the View uniquely within the tree. The syntax for an ID, inside an XML tag is: The at-symbol (@) at the beginning of the string indicates that the XML parser should parse and expand the rest of the ID string and identify it as an ID resource. The plus-symbol (+) means that this is a new resource name that must be created and added to our resources. To create an instance of the view object and capture it from the layout, use the following: UI Layouts - View Identification android:id="@+id/my_button" Button myButton = (Button) findViewById(R.id.my_button);

Toast android.widget.Toast A toast is a view containing a quick little message for the user. A toast provides simple feedback about an operation in a small popup. It only fills the amount of space required for the message and the current activity remains visible and interactive. Steps Instantiate a Toast object with one of the makeText() methods. This method takes three parameters: the application Context, the text message, and the duration for the toast. It returns a properly initialized Toast object. Context context = getApplicationContext(); CharSequence text = "Hello toast!"; int duration = Toast.LENGTH_SHORT; Toast toast = Toast.makeText(context, text, duration); toast.show(); // Toast.makeText(context, text, duration).show();

Toast Positioning your Toast The first parameter of the setGravity() method specifies the overall position of the Toast. You can use the following constants in the Gravity class to specify the overall position: TOP • BOTTOM • LEFT • RIGHT • CENTER CENTER_HORIZONTAL • CENTER_VERTICAL Each of these constants defines the position in either the X or Y direction, except for the CENTER constant which implies centered both horizontally and vertically. You can combine these constants using the | (or) operator. The two other parameters of the setGravity() method are an X and Y offset to the position defined by the Gravity constant. Constants int LENGTH_LONG Show the view or text notification for a long period of time. LENGTH_SHORT Show the view or text notification for a short period of time. toast.setGravity(Gravity.CENTER, 0, 0);

Toast Public Methods void cancel()Close the view if it's showing, or don't show it if it isn't showing yet. int getDuration()Return the duration. getGravity()Get the location at which the notification should appear on the screen. float getHorizontalMargin()Return the horizontal margin. getVerticalMargin()Return the vertical margin. view getView()Return the view. getXOffset()Return the X offset in pixels to apply to the gravity's location. getYOffset()Return the Y offset in pixels to apply to the gravity's location. setDuration(int duration)Set how long to show the view for. setMargin(float horizontalMargin, float verticalMargin)Set the margins of the view. setText(int resId)Update the text in a Toast that was previously created using one of the makeText() methods. setText(CharSequence s)Update the text in a Toast that was previously created using one of the makeText() methods. setView(View view)Set the view to show. show()Show the view for the specified duration.

Notification a