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

Similar documents
Android Application Development

Creating a User Interface

Android HelloWorld - Example. Tushar B. Kute,

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

Android UI: Overview

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

Software Practice 3 Before we start Today s lecture Today s Task Team organization

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

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

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

Fragments. Lecture 11

Mobile Application Development Lab [] Simple Android Application for Native Calculator. To develop a Simple Android Application for Native Calculator.

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

Android Apps Development for Mobile and Tablet Device (Level I) Lesson 2

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

Android User Interface

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

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

Android Application Development. By : Shibaji Debnath

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

Android UI Development

Android User Interface Android Smartphone Programming. Outline University of Freiburg

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Saving State

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

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

ANDROID USER INTERFACE

Create new Android project in Android Studio Add Button and TextView to layout Learn how to use buttons to call methods. Modify strings.

CS 4330/5390: Mobile Application Development Exam 1

Android Programs Day 5

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

Group B: Assignment No 8. Title of Assignment: To verify the operating system name and version of Mobile devices.

GUI Widget. Lecture6

CS 403X Mobile and Ubiquitous Computing Lecture 3: Introduction to Android Programming Emmanuel Agu

Figure 2.10 demonstrates the creation of a new project named Chapter2 using the wizard.

Intents. Your first app assignment

CSE 660 Lab 3 Khoi Pham Thanh Ho April 19 th, 2015

Vienos veiklos būsena. Theory

INTRODUCTION TO ANDROID

CS 528 Mobile and Ubiquitous Computing Lecture 1b: Introduction to Android. Emmanuel Agu

Adaptation of materials: dr Tomasz Xięski. Based on presentations made available by Victor Matos, Cleveland State University.

14.1 Overview of Android

Mobile Application Development Android

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

Fragments. Lecture 10

Praktikum Entwicklung Mediensysteme. Implementing a User Interface

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Managing Screen Orientation

Android Basics. - Bhaumik Shukla Android Application STEALTH FLASH

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

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

Android development. Outline. Android Studio. Setting up Android Studio. 1. Set up Android Studio. Tiberiu Vilcu. 2.

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

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

Android Layout Types

Android Programming Lecture 2 9/7/2011

Chapter 8 Positioning with Layouts

Stanislav Rost CSAIL, MIT

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

Produced by. Mobile Application Development. Eamonn de Leastar

Diving into Android. By Jeroen Tietema. Jeroen Tietema,

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

Our First Android Application

Android Basics. Android UI Architecture. Android UI 1

Introductory Android Development

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

INTENTS android.content.intent

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

Mobile App Design Project Doodle App. Description:

Topics of Discussion

Android Development Crash Course

Mobile Software Development for Android - I397

IPN-ESCOM Application Development for Mobile Devices. Extraordinary. A Web service, invoking the SOAP protocol, in an Android application.

Lab 3. Accessing GSM Functions on an Android Smartphone

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

Upon completion of the second part of the lab the students will have:

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

COMP4521 EMBEDDED SYSTEMS SOFTWARE

Getting Started. Dr. Miguel A. Labrador Department of Computer Science & Engineering

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

Introduction to Android Development

Mobile User Interfaces

South Africa

ANDROID APPS (NOW WITH JELLY BEANS!) Jordan Jozwiak November 11, 2012

CS 234/334 Lab 1: Android Jump Start

CS 4518 Mobile and Ubiquitous Computing Lecture 4: WebView (Part 2) Emmanuel Agu

Chapter 2 Welcome App

<uses-permission android:name="android.permission.internet"/>

10.1 Introduction. Higher Level Processing. Word Recogniton Model. Text Output. Voice Signals. Spoken Words. Syntax, Semantics, Pragmatics

CS378 -Mobile Computing. User Interface Basics

Building MyFirstApp Android Application Step by Step. Sang Shin Learn with Passion!

Android Workshop: Model View Controller ( MVC):

Android. YÉÇàá. Victor Matos Cleveland State University

Basic GUI elements - exercises

CSE 660 Lab 7. Submitted by: Arumugam Thendramil Pavai. 1)Simple Remote Calculator. Server is created using ServerSocket class of java. Server.

Multiple devices. Use wrap_content and match_parent Use RelativeLayout/ConstraintLayout Use configuration qualifiers

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

Introduction To Android

Starting Another Activity Preferences

CS371m - Mobile Computing. User Interface Basics

Applied Cognitive Computing Fall 2016 Android Application + IBM Bluemix (Cloudant NoSQL DB)

Android Beginners Workshop

Transcription:

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

Android Operating System Created by Android, Inc. Bought by Google in 2005. First Android Device released in 2008 Based on Linux Core and Open Source Anybody can develop and release software or devices that use Android 64% of Market Share Worldwide in Mobile Devices Develop Apps in Java.

Control Model - View Control: User Input and Timed Events within the Software. Android Apps are Event Driven Model: The Data Structure of the objects and functions that govern the flow of action Retrieves the Control Events Calculates State View: Retrieve State from the Model and Draw to the Screen

Android Application Android XML: User Interface Layout Objects User Sees and Interacts with Android Java: Models User Interface objects as Java Fields Functionality of App Responds to User Events Performs Calculations / Simulation Draws to Screen out outputs The XML and Java work together in an Android Applications

