Compsci 290.3, Spring 2017 Software Design and Implementation: Mobile Landon Cox Owen Astrachan

Similar documents
Programming with Android: SDK install and initial setup. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna

UTAH LEGISLATIVE BILL WATCH

Guide to Electronic Voting Election Runner

M-Polling with QR-Code Scanning and Verification

One View Watchlists Implementation Guide Release 9.2

This Week on developerworks: Ruby, AIX, collaboration, BPM, Blogger API Episode date:

Plan For the Week. Solve problems by programming in Python. Compsci 101 Way-of-life. Vocabulary and Concepts

BMI for everyone. Compsci 6/101: PFTW. Accumulating a value. How to solve an APT. Review how APTs and Python work, run

Estonian National Electoral Committee. E-Voting System. General Overview

Cloud Tutorial: AWS IoT. TA for class CSE 521S, Fall, Jan/18/2018 Haoran Li

Elections at Your Fingertips: App-ortunities to Connect with Wisconsin Voters

Expresso - O Popular INMA Awards 2015

Technology. Technology 7-1

CUG Members' Handbook

Atlanta Bar Association Website User s Guide

6. Voting for the Program will be available for five (5) weeks from Monday 13 June 2016.

User Guide. News. Extension Version User Guide Version Magento Editions Compatibility

TAFTW (Take Aways for the Week) APT Quiz and Markov Overview. Comparing objects and tradeoffs. From Comparable to TreeMap/Sort

Midas+ Seeker v2012 Enhancements and Open Forum. Jana Darnell, CPMSM, CPCS Product Manager, Midas+ Seeker

Panel 2: National Data Governance in a Global Economy

Hoboken Public Schools. Project Lead The Way Curriculum Grade 8

Aadhaar Based Voting System Using Android Application

Using Technology to Improve Jury Service 39

Online Voting System Using Aadhar Card and Biometric

CENTURYLINK ZONE USER AGREEMENT TERMS OF SERVICE

M-Vote (Online Voting System)

Areeq Chowdhury: Yeah, could you speak a little bit louder? I just didn't hear the last part of that question.

Product Description

Indirect sponsoring of the participation to scientific meetings JOINT INTRODUCTION OF A VISA APPLICATION

City of Toronto Election Services Internet Voting for Persons with Disabilities Demonstration Script December 2013

If you have questions about Speak Up or the contents of this packet, please contact the Speak Up team at

IBM Cognos Open Mic Cognos Analytics 11 Part nd June, IBM Corporation

Attorneys for Plaintiff GUILLERMO ROBLES UNITED STATES DISTRICT COURT CENTRAL DISTRICT OF CALIFORNIA-WESTERN DIVISION

Election Campaigner Through Android Application

AT&T. End User License Agreement For. AT&T WorkBench Application

OPEN SOURCE CRYPTOCURRENCY

Clause Logic Service User Interface User Manual

Hoboken Public Schools. PLTW Introduction to Computer Science Curriculum

JD Edwards EnterpriseOne Applications

TERMS AND CONDITIONS

January Authorization Log Guide

Terms of Service Last Updated:

Agreement for iseries and AS/400 System Restore Test Service

ELECTRONIC ARTS SOFTWARE END USER LICENSE AGREEMENT FOR ORIGIN APPLICATION AND RELATED SERVICES

Creating and Managing Clauses. Selectica, Inc. Selectica Contract Performance Management System

Public Libraries and Access to Justice: #2. The Role of Public Libraries

Strategic Partner Agreement Terms

End User License Agreement for the Accenture HCM Software App

ASK ALL: Q.1 Do you use any of the following social networking sites? [RANDOMIZE A-D FOLLOWED BY E-K, KEEP L LAST] Yes No No answer

Facebook Guide for State Legislators

END USER LICENSE AGREEMENT

Electronic Voting For Ghana, the Way Forward. (A Case Study in Ghana)

Zab Zab Application Privacy Policy Terms and Conditions

Open Data Kit (ODK) Mobile Data Collection, Aggregation, and Dissemination

Mojdeh Nikdel Patty George

HOW TO RUN AN ONLINE ELECTION

Review: Background on Bits. PFTD: What is Computer Science? Scale and Bits: Binary Digits. BIT: Binary Digit. Understanding scale, what does it mean?

Electronic Voting and Civil Referendums in Hong Kong

Final Review. Chenyang Lu. CSE 467S Embedded Compu5ng Systems

FAMILYSEARCH COMPATIBLE PRODUCT AFFILIATE AGREEMENT

AeroScout App End User License Agreement

Creating a Criminal Appeal and documents in ecourts Appellate

Voter Experience Survey November 2016

The Pupitre System: A desk news system for the Parliamentary Meeting rooms

Mobil Serv Lubricant Analysis Sample Scan Application: Terms of Use Agreement

PCGENESIS PAYROLL SYSTEM OPERATIONS GUIDE

X.Org Development Discussion Continues. Related Topics: Related Articles. Daylife Publishers Log In. Blog Developers Publishers

TERMS OF SERVICE FOR SUPPORT NETWORK COMMUNITY HEART AND STROKE REGISTRY SITE Last Updated: December 2016

Campaign Training: VoteBuilder Overview

Strengthen Stewardship With Electronic Giving

Inviscid TotalABA Help

RateForce, LLC Terms of Use Agreement

Independent Software vendor (ISV) Terms for Plugin Development & Plugin Submission

Terms of Service Last Updated: 6/19/2018

Privacy Policy & EULA: Symphony and Symphony Pro Last Updated October 12, 2018

NetTest A European Solution from Austria for measuring Broadband Quality SERENTSCHY.COM ADVISORY SERVICES GMBH

3. Requirements and Limitations. Your use of Shutterfly Open API is subject to the following limitations:

College Voting in the 2018 Midterms: A Survey of US College Students. (Medium)

Reuters Digital News Report Questionnaire 2018

Cadac SoundGrid I/O. User Guide

bitqy The official cryptocurrency of bitqyck, Inc. per valorem coeptis Whitepaper v1.0 bitqy The official cryptocurrency of bitqyck, Inc.

Objec&ves. Review. So-ware Quality Metrics Sta&c Analysis Tools Refactoring for Extensibility

CSE 308, Section 2. Semester Project Discussion. Session Objectives

MOBILE / COMPUTER APPLICATION END-USER LICENCE AGREEMENT

USER AGREEMENT FOR AMERICAN HEART ASSOCIATION HEALTHY FOR GOOD

LME App Terms of Use [Google/ Android specific]

[(Sexy and Confident: How To Be The Dreamgirl Men Want, Have a Better Life and Improve Your Self-Esteem)] [Author: Ash Green] published on (May, 2009)

DevOps Course Content

Terms of Use When you Access FoodSwitch you agree to these Terms of Use ("Terms"). General Terms and Conditions of Use

Inviscid TotalABA Help

Jussi T. Lindgren, PhD Lead Engineer Inria

1. Definitions. In addition to terms defined elsewhere in this Agreement, the terms set forth immediately below have the following meanings.

Kupindo API Terms and Conditions

Fall Detection for Older Adults with Wearables. Chenyang Lu

UNITED STATES DISTRICT COURT WESTERN DISTRICT OF WASHINGTON AT SEATTLE ORDER. THIS MATTER comes before the Court on Defendant s Motion to Dismiss

ApplyTexas Updates Application Cycle

END-USER LICENSE AGREEMENT

Electoral Reform Proposal

Sage 100 Fund Accounting. Bank Reconciliation STUDENT WORKBOOK SAGE LEARNING SERVICES. Important Notice:

Approved for Public Release. Distribution Unlimited. PRS Case number: The MITRE Corporation. All rights reserved.

Transcription:

Compsci 290.3, Spring 2017 Software Design and Implementation: Mobile Landon Cox Owen Astrachan http://www.cs.duke.edu/courses/spring17/compsci290.3 See also Sakai @ Duke for all information Compsci 290.3/Mobile, Spring 2017 2.1

Hello! About me Ø Duke undergrad Ø Michigan PhD Ø Sabbatical at Facebook Research interests Ø OS, distributed systems Ø Privacy and security Ø Moving into robotics Compsci 290.3/Mobile, Spring 2017 2.2

Hello! About me Ø Schools with the letter 'D' Ø Lots of Duke Connections Ø Google v Oracle Research interests Ø Astrachan's Law Ø Teaching Computer Science K-12, College Ø Design Patterns resurfacing Compsci 290.3/Mobile, Spring 2017 2.3

Where does 290.3 Fit? Alternative to 308: Software Design and Implementation (Mobile) Ø Many concepts are the same Ø Platform is different Ø Many issues in mobile aren't on the desktop (more later) Fit into curriculum Ø Design and deliver in teams is good for Ø Good design comes from experience, experience comes from bad design (attributed to many) Compsci 290.3/Mobile, Spring 2017 2.4

Goals and Learning Objectives Turn ideas and specifications into working, mobile Android applications Work collaboratively on a small team Leverage and demonstrate understanding of tradeoffs in creating code for mobile device(s) from software perspective Demonstrate understanding of privacy and security concerns related to mobile apps More Compsci 290.3/Mobile, Spring 2017 2.5

Administrivia We will have readings for the course, these will be online Ø synched with 308 when feasible/possible Books completely optional, lots of material on the web, but books can be very useful Projects, groups, midterm, final Compsci 290.3/Mobile, Spring 2017 2.6

Format of Today's Class Android concepts Ø These are specific to 290.3 (compared to 308) Java concepts Ø Reminder of how Java works, Java the language compared to Java the platform Software Design concepts Ø Not particular to Android, nor to Java, but expressed in terms that leverage those platforms Compsci 290.3/Mobile, Spring 2017 2.7

Android Button Button "is-a" View Ø https://developer.android.com/reference/androi d/widget/button.html Ø What does "is-a" mean here? It's all about inheritance. See Android documentation for View What can you do with a view? What shouldn't you do with a view? Ø Yes create Listener, no drawing/layout Compsci 290.3/Mobile, Spring 2017 2.8

Event Handler aka Event Listener Pressing a button creates an event Ø Program processes the event, similar to other views, e.g., menu, scroller, spinner, Ø Sensors (android.hardware) also have associated event listeners Must associate click/press with button/widget Ø Attach an EventListener and write code to process event Compsci 290.3/Mobile, Spring 2017 2.9

How are buttons/widgets displayed? Layout for app is specified in.xml file Ø More details can be found in documentation, e.g., https://developer.android.com/guide/topics/ui/d eclaring-layout.html How is layout associated with program? Ø See the oncreate method for your application and note that it has two statements Compsci 290.3/Mobile, Spring 2017 2.10

Events via XML and AndroidStudio Two "views" of XML Ø Text and Design Ø Use either/both Event Processed Ø Use AndroidStudio!! Compsci 290.3/Mobile, Spring 2017 2.11

Project 0 specification One method to process all buttons Ø Determine which Button was clicked by asking the button its identifier Ø Using the generated/debug class R.java Ø Switch on the int value of the button's id For small programs, maybe viable, but switch statements like this not ideal Ø Quickly become unwieldy Ø Don't support "Open Closed Principle" design Compsci 290.3/Mobile, Spring 2017 2.12

Listener Alternatives Each button has its own method Ø Specify using layout XML, combine design and text view Ø Right click to get properties, e.g., in Design view Ø Use AndroidStudio autosuggest for method Let's refactor the code for Project 0 Ø Refactoring is very important design idea! Compsci 290.3/Mobile, Spring 2017 2.13

Create Listener Programmatically Rather than using the XML layout manager/specification Ø Create button listeners in code/program Ø Similar to JavaFX, Other GUI systems https://developer.android.com/reference/android/w idget/button.html Ø Dissect the code in this example, what does findviewbyid return? Ø Why is cast necessary? Ø How is listener object created? Compsci 290.3/Mobile, Spring 2017 2.14

Java: Anonymous Inner Class Button example uses OnClickListener interface Ø What's an interface? Ø Specify methods without implementation, just the method signature Anonymous means: class not named, must implement the required method Ø Always use @Override Compsci 290.3/Mobile, Spring 2017 2.15

Recall: Button is a View, a Widget Connecting widgets with code Ø XML Design, each has a unique ID, int value Ø The value should be generated automatically based on @id text label Ø Access this int value using R.id.unique_label View/Widget must be cast to actual type Ø Button b = (Button) findviewbyid(57); Ø Won't ever use 57, but R.id.button_gallery Compsci 290.3/Mobile, Spring 2017 2.16

What is Android? How does Java work with Android? Ø It's a little complicated, sort of, maybe Ø Java language, Java bytecode, Dalvik bytecode Ø Android Runtime (ART) processes bytecode Java Libraries, Android Libraries Ø Android is a mobile platform, requires libraries specific to mobile Ø Intellectual Property issues at play as well Compsci 290.3/Mobile, Spring 2017 2.17

Android Architecture Compsci 290.3/Mobile, Spring 2017 2.18

Android Specifics Creating a AVD requires specifying OS Ø http://www.bidouille.org/misc/androidcharts What version should you use? Ø It depends? Ø KitKat? Lollipop? Marshmallow? Nougat? Why don't all phones run same version? Ø Can all phones run the same version? Stock versus customized: Open Source Compsci 290.3/Mobile, Spring 2017 2.19

Why Use Android? By far the most widely deployed mobile and OS in the world Ø Maybe not at Duke, but We can use Java (the language) to develop Ø Familiar, widely documented, many tools Open Source and Open Ø Customizable OS and libraries, e.g. Samsung Ø Easier to deploy to phone/app Store Compsci 290.3/Mobile, Spring 2017 2.20

Loose Coupling: OO Design We want classes to be loosely coupled Ø Independent of each other in that they interact via APIs Ø Changes in one class have minimal impact on other classes except via APIs and those should be changed infrequently Applications and programs change Ø Minimize the "ripple" effect through the system Compsci 290.3/Mobile, Spring 2017 2.21

High Cohesion: OO Design Classes capture one abstraction Ø Create more classes when you need them, don't be a class miser or misanthrope (word abuse) Keep things simple, strive for simplicity Ø Don't use Swiss-army knife approach, one tool for one purpose Loose coupling and high cohesion, goals for programming Compsci 290.3/Mobile, Spring 2017 2.22

Open Closed Principle Classes and Programs will be changed Ø Open to extension Ø Closed to modification What does this mean? Ø If not modified, don't need to be re-tested on a Unit testing basis Ø Extension can be by design, by language features Compsci 290.3/Mobile, Spring 2017 2.23

SOLID OO design Single Responsibility Principle Open/Closed Principle Liskov Substitution Principle Interface Segregation Principle Dependency Inversion Principle Ø We'll look at these in more detail, but these principles are in general widely accepted Ø Principles, not rules Compsci 290.3/Mobile, Spring 2017 2.24