Distributed Systems - Mertz & McCarthy

Similar documents
Mobile Application Development

Android Basics. Xin Yang

Tutorial #1. Android Application Development Advanced Hello World App

directory to "d:\myproject\android". Hereafter, I shall denote the android installed directory as

SDK Quick Start Guide

Hello World! Some code

Getting Started: Creating a Simple App

Android Introduction. Hello Mihail L. Sichitiu 1

TUTORIALS AND QUIZ ANDROID APPLICATION SANDEEP REDDY PAKKER. B. Tech in Aurora's Engineering College, 2013 A REPORT

Android Application Development: Hands- On. Dr. Jogesh K. Muppala

Building Your First App

Android Development Introduction CS314

Android 多 核 心 嵌 入 式 多 媒 體 系 統 設 計 與 實 作

Building an Android client. Rohit Nayak Talentica Software

ECWM511 MOBILE APPLICATION DEVELOPMENT Lecture 1: Introduction to Android

How to develop your own app

4. The Android System

ECWM511 MOBILE APPLICATION DEVELOPMENT Lecture 1: Introduction to Android

MMI 2: Mobile Human- Computer Interaction Android

Android For Java Developers. Marko Gargenta Marakana

Saindo da zona de conforto resolvi aprender Android! by Daniel Baccin

Mobile Application Development Android

Android Development. Marc Mc Loughlin

Developing Android Apps: Part 1

Università Degli Studi di Parma. Distributed Systems Group. Android Development. Lecture 2 Android Platform. Marco Picone

Basics of Android Development 1

Now that we have the Android SDK, Eclipse and Phones all ready to go we can jump into actual Android development.

Introduction to Android Development. Daniel Rodrigues, Buuna 2014

Presenting Android Development in the CS Curriculum

Software Environments of Smartphone Applications

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

Android Java Live and In Action

Introduction to Android Programming (CS5248 Fall 2015)

ELET4133: Embedded Systems. Topic 15 Sensors

Introduction to NaviGenie SDK Client API for Android

Hacking your Droid ADITYA GUPTA

Les Broadcast Receivers...

ODROID Multithreading in Android

Developing an Android App. CSC207 Fall 2014

Tutorial: Android Object API Application Development. SAP Mobile Platform 2.3

Tutorial: Setup for Android Development

Intro to Android Development 2. Accessibility Capstone Nov 23, 2010

2. Click the download button for your operating system (Windows, Mac, or Linux).

Android Mobile App Building Tutorial

Frameworks & Android. Programmeertechnieken, Tim Cocx

Chapter 2 Getting Started

App Development for Android. Prabhaker Matet

Creating a List UI with Android. Michele Schimd

Android Programming Tutorial. Rong Zheng

Lab 1 (Reading Sensors & The Android API) Week 3

ITG Software Engineering

Developing NFC Applications on the Android Platform. The Definitive Resource

Android Environment SDK

Tutorial: Android Object API Application Development. Sybase Unwired Platform 2.2 SP02

Android app development course

Android Development. 吳 俊 興 國 立 高 雄 大 學 資 訊 工 程 學 系

How To Develop Android On Your Computer Or Tablet Or Phone

ANDROID APP DEVELOPMENT: AN INTRODUCTION CSCI /19/14 HANNAH MILLER

Android Application Development

Overview. About Interstitial Ads: About Banner Ads: About Offer-Wall Ads: ADAttract Account & ID

Boardies IT Solutions Tel:

What is Android? originally purchased from Android, Inc. in 2005

Q1. What method you should override to use Android menu system?

Localization and Resources

Android Environment SDK

Android Development. Lecture AD 0 Android SDK & Development Environment. Università degli Studi di Parma. Mobile Application Development

Creating a 2D Game Engine for Android OS. Introduction

Praktikum Entwicklung von Mediensystemen (Android)

Login with Amazon Getting Started Guide for Android. Version 2.0

Android Fundamentals 1

Android for Java Developers OSCON Marko Gargenta Marakana

A Short Introduction to Android

ANDROID TUTORIAL. Simply Easy Learning by tutorialspoint.com. tutorialspoint.com

Basics. Bruce Crawford Global Solutions Manager

Table of Contents. Adding Build Targets to the SDK 8 The Android Developer Tools (ADT) Plug-in for Eclipse 9

Getting Started with Android

Advantages. manage port forwarding, set breakpoints, and view thread and process information directly

Introduction to Android

l What is Android? l Getting Started l The Emulator l Hello World l ADB l Text to Speech l Other APIs (camera, bitmap, etc)

Android Programming Basics

OpenCV on Android Platforms

Gauthier Picard. Ecole Nationale Supérieure des Mines

A software stack for mobile devices:

Getting started with Android and App Engine

INTRODUCTION TO ANDROID CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 11 02/15/2011

Android Programming: 2D Drawing Part 1: Using ondraw

CS506 Web Design and Development Solved Online Quiz No. 01

Enterprise Application Development In Java with AJAX and ORM

Lecture 1 Introduction to Android

Android Concepts and Programming TUTORIAL 1

CS 696 Mobile Phone Application Development Fall Semester, 2009 Doc 9 Location & Maps Sept 29, 2009

How To Develop An Android App On An Android Device

Android. Learning Android Marko Gargenta. Tuesday, March 11, 14

TomTom PRO 82xx PRO.connect developer guide

Programming with Android: System Architecture. Dipartimento di Scienze dell Informazione Università di Bologna

