COSC 3P97 Mobile Computing

Similar documents
Understanding Application

Introduction to Android

CS378 -Mobile Computing. Anatomy of and Android App and the App Lifecycle

CS 528 Mobile and Ubiquitous Computing Lecture 3b: Android Activity Lifecycle and Intents Emmanuel Agu

CS378 - Mobile Computing. Anatomy of an Android App and the App Lifecycle

Application Fundamentals

Introduction To Android

Understand applications and their components. activity service broadcast receiver content provider intent AndroidManifest.xml

Android App Development. Muhammad Sharjeel COMSATS Institute of Information Technology, Lahore

MARS AREA SCHOOL DISTRICT Curriculum TECHNOLOGY EDUCATION

Minds-on: Android. Session 1

Mobile Application Development - Android

Introduction to Android

CS 4518 Mobile and Ubiquitous Computing Lecture 5: Rotating Device, Saving Data, Intents and Fragments Emmanuel Agu

Android App Development. Ahmad Tayeb

Lab 1: Getting Started With Android Programming

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

Android Fundamentals - Part 1

Mobile development initiation

ANDROID DEVELOPMENT. Course Details

Android for Ubiquitous Computing Researchers. Andrew Rice University of Cambridge 17-Sep-2011

EMBEDDED SYSTEMS PROGRAMMING Application Basics

Mobile Computing. Introduction to Android

Android App Development

Android. Mobile operating system developed by Google A complete stack. Based on the Linux kernel Open source under the Apache 2 license

Introduction to Android

CS 4518 Mobile and Ubiquitous Computing Lecture 4: Data-Driven Views, Android Components & Android Activity Lifecycle Emmanuel Agu

Android. Lesson 1. Introduction. Android Developer Fundamentals. Android Developer Fundamentals. to Android 1

Minds-on: Android. Session 2

Developing Applications for ios

Embedded Systems Programming - PA8001

ACTIVITY, FRAGMENT, NAVIGATION. Roberto Beraldi

Configuring the Android Manifest File

Real-Time Embedded Systems

Mobile OS. Symbian. BlackBerry. ios. Window mobile. Android

Android App Development for Beginners

Android App Development

ANDROID SYLLABUS. Advanced Android

Introduction What is Android?

CS260 Intro to Java & Android 04.Android Intro

BCA 6. Question Bank

Introduction to Android development

Praktikum Mobile und Verteilte Systeme. Android-Basics. Prof. Dr. Claudia Linnhoff-Popien André Ebert, Sebastian Feld

Android Online Training

Android Overview. Most of the material in this section comes from

COLLEGE OF ENGINEERING, NASHIK-4

IJRDTM Kailash ISBN No Vol.17 Issue

Android Software Development Kit (Part I)

Android System Architecture. Android Application Fundamentals. Applications in Android. Apps in the Android OS. Program Model 8/31/2015

Android-Basics. Praktikum Mobile und Verteilte Systeme. Prof. Dr. Claudia Linnhoff-Popien André Ebert, Sebastian Feld

Android Basics. Android UI Architecture. Android UI 1

Android Programmierung leichtgemacht. Lars Vogel

CS 528 Mobile and Ubiquitous Computing Lecture 4a: Fragments, Camera Emmanuel Agu

Introduction to Android Android Smartphone Programming. Outline University of Freiburg. What is Android? Background University of Freiburg.

Mobile and Wireless Systems Programming

Chapter 1 Hello, Android

Lecture 2 Android SDK

CS 370 Android Basics D R. M I C H A E L J. R E A L E F A L L

Lecture 1 Introduction to Android. App Development for Mobile Devices. App Development for Mobile Devices. Announcement.

UNDERSTANDING ACTIVITIES

Activities and Fragments

University of Babylon - College of IT SW Dep. - Android Assist. Lect. Wadhah R. Baiee Activities

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

Course Syllabus. Course Title. Who should attend? Course Description. Android ( Level 1 )

Chapter 2 Setting Up for Development

Computer Science E-76 Building Mobile Applications

Multiple Activities. Many apps have multiple activities

SHWETANK KUMAR GUPTA Only For Education Purpose

Android Development Tools = Eclipse + ADT + SDK

(Refer Slide Time: 0:48)

Android Ecosystem and. Revised v4presenter. What s New

Basic Android Setup for Machine Vision Fall 2015

Android" Application Development SAMS. Sams Teach Yourself. Shane Conder. Lauren Darcey. Second Edition

Introduction to Mobile Application and Development

