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

Similar documents
INTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY

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

Android Software Development Kit (Part I)

Introduction to Android Application Development. Mike Kvintus Principal Engineer JDSU

Android Development Tutorial. Yi Huang

SHWETANK KUMAR GUPTA Only For Education Purpose

Android Overview. Francesco Mercaldo, PhD

Introduction to Android

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

Android App Development

Chapter 1 Hello, Android

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

Mobile and Ubiquitous Computing: Android Programming (part 1)

Mobile and Wireless Systems Programming

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

CS260 Intro to Java & Android 04.Android Intro

Syllabus- Java + Android. Java Fundamentals

Introduction To Android

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

Another difference is that the kernel includes only the suspend to memory mechanism, and not the suspend to hard disk, which is used on PCs.

DROID. By S.Gokulakrishnan AP/CSE SCSVMV

IJRDTM Kailash ISBN No Vol.17 Issue

Android App Development

Android Ecosystem and. Revised v4presenter. What s New

1. What are the key components of Android Architecture? 2. What are the advantages of having an emulator within the Android environment?

ANDROID SYLLABUS. Advanced Android

Android is a software stack for mobile devices and comprises middleware, operating system and core

Android - open source mobile platform

Lecture 1 - Introduction to Android

Android. (XKE Mars 2009) Erwan Alliaume.

Mobile Application Development - Android

Infrastructure Middleware (Part 3): Android Runtime Core & Native Libraries

Android Basics. - Bhaumik Shukla Android Application STEALTH FLASH

Developer s overview of the Android platform

CSCU9YH Development with Android

Mobile Computing. Introduction to Android

Introduction. Lecture 1. Operating Systems Practical. 5 October 2016

Chapter 2. Operating-System Structures

Abstract. 1. Introduction

Software Development & Education Center ANDROID. Application Development

IGEEKS TECHNOLOGIES. Software Training Division. Academic Live Projects For BE,ME,MCA,BCA and PHD Students

Real-Time Embedded Systems

Chapter 2: Operating-System Structures. Operating System Concepts 9 th Edit9on

Qt for Device Creation

SD Module- Android Programming

Android Internals and the Dalvik VM!

Kick Start your Embedded Development with Qt

Android. Operating System and Architecture. Android. Screens. Main features

Developing Applications for ios

CHAPTER 2: SYSTEM STRUCTURES. By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

Android App Development. Ahmad Tayeb

Introduction to Android

Chapter 2: Operating-System Structures

Embedded Systems Programming - PA8001

Introduction to Java. Lecture 1 COP 3252 Summer May 16, 2017

Chapter 2: Operating-System Structures. Operating System Concepts 9 th Edition

Operating System Services. User Services. System Operation Services. User Operating System Interface - CLI. A View of Operating System Services

ANDROID COURSE BROCHURE

Mobile Application Development

ios vs Android By: Group 2

Pro Android 2. Sayed Y. Hashimi Satya Komatineni Dave Mac Lean. Apress

Mobile Internet Devices and the Cloud

PHONE ALERT SYSTEM ANISHA RAYAPATI. B. Tech., Jawaharlal Technological University, 2010 A REPORT

ANDRIOD APPLICATION: FOR MONITORING AVAILABILITY OF FACULTY

Chapter 2: System Structures. Operating System Concepts 9 th Edition

EMBEDDED SYSTEMS PROGRAMMING Android NDK

Introduction to Mobile Application and Development

Xamarin. MS (IT), 4 th Sem. HOD, Dept. Of IT, HOW DOES XAMARIN WORKS?

Why Android? Why Android? Android Overview. Why Mobile App Development? 20-Nov-18

PAPER ON ANDROID ESWAR COLLEGE OF ENGINEERING SUBMITTED BY:

NTS A NAVIGATION TRACKER SYSTEM

ANDROID NATIVE APP: INTRODUCTION TO ANDROID. Roberto Beraldi

EMBEDDED SYSTEMS PROGRAMMING Application Basics

MARS AREA SCHOOL DISTRICT Curriculum TECHNOLOGY EDUCATION

Open Mobile Platforms. EE 392I, Lecture-6 May 4 th, 2010

COSC 3P97 Mobile Computing