Wireless Systems Lab. First Lesson. Wireless Systems Lab

Arduino & Android. A How to on interfacing these two devices. Bryant Tram

Specialized Android APP Development Program with Java (SAADPJ) Duration 2 months

Hello World. by Elliot Khazon

Memory Management for Android Apps Patrick Dubroy May 11, 2011

Transcription:

Source: http://www.itu.int/en/itu-d/statistics/documents/facts/ictfactsfigures2015.pdf

Source: http://www.itu.int/en/itu-d/statistics/documents/facts/ictfactsfigures2015.pdf

Source: http://www.comscoredatamine.com/2013/12/amazon-ebay-drive-heavy-app-usage-while-multi-channel-retailers-rely-on-mobile-web/

Source:http://www.comscoredatamine.com/2012/10/mobile-phones-and-tablets-now-account-for-1-in-8-u-s-internet-page-views/

Source: http://www.comscore.com/insights/blog/number-of-mobile-only-internet-users-now-exceeds-desktop-only-in-the-u.s

In the foreseeable future, mobile devices will be the most prevalent way that people access the Internet, and therefore, distributed systems. Learning goals for today s class: 1. To understand mobile phones as components in a distributed system. I.e. as a distributed system is an application or service built from a set of heterogeneous computing systems that communicate by passing messages, a mobile phone is often one of those computing systems 2. To create a simple native mobile application that communicates with other systems in a distributed system. (In doing so, demystify mobile apps: they are just java programs like others we've built.)

An Android phone is just: a computer running Linux with networking capability some specialized hardware (phone, gps camera) and a software stack to support writing applications

Type of application Class? Method(s) to implement? Configuration information file? Plain Java Application Web Application Android Application

Type of application Class? Method(s) to implement? Configuration information file? Plain Java Application Any POJO main() None Web Application Android Application

Source: Head First Servlets and JSP by Basham, Sierra, & Bates 95-702 Distributed Systems 11

Type of application Class? Method(s) to implement? Configuration information file? Plain Java Application Any POJO main() None Web Application Extend HttpServlet doget(), init(), dopost(), etc. web.xml Android Application

An Android app with a user interface is called an Activity Android apps extend Activity or a subclass such as AppCompatActivity A basic Android app needs to only implement the oncreate() method Source: https://developer.android.com/reference/android/app/activity.html

AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="ds.cmu.edu.helloandroid > <application android:allowbackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsrtl="true" ds.cmu.edu.helloandroid.mainactivity android:theme="@style/apptheme"> <activity android:name=".mainactivity" android:label="@string/app_name" android:theme="@style/apptheme.noactionbar"> <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> </application> </manifest> ds.cmu.edu.helloandroid.mainactivity.java public class MainActivity extends AppCompatActivity { @Override protected void oncreate(bundle savedinstancestate) {

Type of application Class? Method(s) to implement? Configuration information file? Plain Java Application Any POJO main() None Web Application Extend HttpServlet doget(), init(), dopost(), etc. web.xml Android Application Extend Activity (or one of its subclasses such as AppCompatActivity) oncreate(), onpause(), etc. AndroidManifest.xml

Brief code introduction See video for full walkthrough

An Android app s UI is defined in xml files within the res directory Two editing modes: Design (WYSIWYG) Text (xml) The complete res directory is compiled from xml into Java classes that define the R object Therefore R. refers to UI elements defined in the res directory If R is undefined, it means the res xml has an error.

See Table 1 at: https://developer.android.com/guide/topics/resources/providing-resources.html Some key elements layout How UI are arranged (linear, grid, etc.) drawable Picture (bitmap) files (jpg, png, etc.) menu Application menus values Constant values such as static strings, colors, etc.

The global variable R refers to all UI resources. To set the UI layout: setcontentview(r.layout.activity_main); activity_main.xml would be in the res/layout directory To find UI elements, use findviewbyid: Button submitbutton = (Button)findViewById(R.id.submit); This would refer to a Button in the UI with the ID == submit

Roles User (person 1) UI (person 2) Scenario User tosses UI balls, which they process quickly and pass back. If one of the balls is something that takes a long time, then subsequent balls tossed from User are dropped while UI completes it. Have you experienced this? How can you solve it?

New role Helper (person 3) UI can pass off requests that will take a long time to Helper When Helper is finished, it can pass the results back to UI The screen is a data structure, you don t want multiple threads changing it. All UI changes should be done by the UI only

Comparison of latency, scaled to if a CPU cycle took 1 second Event Latency Scaled 1 CPU Cycle 0.3nsec 1 sec Main Memory 120nsec 6 min Solid State Disk 50 150 µsec 2 6 days Rotational Disk 1 10 ms 1 12 months Internet SF to NYC 40 ms 4 years Source: Systems Performance: Enterprise and the Cloud 1st Edition by Brendan Gregg, ISBN-13: 978-0133390094 Loading resources via the Internet can take a few hundred ms to a few seconds You do NOT want your UI waiting before it can respond to your scroll gesture or button click!

AsyncTask is a class that makes doing work in a helper thread easy. Create a class that extends AsyncTask Implement doinbackground and onpostexecute Instantiate the class, and call its execute method UI (Main) Thread onpreexecute() onpostexecute() Helper Thread doinbackground()

The Android developers have a set of videos. One is how to get started with Android Studio. https://www.youtube.com/watch?v=z98hxv9gmzy