An Introduction to Android. Jason Chen Developer Advocate Google I/O 2008

Android-Basics. Praktikum Mobile und Verteilte Systeme

ECOM 5341 Mobile Computing(Android) Eng.Ruba A. Salamah

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

Lab 4 In class Hands-on Android Debugging Tutorial

MC Android Programming

Android Programming in Bluetooth Cochlea Group

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

Syllabus- Java + Android. Java Fundamentals

Java Training Center - Android Application Development

Android Overview. Francesco Mercaldo, PhD

LECTURE NOTES OF APPLICATION ACTIVITIES

Android Essentials with Java

Android App Development Workshop

Agenda. Overview of Xamarin and Xamarin.Android Xamarin.Android fundamentals Creating a detail screen

Mobile Programming Lecture 1. Getting Started

Lecture 08. Android Permissions Demystified. Adrienne Porter Felt, Erika Chin, Steve Hanna, Dawn Song, David Wagner. Operating Systems Practical

Installing and configuring an Android device emulator. EntwicklerCamp 2012

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

Pemrograman Mobile. Lesson 1. Introduction to Android. Create Your First Android App. Nizar Rabbi Radliya

Developer s overview of the Android platform

PAPER ON ANDROID ESWAR COLLEGE OF ENGINEERING SUBMITTED BY:

Activities. Repo:

Applications. Marco Ronchetti Università degli Studi di Trento

ios vs Android By: Group 2

INTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY

Transcription:

COSC 3P97 Mobile Computing Mobile Computing 1.1

COSC 3P97 Prerequisites COSC 2P13, 3P32 Staff instructor: Me! teaching assistant: Steve Tkachuk Lectures (MCD205) Web COSC: http://www.cosc.brocku.ca/ COSC 3P97: http://www.cosc.brocku.ca/offerings/cosc3p97/ Email efoxwell@brocku.ca Mobile Computing 1.2

Course Procedures Outline Text Software Android Studio Let s see what s behaving to decide the rest? Assignments Project pairs proposal platform presentation petunias Presentation Lecture Schedule Mobile Computing 1.3

Mobile Computing Software development for mobile equipment smartphones, tablets should these be treated as the same thing? Constraints/Considerations differ from desktop systems think of what the touch/mouse difference alone entails maybe we should have a quick chat? typically power consumption screen real estate including size, aspect ratio, and pixel density security model (sandbox) unexpected interruption of execution extended running time Mobile Computing 1.4

Marketplace Platforms Android, ios, Windows Phone, Blackberry Apps smaller, cheaper, wider distribution marketplaces run by drivers of platform differing levels of control/validation private individuals to large corporations Mobile Computing 1.5

Android Driven by Google Open Handset Alliance (OHA) multiple H/W vendors many different configurations Built around open-source and international standards Java, XML, LINUX, Open GL ES, SQLite, no licensing fees for development multi-platform development (Windows, OSX and LINUX) Now a mature platform Mobile Computing 1.6

Android Platform Runs on Linux OS each application runs as a separate user kernel provides core functions e.g. permissions & security, memory management, threading, network stack, H/W access Dalvik/ART VM each application runs on its own instance of VM Access to services/data/personal info e.g. browser, contacts, phone, permissions (granted by user on install) via managers e.g. LocationManager, AudioManager apps can share data with other apps Mobile Computing 1.7

Development Environment Typically Android Studio (based on IntelliJ) For instructions see: http://developer.android.com/sdk/index.html Components Java JDK (ish) also, note that this isn t mandatory, but Java is typically going to be the easier alternative SDK manager in the lab, you need to change the SDK location! download/update SDK components platforms at least API 8 (2.2) and a recent one (e.g. API 23/6/M) after install, check for updates be EXTREMELY careful with this! Mobile Computing 1.9

Testing Environment Emulator emulators for various generic Android devices (API levels) AVD (Android Virtual Device) Manager set up emulators for various API levels we need to look at this carefully reduce the available RAM you ll likely need to enable/install virtualization support I d suggest avoiding ARM On-device debugging need USB driver for device configure device select Unknown Sources and USB Debugging Mobile Computing 1.10

Development Demo Run Android Studio We ll create our first real project next week it has wizards to let you fill in details, and automatically creates many files for you Create an emulator AVD Manager ideally, you ll create only one and reuse it for the whole term Run on emulator Mobile Computing 1.11

Project Files Generated directories src/main project code source/main/java java code res resources /layout GUI GUI editor AndroidManifest project description Mobile Computing 1.12