1Hello, Android COPYRIGHTED MATERIAL

Android Programmierung leichtgemacht. Lars Vogel

Computer Science E-76 Building Mobile Applications

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

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

Introduction to Java Programming

Porting mobile web application engine to the Android platform

Current Trends in Native and Cross-Platform Mobile Application Development

Tizen Overview (Tizen Ver. 2.3)

Four Components of a Computer System

ATC Android Application Development

Android Programming in Bluetooth Cochlea Group

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

IJREAT International Journal of Research in Engineering & Advanced Technology, Volume 1, Issue 5, Oct-Nov, 2013 ISSN:

Android App Development Workshop

COLLEGE OF ENGINEERING, NASHIK-4

Android Online Training

BCA 6. Question Bank

COPYRIGHTED MATERIAL. Hello, Android

Introduction to Android

Introduction to Mobile Development

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

Architectural Support for Operating Systems. Jinkyu Jeong ( Computer Systems Laboratory Sungkyunkwan University

Android Training Overview (For Demo Classes Call Us )

Transcription:

CSCE 315: Android Lectures (1/2) Dr. Jaerock Kwon App Development for Mobile Devices Jaerock Kwon, Ph.D. Assistant Professor in Computer Engineering App Development for Mobile Devices Jaerock Kwon, Ph.D. Assistant Professor in Computer Engineering 1 Announcement 2 3 Announcement 2 Lecture 1 Introduction to Android

Today s Topics 4 5 Android Introduction Java crash course Android Android What is Android? 6 Android 7 An open source software stack that includes Operating system Linux operating system kernel that provides low level interface with the hardware, memory management, and process control. Middleware A run time to execute Android applications including Dalvik virtual machine and core libraries. Key mobile applications Email, SMS, PIM, web browser, and etc. Along with API libraries for writing mobile applications. Including open-source libraries such as SQLite, WebKit, and OpenGL ES. Open-source development platform for creating mobile applications. Android 5 Complete A complete set of software for mobile devices: an OS, middleware, and What key mobile is Android? apps. Open It was built to truly open. An open source software stack that includes Equal Operating system All Linux apps operating are created system equal. kernel that provides low level interface with the No hardware, different between memory management, the phone s core and apps process and control. third-party apps. Middleware Equal access to a phone s capabilities. A run time to execute Android applications including Dalvik virtual Breaking machine down and app core boundaries libraries. Key mobile applications Fast & easy app development Email, SMS, PIM, web browser, and etc. Along with API libraries for writing mobile applications. Including open-source libraries such as SQLite, WebKit, and OpenGL ES. 6

Android SDK Features No licensing, distributions, or development fees or release approval processes. GSM, EDGE, and 3G networks for telephony and data transfer Full multimedia hardware control APIs for using sensor hardware including accelerometer and the compass. APIs for location based services IPC Shared data storage Background applications and processes. Home screen widgets, Live Folders. 8 The Android SDK includes The Android APIs The core of the SDK 9 Development tools These tools let you compile and debug your app. The Android Virtual Device Manager and Emulator Android Emulator: You can see how your applications will look and behavior on a real Android device All Android applications run within Dalvik VM. Documentations Sample code No IDE from Google There is no dedicated IDE for Android from Google. Eclipse IDE: Android has a special plug-in for Eclipse IDE (ADT Plugin for Eclipse) for creating Introducing the Development Framework Android projects. ADT Plugin tightly integrates Eclipse with the Android Emulator and debugging tools. HTML5 WebKit-based web browser And many more Android SDK The Android SDK includes The Android APIs The core of the SDK 9 Development tools These tools let you compile and debug your app. The Android Virtual Device Manager and Emulator Android Emulator: You can see how your applications will look and behavior on a real Android device All Android applications run within Dalvik VM. Documentations Sample code No IDE from Google There is no dedicated IDE for Android from Google. Eclipse IDE: Android has a special plug-in for Eclipse IDE (ADT Plugin for Eclipse) for creating Introducing the Development Framework Android projects. ADT Plugin tightly integrates Eclipse with the Android Emulator and debugging tools. 10 Android Software Stack Android architecture 11

A set of C/C++ libraries used by various components of the Android system. System C library Tuned for embedded Linux-based devices Application Media Libraries Framework Based on PacketVideo's OpenCORE; the libraries support playback and recording of many popular audio and video formats, as well as static image files Surface Manager Android Manages offers access developers to the display the ability subsystem to build and seamlessly rich and composites innovative 2D applications. and 3D graphic layers from multiple applications Developers WebKit have full access to the same framework APIs used by the core applications. A modern web browser engine which powers both the Android browser and an embeddable web view Underlying SGL/ 3D libraries all applications is a set of services, including Views SGL: underlying 2D graphics engine can An implementation be used to build based an application, OpenGL ES including 1.0 APIs; lists, the libraries grids, text use boxes, either hardware buttons, and 3D even acceleration an embeddable (where available) web browser or the included, highly optimized 3D software rasterizer Content FreeType Providers bitmap and vector font rendering enable applications to access data from other applications (such as Contacts), or to SQLite share their own data A Resource A powerful Manager and lightweight relational database engine available to all applications provides access to non-code resources such as localized strings, graphics, and layout files A Notification Manager enables all applications to display custom alerts in the status bar An Activity Manager manages the lifecycle of applications and provides a common navigation backstack 12 Android includes a set of core libraries that most of the functionality available in the core libraries of the Java programming language. 13 Libraries Every Android app runs in its own process with its own instance of the Dalvik virtual machine. A set of C/C++ libraries used by various components of the Android system. The System Dalvik C library VM executes files in the Dalvik Executable (.dex) format. Tuned for embedded Linux-based devices Media Libraries Based on PacketVideo's OpenCORE; the libraries support playback and recording of many popular audio and video formats, as well as static image files Surface Manager Manages access to the display subsystem and seamlessly composites 2D and 3D graphic layers from multiple applications WebKit A modern web browser engine which powers both the Android browser and an embeddable web view SGL/ 3D libraries SGL: underlying 2D graphics engine Kettering University An implementation based on OpenGL ES 1.0 APIs; the libraries use either hardware 3D acceleration (where available) or the included, highly optimized 3D software rasterizer FreeType bitmap and vector font rendering SQLite A powerful and lightweight relational database engine available to all applications Android Run-time 14 15 Android includes a set of core libraries that most of the functionality available in the core libraries of the Java programming language. Every Android app runs in its own process with its own instance of the Dalvik virtual machine. The Dalvik VM executes files in the Dalvik Executable (.dex) format. Android Run-time Android includes a set of core libraries that most of the functionality available in the core libraries of the Java programming language. 14 Every Android app runs in its own process with its own instance of the Dalvik virtual machine. Java Crash Course The Dalvik VM executes files in the Dalvik Executable (.dex) format.

No code outside of the class definition. Java Single inheritance only. 16 Java language 17 Only one top level public class in a file The file name should be same as the public class name. A programming language Syntax is very similar to C++ but different! A virtual platform Java virtual machine is a software machine or hypothetical chip. Note: The Dalvik virtual machine in Android is optimized for small footprint machine. Bytecodes (cross-platform binary code).class binary file of bytecodes No code outside of the class definition. Single inheritance only. Only one top level public class in a file The file name should be same as the public class name. Kettering A class University libraries APIs for GUI, data storage, I/O, networking, and etc. Java Bytecode &Virtual Machine 18 Package and Reference 19 Bytecode (the class file)is an intermediate representation of the program. 17 Java language You can consider bytecode as the machine code of the Java Virtual Machine. Java interpreter starts up a new virtual machine when it runs a Java No code outside of the class definition. bytecode. Single inheritance only. Only one top level public class in a file The file name should be same as the public class name. Packages and import A package is a bunch of classes and interfaces. Java Bytecode &Virtual Machine Library of classes You can import packages that you need. Example) import android.os.bundle Bytecode (the class file)is an intermediate representation of the Reference program. You No pointers! can consider bytecode as the machine code of the Java Virtual Machine. Java doesn t have pointer variables. Reference variables are equivalent in concept. Java interpreter starts up a new virtual machine when it runs a Java bytecode. Objects and Arrays are reference types Primitive types are stored as values 18