Android XML XML Extensible Markup Language Similar to HTML (A type of XML) Tags: Objects in XML Attributes: Properties that Describe the Tag Name, Size, Color, onclick events

Android XML Tags Set apart by < and /> signs Example: <Button /> Note that the < sign starts the tag. The tag must end with a /> symbol.

Android XML Attributes Attributes Describe the Tag: <Button android:id="@+id/buttonclear android:layout_width="match_parent android:layout_height="wrap_content android:onclick ="buttonclearclicked android:text="clear" />

Typical XML Attributes Name of Attribute android:id android:layout_width android:layout_height android:onclick android:text Purpose Name of UI object in other areas of the Andriod App Specifies the width of the object Specifies the height of the object Specifies the Java function that will be called when the UI object is clicked The text the User will see in the User Interface

Remember 2 Tag Structures: <TagName tag attributes... /> <TagName tag attributes... > </TagName> Slightly different structure. Still works in XML

Nested Tags Often, XML tags will nest inside each other. A parent Tag can hold other Tags inside. Used in layout control in Android Apps LinearLayout TableRow EditText Button TableRow Button

Nested Tag Example: <LinearLayout android:layout_width = match_parent android:layout_height = match_parent > <TableRow android:layout_width = match_parent android:layout_height = wrap_content > <Button android:id = @+id/button1 android:layout_width = wrap_content android:layout_height = wrap_content android:onclick = button01clicked android:text = Click Me! /> </TableRow> </LinearLayout>

Nested Tag Example 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/linearlayout1" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <TableRow android:layout_width="match_parent" android:layout_height="wrap_content" > <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onclick="button01clicked" android:text="click Me!" /> <Button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onclick="button02clicked" android:text="another Click" /> </TableRow> <TableRow android:id="@+id/tablerow1" android:layout_width="match_parent" android:layout_height="wrap_content" > <TextView android:id="@+id/textview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="textview" /> </TableRow> </LinearLayout>

Types of Tags UI Objects: Button TextView EditText SeekBar ImageView ImageButton Layout Objects: LinearLayout TableLayout RelativeLayout TableRow

Selected Android XML Files Name Location Description activity_main.xml res/layout UI Design for App main.xml res/menu Layout for Settings strings.xml res/values Defines Strings used across Application. In Large Apps storing UI strings makes translating App into other languages easier. AndroidManifest.xml res/ Holds Global settings for App. User Permissions and starting point for first Activity class when App is initiated by User.

XML Pitfalls Eclipse will not point out specific XML errors when compiling. If App mysteriously will not run check the XML for errors. The R class holds the references of all UI objects defined in your App. If the R class shows errors in Java look in the XML for syntax or logical errors.

Android ADK with Eclipse Package Explorer Coding Window Stack Trace and Error Log Outline View

Where Can I find: Name Description Location MainActivity.java activity_main.xml drawable raw Java programming. Functionality of App User Interface Design in XML Folder that holds image resources for App Folder that holds sound resources for App src/packagename/mainact ivity.java res/layout res/drawable (Note: you will have to create this folder) res/raw (Note: you will have to create this folder

Package Explorer Name MainActivity.java activity_main.xml drawable raw

Let s Start our First App Layout TextToSpeech App User Types in Message App will say it back Speak in other Languages UI Elements EditText Button LinearLayout TableRow

XML Layout for Text To Speech

Android Java The Activity class is the main structure within an Android Application. Activity will hold the UI objects and the code that Listens to User Events An Android App has at least one class that Extends the Activity Class

Key Functions in Activity class protected void oncreate(bundle bundle) This function is called when App is started. Initialize UI Fields and other Fields in this function Calls the super.oncreate(bundle) public boolean oncreateoptionsmenu(menu menu) Initializes settings menu. We will not use function this week protected void onpause() Actions to take when App is paused protected void onstop() Actions to take when App is stopped

Other Code in Activity Class Package name Identifies the App Package Import Statements Libraries brought into the Code

Example of Activity Class template

Each UI Object in Android Must: Be defined as a Tag in the layout XML Be declared as a Field or variable in Java Code The Field or variable in Java must be bound to the Tag object in XML. Done with a findviewbyid() function call. Usually in oncreate() Can be done on the fly or called in specific functions.

Let s Program the Text To Speech App! One Class: MainActivity.java extends Activity Fields private Button speak; private EditText entertext; private String phrase; private TextToSpeech speaker; Functions speak(view v) setgerman(view v) setfrench(view v) setenglish(view v)

Selected Data Types in Java Data Type Java Keyword Description Integer int Whole number Double double Large Decimal number Float float Decimal number String String Characters Character char Single character Boolean boolean True or False value

XML: layout_school.xml Multi View Design XML: layout_home.xml class MainActivity extends Activity Fields for layout_school Fields for layout_home oncreate() { view1(); } public void view1() { // Setup View 1 // Xml bindings View 1 } public void view2() { // Setup View 2 // Xml bindings View 2 } Button Events: public void changetoview1(view v) public void changetoview2(view v)