Logging We ll look at logging later, but it s a powerful tool it can log multiple types of messages, which can then be separated or filtered as necessary this includes tracking multiple types of logs, potentially from different sources think of it as an improved System.err Import android.util (for Log class) Levels errors, warnings, information, debug, verbose Mobile Computing 1.13

Debugging Debug available as perspective in Eclipse breakpoints stepping through code examining variables DDMS (Monitor) perspective devices threads profiling screenshots Mobile Computing 1.14

Distribution Generate an Application Package (.apk) generates.dex code (Dalvik Executable) includes manifest has an unique ID (unchanged through releases) signed with a certificate since introduction of ART: https://source.android.com/devices/tech/dalvik/ Distributed Android Marketplace controlled by Google register as Android developer directly from developer you may need to enable Outside Sources to side-load Mobile Computing 1.15

Android Application Basics Mobile Computing 1.16

Foundational Classes Context android.content.context application-wide configuration and data instantiated as an Application object Activity android.app.activity single task in an application usually associated with a screen (UI) subclass of Context Fragment android.app.fragment new in Android 3.0 (11) single function (UI) within a task can be shared between activities Mobile Computing 1.17

Intent android.app.intent encapsulates an asynchronous message to/from another activity for inter-task communication/coordination Service android.app.service task without user interaction time-consuming or periodic tasks background subclass of Context Mobile Computing 1.18

Context Accessing (in Context) Context context = getapplicationcontext(); Access to resources getresources res directory R.java preferences simple shared application data (configuration, state) getsharedpreferences also: private files, assets, services, database, permissions Mobile Computing 1.19

Activity Typically one per task that has UI Handles interaction with one screen Must be defined in the manifest e.g. simple game splash screen main menu high scores, play, help Mobile Computing 1.20

Processes Multi-processing concurrent applications application can multi-process interrupts (e.g. phone call) foreground/background Activity is unit for multi-processing Activity stack though this is a slightly odd stack Application must manage resources and pause and resume seamlessly Mobile Computing 1.22

Activity Lifecycle States Callbacks Activity methods to be overridden should call superclass method oncreate(bundle savedinstancestate) first started or restarted after killed bundle may have state information if killed initial setup including setcontentview onresume() before becoming active obtain resources needed to run start resource hungry activities (e.g. audio play) Mobile Computing 1.24

onpause() about to move to background save resources loaded in resume stop resource hungry activities cleanup so less likely to be killed onstop() & ondestroy() not necessarily called example Mobile Computing 1.26

Fragment New in API 11 Subdividing UI processing compartmentalizing UI processing common UI between activities e.g. multi-function (drill down) in music player Mobile Computing 1.27

Intent Transitioning between activities permanent e.g. splash screen to main menu new activity takes over, previous discarded use startactivity and finish temporary e.g. main menu to functions expect to return (back) new activity pushed on top of previous use startactivityforresult and onactivityresult Mobile Computing 1.29

Intent object used to determine which activity to start used to pass data to activity Starting activity can start activity by name (class) can start activity by intent filter activities register intents they handle Passing data intent has associated bundle (called Extras) name/value pairs putextra and getextras Mobile Computing 1.30

Manifest XML file that defines the application Part of the package (.apk) that is generated from your project for distribution Describes properties for installation name & icon system requirements permissions registering components (activities, services etc.) Manifests are one of the biggest compatibility nuisances when upgrading Studio and APIs Mobile Computing 1.31

Identity Package name Version code vs name App name Icon Mobile Computing 1.33

System Requirements SDK version min backwards compatibility target most up-to-date max only in special cases Versions each API level affords new features you can use, but also shrinks the potential install base Mobile Computing 1.34

Platform Requirements Input uses-configuration keyboards, navigation devices, touch screen settings Features uses-feature optional device features/hardware Screen sizes and density supports-screens small/normal/large Note that resolution, by itself, isn t terribly descriptive, let alone helpful Mobile Computing 1.36

Activities Activities must be defined in the manifest to be used Must be within the package declared in the manifest dot notation or full pathname Primary entry point defined with an intent filter action: MAIN category: LAUNCHER Other intent filters can be specified to indicate that an activity, service or receiver can respond to implicit intents Mobile Computing 1.37

Permissions Access to shared resources e.g. contacts database, hardware such as camera Must be requested uses-permission upon install user must grant permission May not be enforced by all devices but request anyway Activities can also define and enforce their own permissions when used by other applications Mobile Computing 1.38