Creating Objects Point p; Note for C++ programmer. This doesn t create the object of Point class unlike in C/C++. This is only declaration of a variable. Remember there is no pointer in Java. Point p = new Point(1, 2); This allocates an object. Garbage collector It reclaims unused memory. You don t need to free unused objects. 20 Primitive type: Pass by value: Reference The called method has a copy of the value. The method cannot pass changed value in the argument to the caller. Example Reference type: int Pass by x = reference: 10; int The y called = x; method has a copy of the reference. // The x method has a separate accesses the memory same space object! from y Point p = new Point(1, 2); Point q = p; // q is a reference to p; // there is only one copy of Point object in the memory 21 Passing Arguments 22 Inheritance 23 Primitive type: Pass by value: Reference The called method has a copy of the value. The method cannot pass changed value in the argument to the caller. Example Reference type: int Pass by x = reference: 10; int The y called = x; method has a copy of the reference. // The x method has a separate accesses the memory same space object! from y Point p = new Point(1, 2); Point q = p; // q is a reference to p; // there is only one copy of Point object in the memory 21 Keyword extends to inherit from a superclass. Example package edu.kettering.hellokettering; import android.app.activity; import android.os.bundle; public class HelloKettering extends Activity { /** Called when the activity is first created. */ @Override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); } }

