Mobile Computing With Android ACST 4550 XML and the Android GUI

Slides:



Advertisements
Similar presentations
XML e X tensible M arkup L anguage (XML) By: Albert Beng Kiat Tan Ayzer Mungan Edwin Hendriadi.
Advertisements

Tim Berners-Lee authors HTML in 1991, assisted by his colleagues at CERN,
Android 101 Application Fundamentals January 29, 2010.
Basic, Basic, Basic Android. What are Packages? Page 346 in text Package statement goes before any import statements Indicates that the class declared.
Android Application Development with Java UPenn CS4HS 2011 Chris Murphy
@2011 Mihail L. Sichitiu1 Android Introduction Hello World.
INTERNATIONAL SUMMER ACADEMIC COURSE UNIVESITY OF NIS ISAC – Android programming.
Introduction to Android Programming Content Basic environmental structure Building a simple app Debugging.
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.
WPF chapter 15 Dr. John Abraham Professor UTPA. WPF –an introduction WPF provides a single platform capable of handling graphics, audio and video. WPF.
Favorite Twitter® Searches App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
Chapter 2: Simplify! The Android User Interface
Tip Calculator App Building an Android App with Java © by Pearson Education, Inc. All Rights Reserved.
Chapter 5 Creating User Interfaces GOALS and OBJECTIVES Begin our application by creating our user interface. More than one way to create a user interface.
1 © Netskills Quality Internet Training, University of Newcastle Introducing XML © Netskills, Quality Internet Training University.
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.
By Mohsen ashouri.  Introduction  Comparison between XML and HTML  XML Syntax  Challenges  Summary.
Programming with Android: Layouts, Widgets and Events Luca Bedogni Marco Di Felice Dipartimento di Scienze dell’Informazione Università di Bologna.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 2: Simplify! The Android User Interface.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Introduction to Android (Part.
XML – A Quick Introduction Kerry Raymond (stolen from others)
XML e X tensible M arkup L anguage (XML) By: Albert Beng Kiat Tan Ayzer Mungan Edwin Hendriadi.
What is XML? eXtensible Markup Language eXtensible Markup Language A subset of SGML (Standard Generalized Markup Language) A subset of SGML (Standard Generalized.
HW#9 Clues CSCI 571 Fall, HW#9 Prototype
SCHOOL OF LIBRARY, ARCHIVE AND INFORMATION STUDIES Andy Dawson LIS1510 Library and Archives Automation Issues XML and extensible systems Andy Dawson School.
MOBILE COMPUTING D10K-7D02 MC05: Android UI Design Dr. Setiawan Hadi, M.Sc.CS. Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran.
Copyright© Jeffrey Jongko, Ateneo de Manila University Deconstructing HelloWorld.
XP Review 1 New Perspectives on JavaScript, Comprehensive1 Introducing HTML and XHTML Creating Web Pages with HTML.
Module Road Map Assignment Road Map Notice we have linked the conduit directly to the presentation layer. This is normally a bad idea!
User Interface Layout Interaction. EventsEvent Handlers/Listeners Interacting with a user.
ANDROID LAYOUTS AND WIDGETS. Slide 2 Introduction Parts of the Android screen Sizing widgets and fonts Layouts and their characteristics Buttons, checkboxes.
Introduction to Android Chapter 1 1. Objectives Understand what Android is Learn the differences between Java and Android Java Examine the Android project.
XML BASICS and more…. What is XML? In common:  XML is a standard, simple, self-describing way of encoding both text and data so that content can be processed.
Android Programming.
Chapter 2: Simplify! The Android User Interface
Lab7 – Appendix.
Android Programming - Features
Lecture 3 Zablon Ochomo Android Layouts Lecture 3 Zablon Ochomo
Section 4.1 Section 4.2 Format HTML tags Identify HTML guidelines
Android Introduction Hello World
Open Handset Alliance.
Android Application Development 1 6 May 2018
Android N Amanquah.
Adapting to Display Orientation
CS240: Advanced Programming Concepts
Android – Event Handling
Android Introduction Hello World.
XML Mihail L. Sichitiu.
Creation of an Android App By Keith Lynn
Politeknik Elektronika Negeri Surabaya
Introduction to XHTML.
Broadcast Receivers A Android Component where you can register for system or application events, receive and react to broadcast intent. Each broadcast.
Microsoft Office Illustrated
Android Introduction Camera.
Mobile Device Development
Android Programming Lecture 3
Android Layout Basics Topics
CS5103 Software Engineering
Many thanks to Jun Bum Lim for his help with this tutorial.
CMPE419 Mobile Application Development
eXtensible Markup Language (XML)
Android Topics Android Activity Lifecycle and Experiment Toast
Semi-Structured data (XML Data MODEL)
Structuring Content in a Web Document
Android Project Structure, App Resources and Event Handling
Application Fundamentals
CMPE419 Mobile Application Development
CMPE419 Mobile Application Development
Presentation transcript:

Mobile Computing With Android ACST 4550 XML and the Android GUI

What is XML? eXtensible Markup Language Markup language for documents containing structured information Based on Standard Generalized Markup Language (SGML) Version 1.0 introduced by World Wide Web Consortium (W3C) in 1998 Bridge for data exchange on the Web

XML HTML XML to HTML Comparison Extensible set of tags Content orientated Standard Data infrastructure Allows multiple output forms Fixed set of tags Presentation oriented No data validation capabilities Single presentation

Authoring XML Elements An XML element is made up of a start tag, an end tag, and data in between. Example: <director> Matthew Dunn </director> Example of another element with the same value: <actor> Matthew Dunn </actor> XML tags are case-sensitive: <CITY> <City> <city> XML can abbreviate empty elements, for example: <married> </married> can be abbreviated to <married/>

Authoring XML Elements (cont’d) An attribute is a name-value pair separated by an equal sign (=). Example: <City ZIP=“94608”> Emeryville </City> Attributes are used to attach additional, secondary information to an element.

Authoring XML Documents A basic XML document is an XML element that can, but might not, include nested XML elements. Example: <books> <book isbn=“123”> <title> Second Chance </title> <author> Matthew Dunn </author> </book> </books>

XML Data Model: Example <BOOKS> <book id=“123” loc=“library”> <author>Hull</author> <title>California</title> <year> 1995 </year> </book> <article id=“555” ref=“123”> <author>Su</author> <title> Purdue</title> </article> </BOOKS> Purdue BOOKS 123 555 California Su title author article book year 1995 ref loc=“library” Hull

Apps – Android Manifest <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.helloandroid" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".HelloAndroid" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> @2011 Mihail L. Sichitiu

Apps – res (Resources) Folder anim drawable hdpi mdpi ldpi layout values arrays.xml colors.xml strings.xml xml raw

Apps – R.java Autogenerated, best if not manually edited gen/

Apps – View Hierarchy All the views in a window are arranged in a tree You show the tree by calling setContentView(rootNode) in the activity @2011 Mihail L. Sichitiu

Apps – Layout Defines how elements are positioned relative to each other (next to each other, under each other, in a table, grid, etc.) Can have a different layouts for each ViewGroup @2011 Mihail L. Sichitiu

Apps – Widgets All are View objects Examples: TextFields EditFields Buttons Checkboxes RadioButtons etc. @2011 Mihail L. Sichitiu

UI Events Usually handled by defining a Listener of the form On<something>Listener and register it with the View For example: OnClickListener() for handling clicks on Buttons or Lists OnTouchListener() for handling touches OnKeyListener() for handling key presses Alternatively, Override an existing callback if we implemented our own class extending View @2011 Mihail L. Sichitiu

Create the following Android App: SimpleCalculator Name your Activity: CalculatorActivity

You will create the following GUI: