Android How to Program Presented by Thomas Bucag, Rob Goodfellowe, Samantha Tomeï ©1992-2013 by Pearson Education, Inc. All Rights Reserved.

Slides:



Advertisements
Similar presentations
CE881: Mobile and Social Application Programming Simon M. Lucas Menus and Dialogs.
Advertisements

HTML 5 and CSS 3, Illustrated Complete Unit K: Incorporating Video and Audio.
Mobile Computing Lecture#13. Lecture Contents 2 Widgets  Creating App Widget  Unsupported/Supported Views/Layouts  Widget Layout  Widget Settings.
Chapter 6 Jam! Implementing Audio in Android Apps.
Chapter 6: Jam! Implementing Audio in Android Apps.
(C) 2010 Pearson Education, Inc. All rights reserved. Java™ How to Program, 8/e.
Basic 2D Graphics in Android. Android Graphics Programming There are many ways to do graphics programming in Android – 2D vs. 3D – static vs. dynamic.
© by Pearson Education, Inc. All Rights Reserved.
Application Fundamentals. See: developer.android.com/guide/developing/building/index.html.
1 Frameworks. 2 Framework Set of cooperating classes/interfaces –Structure essential mechanisms of a problem domain –Programmer can extend framework classes,
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Chapter 2 Introduction to HTML5 Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
INTERNATIONAL SUMMER ACADEMIC COURSE UNIVESITY OF NIS ISAC – Android programming.
Lesley Bross, August 25, 2010 ArcGIS 10 Add-In Components and Controls.
JQuery CS 268. What is jQuery? From their web site:
9.1 © 2004 Pearson Education, Inc. Exam Planning, Implementing, and Maintaining a Microsoft Windows Server 2003 Active Directory Infrastructure.
Basic Drawing Techniques
 Understanding an activity  Starting an activity  Passing information between activities  Understanding intents  Understanding the activity lifecycle.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Bookstore Web Application Introducing Visual Web Developer 2008 Express and the.
CS5103 Software Engineering Lecture 08 Android Development II.
Chapter 5: Investigate! Lists, Arrays, and Web Browsers.
6-2 2D Graphics CSNB544 Mobile Application Development Thanks to Utexas Austin.
Getting to Know TiVo: The Home Media Engine (HME SDK) Eric M. Upchurch CS 525 Spring 2008.
Favorite Twitter® Searches App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
Tip Calculator App Building an Android App with Java © by Pearson Education, Inc. All Rights Reserved.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 5: Investigate! Android Lists, Arrays,
When you start Photo Story the title screen gives you three options. The following slides will illustrate the directions when “Begin a new story” has been.
Introduction to Matlab & Data Analysis
Doodlz App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
Frank Xu Gannon University.  Linear Layout  Relative Layout  Table Layout.
Marcel Casado NCAR/RAP WEATHER WARNING TOOL NCAR.
Developing the Game User Interface (UI) Lesson 5.
CHAPTER TEN AUTHORING.
SpotOn Game App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
CS378 - Mobile Computing Intents. Allow us to use applications and components that are part of Android System – start activities – start services – deliver.
Configuring Android Development Environment Nilesh Singh.
With Windows 7 Introductory© 2011 Pearson Education, Inc. Publishing as Prentice Hall1 Windows 7 Introductory Chapter 3 Advanced File Management and Advanced.
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
Java™ How to Program, 10/e © Copyright by Pearson Education, Inc. All Rights Reserved.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Introduction to Android (Part.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Bookstore Application: Middle Tier Introducing Code-Behind Files, Session State.
INSERT BOOK COVER 1Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Getting Started with VBA for Microsoft Office 2010 by.
IT533 Lectures ASP.NET AJAX.
Longhorn Search and Organize User And Developer Experience Paul Cutsinger – Lead Program Manager Kerem Karatal – Lead Program Manager Microsoft Corporation.
 2005 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Address Book Application Introducing Database Programming.
22 Copyright © 2009, Oracle. All rights reserved. Filtering Requests in Oracle Business Intelligence Answers.
Flag Quiz Game App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
Basic 2D Graphics in Android. Android Graphics Programming There are many ways to do graphics programming in Android – 2D vs. 3D – static vs. dynamic.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 10: Move! Creating Animation 1 Android.
By: Eliav Menachi.  Android custom 2D graphics library  OpenGL ES 1.0 for high performance 3D graphics.
CHAPTER 5 Graphics Drawing Audio. Chapter objectives: Learn to draw to a canvas Examine the process of adding drawn elements and UI controls to a layout.
The Flag Quiz app tests your ability to correctly identify 10 flags from various countries and territories.
The Doodlz app enables you to paint by dragging one or more fingers across the screen. The app provides options for setting the drawing color.
Editing a Twitter search. Viewing search results in a browser.
Chapter 5: Investigate! Lists, Arrays, and Web Browsers.
Android Application 2D Graphics cs.
Activities and Intents
Microsoft® PowerPoint® 2016
Mobile Application Development Chapter 4 [Android Navigation and Interface Design] IT448-Fall 2017 IT448- Fall2017.
Address Book App Android How to Program
Cannon Game App Android How to Program
Favorite Twitter Searches App
Android Topics Android Activity Lifecycle and Experiment Toast
CA16R405 - Mobile Application Development (Theory)
Enhanced Slideshow App
Presentation transcript:

Android How to Program Presented by Thomas Bucag, Rob Goodfellowe, Samantha Tomeï © by Pearson Education, Inc. All Rights Reserved.

 Objectives  Demo of the app/GUI design  Technology Overview  UML Diagrams  BitmapFactory  TransitionDrawable  MediaPlayer  Intents

© by Pearson Education, Inc. All Rights Reserved.

 Launching Intents that use built-in content providers  Specifying the GUI for an AlertDialog  Customizing the Layout for a ListActivity  Launch an Intent that returns a result  ArrayAdapter for a ListView  View-Holder Pattern  Notifying a ListView when its data source changes  Adding data to a GUI component for use in an event handler  Playing Music with a MediaPlayer  Loading Images with BitmapFactory  Cross fading between images with TransitionDrawable and BitmapDrawable Technology Overview

Class Overview Diagrams Generated by ObjectAid UML Explorer for Eclipse

Slideshow Class Diagrams Generated by ObjectAid UML Explorer for Eclipse

Slideshow Editor Class Class SlideshowEditor is-a ListActivity (List View) is-an Activity Diagrams Generated by ObjectAid UML Explorer for Eclipse Load BitmapFactory

Class SlideshowInfo, SlideshowPlayer SlideshowInfo is used by Slideshow Stores data for a single slideshow Diagrams Generated by ObjectAid UML Explorer for Eclipse

TransitionDrawable Class PictureTaker, MediaItem Diagrams Generated by ObjectAid UML Explorer for Eclipse

Bitmap Factory Used to create bitmap objects Used in this app to load from the device for use as thumbnails Package: android.graphics Extends: java.lang.Object.android.graphics.BitmapFactory Nested Class: BitmapFactory.Options Used in this case to configure the bitmaps, and downsample the images to save memory Helps prevent out of memory errors common with bitmaps Public Constructor: BitmapFactory() Public Methods: public static BitmapdecodeFile(String pathName) Since: API Level 1 Decode a file path into a bitmap. If the specified file name is null, or cannot be decoded into a bitmap, the function returns null. Parameters: pathName - complete path name for the file to be decoded. Returns the resulting decoded bitmap, or null if it could not be decoded. BitmapFactory.Options() - Create a default Options object, which if left unchanged will give the same result from the decoder as if null were passed. Source: android.developer.com retrieved 30 July 2012

TransitionDrawable extends LayerDrawable implements Drawable.Callback Hierarchy java.lang.Object android.graphics.drawable.Drawable android.graphics.drawable.LayerDrawable android.graphics.drawable.TransitionDrawable An extension of LayerDrawables that is intended to cross-fade between the first and second layer. To start the transition, call startTransition(int). To display just the first layer, call resetTransition(). It can be defined in an XML file with the element. Each Drawable in the transition is defined in a nested. For more information, see the guide to Drawable Resources. Source: android.developer.com retrieved 30 July 2012

TransitionDrawable Public Constructor: TransitionDrawable(Drawable[] layers) Create a new transition drawable with the specified list of layers (at least 2). Public Methods: draw(Canvas canvas): Draw in its bounds (set via setBounds) respecting optional effects such as alpha (set via setAlpha) and color filter (set via setColorFilter). setCrossFadeEnabled(boolean enabled): Enables or disables the cross fade of the drawables. isCrossFadeEnabled(): Indicates whether the cross fade is enabled for this transition. startTransition(int durationMillis): Begin the second layer on top of the first layer. XML Attributes android:top, :left, :right, :bottom - coordinate of the layer’s side. android:drawable - Drawable used to render the layer. android:id - Identifier of the layer. This can be used to retrieve the layer from a drawbable container. Source: android.developer.com retrieved 30 July 2012

Ability to play music and videos within an application  Import android.media.MediaPlayer  MediaPlayer vs SoundPool  Methods associated with MediaPlayer ◦ MediaPlayer//create new object ◦ setDataSource//obtain file location ◦ Prepare//prepares player ◦ seekTo//passes a time ◦ start//starts media player ◦ pause //pauses playback ◦ reset//resets media player ◦ release//releases resources ◦ setLooping//loop playback  Developer.android.com/reference/android/media/MediaPlayer.html MediaPlayer

Launching Intents that use built-in content providers  Specify the MIME type of data ◦ Activity that shows specified type of data (Fig. 12.4a) ◦ Activity-chooser dialog to select Activity to use (Fig. 12.5) Launch an Intent that returns a result  startActivity to launch Activity associated with each Intent ◦ Favorite Twitter Searches app returns from Browser ◦ Address Book app automatically returns to main Activity  startActivityForResult ◦ Refresh the Slideshow Activity’s ListView after the user edits a slideshow ◦ Refresh the SlideshowEditor Activity’s ListView after the user adds a new image to the slideshow ◦ Get the location of an image of music track the user added to a slideshow Intents

© by Pearson Education, Inc. All Rights Reserved.

Is a ListActivity Is an Activity

© by Pearson Education, Inc. All Rights Reserved.