Create a sample project Developing for Mobile Apps 24 Small and portable mobile devices Offer exciting opportunities for software development. But consider limitations Low processor power Limited RAM/permanent storage capacity Small screen size High costs associated with data transfer Slow data transfer rates with high latency Unreliable data connections Battery life! 25 Designing for Android Performance Responsiveness Seamlessness Developing for Mobile Apps Design Considerations 26 Designing for Performance 27 Small and portable mobile devices Offer exciting opportunities for software development. But consider limitations Low processor power Limited RAM/permanent storage capacity Small screen size High costs associated with data transfer Slow data transfer rates with high latency Unreliable data connections Battery life! Designing for Android Performance Responsiveness Seamlessness Being fast and efficient Design Considerations http://developer.android.com/guide/practices/design/ performance.html Avoid creating short-tem temporary objects. Fewer objects created mean less-frequent garbage collection Small Avoid and internal portable getter/setters mobile devices Offer exciting opportunities for software development. Excellent habits for C++, but not for Android. But consider limitations Low Direct processor field access power is about 7x faster than invoking a trivial getter/setter. Use Limited static RAM/permanent final for constants storage capacity Use Small enhance screen for size loop syntax High costs associated with data transfer Slow data transfer rates with high latency Unreliable data connections Battery life! Designing for Android Performance 26

Your application can cause problems under the multitasking environment when you ignore seamlessness issues. Designing for Responsiveness Be a good citizen! Application Save instant Not state Responding (ANR) Keep in mind that Android is a mobile platform. Activity Manager and Window Manager monitor Another app can pop up any time over your own app application responsiveness. Use a thread when you need to do a lot. Android Avoid display the ANR. the ANR dialog when it detects one Use of multiple following screens conditions when necessary. No Design response your UI to to an work input with event multiple within screen 5 seconds resolutions A Assume BroadcastReceiver the network is slow hasn't finished executing within 10 seconds Don't assume touchscreen or keyboard How Do conserve to avoid the ANR? device battery When an Android app runs on a single thread, any lengthy operation (network, database, computationally expensive calculation) could invoke the ANR. Consider making a child thread to do the lengthy operation. 28 Designing for Seamlessness Your application can cause problems under the multitasking environment when you ignore seamlessness issues. Be a good citizen! Save instant state Keep in mind that Android is a mobile platform. Another app can pop up any time over your own app Use a thread when you need to do a lot. Avoid the ANR. Use multiple screens when necessary. Design your UI to work with multiple screen resolutions Assume the network is slow Don't assume touchscreen or keyboard Do conserve the device battery 29 30 Designing for Seamlessness 29 30 Your application can cause problems under the multitasking environment when you ignore seamlessness issues. Be a good citizen! Save instant state Keep in mind that Android is a mobile platform. Another app can pop up any time over your own app Use a thread when you need to do a lot. Avoid the ANR. Use multiple screens when necessary. Kettering Design University your UI to work with multiple screen resolutions Assume the network is slow Questions? Questions?