Top Banner
Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama Department of Computer Science [email protected] http://www.cs.ua.edu/~gray
27

Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama.

Jan 12, 2016

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama.

Week 3: Android App Programming

Jeff Gray, Ph.D. - Associate ProfessorCarnegie Foundation Professor of the Year (Alabama, 2008)

University of AlabamaDepartment of Computer [email protected]://www.cs.ua.edu/~gray

Page 2: Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama.

• Today• General intro• Introduction to App Inventor• Various Demos and Hands-on Exercises• Lunch: Ms. Lynsey Dill

• Rest of week• See end of slides

Agenda for Week

Page 3: Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama.

Camp Introduction Liability forms Photos throughout the week Lunch each day – 11:30am-12:45pm

Today: Pizza lunch (Shelby 3438) Tue-Thu: Lunch in the Freshens Food Court Fri: Catered lunch

Restrooms USB Stick Assumption

Java background

Page 4: Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama.

Camp rules

Camp Rules No cell phone usage in class except for

emergencies No headphones while instructor is speaking No surfing the web or playing games during

lectures No food or drink are allowed in the lab Pay attention during class exercises; do not

jump ahead and let us know if you fall behind

Page 5: Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama.

• Bleeding edge – may encounter various “issues” throughout the week; App Inventor barely a year old

• Sharing of various Android phones• Much different than week 1

• Focus is on motivating you to practice Java on fun exercises

• Developing your own creativity while implementing a customized app

General Info

Page 6: Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama.

Why Smartphones?

Page 7: Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama.

Motivation: Teaching CS – 1980s style Typical example was text-based, trivial, and

uninspiring

Page 8: Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama.

Motivation: New and Exciting Contexts Media Computation (Georgia Tech)

Programming in a more exciting context by manipulating images and sounds

Robots Lego NXT

2D/3D Animation Environments Alice, Scratch, AgentSheets

Page 9: Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama.

Motivation: Newest Context Teen cell phone adoption at 84% March 3, 2011

Android marketshare (29%) passes Apple (27%) Android sales soar 888%

Social networking and crowd sourcing a daily activity

Increasing adoption of smartphones in science and medical applications

Page 10: Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama.

Android Overview

Page 11: Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama.

Brief History

2005 Google acquires startup Android Inc. to start Android

platform Work on Dalvik VM begins

2007 Open Handset Alliance announced Early look at SDK

2008 Google sponsors 1st  Android Developer Challenge T-Mobile G1 announced SDK 1.0 released Android released open source (Apache License) Android Dev Phone 1 released

Page 12: Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama.

Brief History cont. 2009

SDK 1.5 (Cupcake) new soft keyboard with an "Autocomplete" feature

SDK 1.6 (Donut) SDK 2.0/2.0.1/2.1 (Eclair)

Exchange support; refine UI Android runs on 3.5% of all smartphones

Gartner Inc. predicts 14% in 2012 2010

Nexus One released to the public SDK 2.2 (Froyo)

wifi tethering, Flash SDK 2.3 (Gingerbread)

refine UI; improve keyboard copy/paste

Q4 Android passes Symbia as best-selling smartphone platform 2011

SDK 3.0 (Honeycomb) Table only release; Motorola Xoom in 2 weeks

Ice-cream Sandwich (mid-2011)

http://en.wikipedia.org/wiki/Android_(operating_system)

Page 13: Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama.

Android Facts

From Wikipedia Modified version of Linux kernel Android is composed of 12 millions lines of code

3M SLOCs pertaining to XML 2.8M SLOCS in C 2.1M SLOCS in Java 1.75M SLOCS in C++

Linux kernel tensions Oracle lawsuit

Page 14: Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama.

Android Developer Challenge

http://code.google.com/android/adc/ 2008:

10 teams received $275k 10 teams received $100k Each of top 50 finalists received $25k

2009 10 first prizes at $100k 10 2nd prizes at $50k 10 3rd prizes at 25k Overall: 1st-$250k, 2nd- $50k, 3rd- $25k

Page 15: Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama.

Open Handset Alliance

Established November 2007 Competes against Microsoft, Apple, Nokia

(Symbia), Palm, RIM, and Samsung (Bada) Composed of 79 software and hardware

companies URLs:

http://www.openhandsetalliance.com/ http://en.wikipedia.org/wiki/Open_Handset_Alliance

Page 16: Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama.

Key Differences: Android vs. iPhone

iPhone OS is proprietary OS runs on iPhone or

iPod Touches only Apps written in Objective-

C Apple must approve all

apps Application Store Some apps are more

important than others (Safari is your browser)

Android OS is open source OS can be licensed for

any mobile device Apps written in Java No approval process for

apps Android Market All apps considered equal

(choose your browser)

Page 17: Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama.

What is Google Android?

A software stack for mobile devices that includes An operating system Middleware Key Applications

Uses Linux to provide core system services Security Memory management Process management Power management Hardware drivers

Page 18: Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama.

App Inventor Overview

Page 19: Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama.

App Inventor Overview URL: http://appinventor.googlelabs.com Purpose

Teaching Prototyping

Components of App Inventor Designer

GUI builder Block Editor

Provide behavior behind the GUI Based on MIT OpenBlocks and Scratch

Page 20: Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama.

App Inventor Overview

Page 21: Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama.

Installing and Running

http://appinventor.googlelabs.com/learn/setup/index.html#setupComputer Requires Java 1.6 Install App Inventor setup

App Inventor environment loads in a web browser Login using Google account

Run from a phone or the Android emulator Stores programs in the cloud

Page 22: Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama.

Designer Provides a WYSIWYG editor for designing the

visual parts of the app Also provides ability to attach non-visual

components

Page 23: Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama.

Blocks Editor Provides an ability to give behavior

to an app; the programming part Typical and expected basic

predefined constructs (logic, conditionals, iteration)

Ability to refer to the components and their properties from the Designer

Very similar to Scratch Built on Open Blocks library from MIT

Page 24: Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama.

Limitations

File I/O Custom objects Printing your code! Reliability

Page 25: Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama.

Examples Many tutorials available:

Developed by Dave Wolber (Univ. San Francisco) http://appinventor.googlelabs.com/learn/tutorials/index.html

Standard Google Kitty app (embarrassing!) http://appinventor.googlelabs.com/learn/setup/hellopurr/hellopurr

emulatorpart1.html

Other Examples Where’s My Car, No Text While Driving

Page 26: Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama.

Schedule Monday

Intro to App Inventor Think about an app idea

Tuesday More on App Inventor Java-based intro to writing Android Apps Prepare project presentation (3 minutes each)

Wednesday Start at 8:30am Project proposal presentation More Java-based Android Start project implementation

Page 27: Week 3: Android App Programming Jeff Gray, Ph.D. - Associate Professor Carnegie Foundation Professor of the Year (Alabama, 2008) University of Alabama.

Schedule Thursday

Project implementation Late Afternoon: CS AP GridWorld

Mr. Martin and Mrs. Woessner

Friday Project wrap-up and final presentations Lunch Say good-byes