Технологии Java. Android: Введение. Кузнецов Андрей Николаевич. Санкт-Петербургский Государственный Политехнический Университет



Similar documents
Android Architecture Diagram:

An Introduction to Android

Remote Desktop on Mobile

Android Architecture. Alexandra Harrison & Jake Saxton

ECWM511 MOBILE APPLICATION DEVELOPMENT Lecture 1: Introduction to Android

The "Eclipse Classic" version is recommended. Otherwise, a Java or RCP version of Eclipse is recommended.

Introduction to Android

Reminders. Lab opens from today. Many students want to use the extra I/O pins on

Lecture 1 Introduction to Android

A Short Introduction to Android

Islamic University of Gaza. Faculty of Engineering. Computer Engineering Department. Mobile Computing ECOM Eng. Wafaa Audah.

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

Programming with Android

Running a Program on an AVD

Graduate presentation for CSCI By Janakiram Vantipalli ( Janakiram.vantipalli@colorado.edu )

Android Programming and Security

Introduction to Android Android Architecture Software Development Purpose of the project Location Based Service (LBS) Android. Location class Google

CS378 -Mobile Computing. Android Overview and Android Development Environment

Introduction to Android

An Introduction to Android Application Development. Serdar Akın, Haluk Tüfekçi

Fahim Uddin 1. Java SDK

ECWM511 MOBILE APPLICATION DEVELOPMENT Lecture 1: Introduction to Android

Introduction to Android: Hello, Android! 26 Mar 2010 CMPT166 Dr. Sean Ho Trinity Western University

Hacking your Droid ADITYA GUPTA

Introduction to Android Programming (CS5248 Fall 2015)

Android Development. Marc Mc Loughlin

Android Basics. Xin Yang

Overview of CS 282 & Android

ANDROID OPERATING SYSTEM

Getting Started with Android Development

Introduction to Android. Sean Sullivan October 27, 2008

The power of root on Android emulators

Università Degli Studi di Parma. Distributed Systems Group. Android Development. Lecture 1 Android SDK & Development Environment. Marco Picone

Android Geek Night. Application framework

Introduction to Android Development. Jeff Avery CS349, Mar 2013

Mobility Introduction Android. Duration 16 Working days Start Date 1 st Oct 2013

Android Environment SDK

As shown, the emulator instance connected to adb on port 5555 is the same as the instance whose console listens on port 5554.

Software development. Development requirements. Java. Android SDK. Eclipse IDE (optional)

Smartphone market share

Performance Analysis of Android Platform

Module Title: Software Development A: Mobile Application Development

Android Mobile App Building Tutorial

An Introduction to Android. Huang Xuguang Database Lab. Inha University

ITG Software Engineering

Mobile Phones Operating Systems

Here to take you beyond Mobile Application development using Android Course details

Getting started with Android and App Engine

What else can you do with Android? Inside Android. Chris Simmonds. Embedded Linux Conference Europe Copyright 2010, 2net Limited.

ANDROID PROGRAMMING - INTRODUCTION. Roberto Beraldi

Running Android Applications on BlackBerry 10 developer.blackberry.com/android

Android Application Development. Daniel Switkin Senior Software Engineer, Google Inc.

Friendly ARM MINI2440 & Dalvik Virtual Machine with Android

Google Android: An Emerging Innovative Software Platform For Mobile Devices

ANDROID PROGRAMMING - INTRODUCTION. Roberto Beraldi

ANDROID INTRODUCTION TO ANDROID

CS 528 Mobile and Ubiquitous Computing Lecture 2: Android Introduction and Setup. Emmanuel Agu

Jordan Jozwiak November 13, 2011

Android 5.0: Lollipop OS

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

Lab 4 In class Hands-on Android Debugging Tutorial

-Android 2.3 is the most used version of Android on the market today with almost 60% of all Android devices running 2.3 Gingerbread -Winner of

Introduction to Android

Development. SriSeshaa Technologies. Table of Contents

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

How To Run A Hello World On Android (Jdk) On A Microsoft Ds.Io (Windows) Or Android Or Android On A Pc Or Android 4 (

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

Basics. Bruce Crawford Global Solutions Manager

Introduction to Android. CSG250 Wireless Networks Fall, 2008

Android Programming: Installation, Setup, and Getting Started

Example of Standard API

ODROID Multithreading in Android

Android Setup Phase 2

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)

App Development for Smart Devices. Lec #2: Android Tools, Building Applications, and Activities

DEVELOPING MOBILE APPLICATIONS USING ANDROID

How To Develop Android On Your Computer Or Tablet Or Phone

Google s Android: An Overview

Programming with Android

Mobile Application Development 2014

Praktikum Entwicklung Mediensysteme (für Master)

MMI 2: Mobile Human- Computer Interaction Android

Overview. The Android operating system is like a cake consisting of various layers.

Intel Integrated Native Developer Experience (INDE): IDE Integration for Android*

1. Introduction to Android

Issues in Android on Mobile Platform and Their Resolution

Creating and Using Databases for Android Applications

Android Security Lab WS 2014/15 Lab 1: Android Application Programming

UNIVERSITY AUTHORISED EDUCATION PARTNER (WDP)

Chapter 2 Getting Started

Practical Android Projects Lucas Jordan Pieter Greyling

Tutorial on Basic Android Setup

COURSE CONTENT. GETTING STARTED Select Android Version Create RUN Configuration Create Your First Android Activity List of basic sample programs

OpenCV on Android Platforms

Building an Android client. Rohit Nayak Talentica Software

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

Lab 0 (Setting up your Development Environment) Week 1

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

Android 4.4 App Development Essentials

Android Tutorial. Larry Walters OOSE Fall 2011

Transcription:

Технологии Java Android: Введение Санкт-Петербургский Государственный Политехнический Университет Кузнецов Андрей Николаевич 1

2

Архитектура ОС Android See http://www.android-app-market.com/android-architecture.html 3

Linux Kernel The basic layer is the Linux kernel. The whole Android OS is built on top of the Linux 2.6 Kernel with some further architectural changes made by Google. It is this Linux that interacts with the hardware and contains all the essential hardware drivers. Drivers are programs that control and communicate with the hardware. For example, consider the Bluetooth function. All devices has a Bluetooth hardware in it. Therefore the kernel must include a Bluetooth driver to communicate with the Bluetooth hardware. The Linux kernel also acts as an abstraction layer between the hardware and other software layers. Android uses the Linux for all its core functionality such as Memory management, process management, networking, security settings etc. As the Android is built on a most popular and proven foundation, it made the porting of Android to variety of hardware, a relatively painless task. 4

Libraries The next layer is the Android s native libraries. It is this layer that enables the device to handle different types of data. These libraries are written in c or c++ language and are specific for a particular hardware. Some of the important native libraries include the following: Surface Manager: It is used for compositing window manager with offscreen buffering. Off-screen buffering means you cant directly draw into the screen, but your drawings go to the off-screen buffer. There it is combined with other drawings and form the final screen the user will see. This off screen buffer is the reason behind the transparency of windows. Media framework: Media framework provides different media codecs allowing the recording and playback of different media formats SQLite: SQLite is the database engine used in android for data storage purposes WebKit: It is the browser engine used to display HTML content OpenGL: Used to render 2D or 3D graphics content to the screen 5

Android Runtime Android Runtime consists of Dalvik Virtual machine and Core Java libraries. Dalvik Virtual Machine It is a type of JVM used in android devices to run apps and is optimized for low processing power and low memory environments. Unlike the JVM, the Dalvik Virtual Machine doesn t run.class files, instead it runs.dex files..dex files are built from.class file at the time of compilation and provides hifger efficiency in low resource environments. The Dalvik VM allows multiple instance of Virtual machine to be created simultaneously providing security, isolation, memory management and threading support. It is developed by Dan Bornstein of Google. Core Java Libraries These are different from Java SE and Java ME libraries. However these libraries provides most of the functionalities defined in the Java SE libraries. 6

Application Framework These are the blocks that our applications directly interacts with. These programs manage the basic functions of phone like resource management, voice call management etc. As a developer, you just consider these are some basic tools with which we are building our applications. Important blocks of Application framework are: Activity Manager: Manages the activity life cycle of applications Content Providers: Manage the data sharing between applications Telephony Manager: Manages all voice calls. We use telephony manager if we want to access voice calls in our application. Location Manager: Location management, using GPS or cell tower Resource Manager: Manage the various types of resources we use in our Application 7

Applications Applications are the top layer in the Android architecture and this is where our applications are gonna fit. Several standard applications comes pre-installed with every device, such as: SMS client app Dialer Web browser Contact manager As a developer we are able to write an app which replace any existing system app. That is, you are not limited in accessing any particular feature. You are practically limitless and can whatever you want to do with the android (as long as the users of your app permits it). Thus Android is opening endless opportunities to the developer. 8

Инструментарий Разработчика (IntelliJ) Android Studio http://developer.android.com/sdk/index.html 9

Инструментарий Разработчика (Eclipse) Android SDK http://developer.android.com/sdk/index.html Eclipse IDE for Mobile Developers http://eclipse.org/mobile/ ADT Plugin для Eclipse https://dl-ssl.google.com/android/eclipse/ Java SE Development Kit 7 http://www.oracle.com/technetwork/java/javase/ downloads/jdk7-downloads-1880260.html 10

Android SDK (1) SDK Tools (<sdk>/tools/) Contains tools for debugging and testing, plus other utilities that are required to develop an app. SDK Platform-tools (<sdk>/platform-tools/) Contains platform-dependent tools for developing and debugging your application. These tools support the latest features of the Android platform and are typically updated only when a new platform becomes available. Documentation (<sdk>/docs/) An offline copy of the latest documentation for the Android platform APIs. See http://developer.android.com/sdk/exploring.html 11

Android SDK (2) SDK Platform (<sdk>/platforms/<androidversion>/) There's one SDK Platform available for each version of Android. In order to build an Android app, you must specify an SDK platform as your build target. System Images (<sdk>/platforms/<androidversion>/) Sources for Android SDK (<sdk>/sources/) Samples for SDK (<sdk>/platforms/<androidversion>/samples/) Android Support & Google APIs See http://developer.android.com/sdk/exploring.html 12

Android SDK Tools Android Lets you manage AVDs, projects, and the installed components of the SDK. Dalvik Debug Monitor Server (ddms) Lets you debug Android applications. Android Emulator (emulator) Monkey Runs on your emulator or device and generates pseudo-random streams of user events such as clicks, touches, or gestures, as well as a number of system-level events. Monkeyrunner Provides an API for writing programs that control an Android device or emulator from outside of Android code. И многое другое... See http://developer.android.com/tools/help/index.html 13

Android SDK Platform Tools Android Debug Bridge (adb). Android Debug Bridge is a versatile tool that lets you manage the state of an emulator instance or Androidpowered device. You can also use it to install an Android application (.apk) file on a device. The Android SDK provides additional shell tools that can be accessed through adb, such as bmgr and logcat. The other platform tools, such as aidl, aapt, dexdump, and dx, are typically called by the Android build tools or Android Development Tools (ADT), so you rarely need to invoke these tools directly. As a general rule, you should rely on the build tools or the ADT plugin to call them as needed. See http://developer.android.com/tools/help/index.html 14

Программные Компоненты Android Activities Services Content Providers Broadcast Receivers Intents As a developer we need only to call and extend these already defined classes to use in our application. 15

Activities Class: android.app.activity An activity is a single, focused thing that the user can do. Almost all activities interact with the user, so the Activity class takes care of creating a window for you in which you can place your UI - http://developer.android.com 16

Services Class: android.app.service A Service is an application component representing either an application's desire to perform a longer-running operation while not interacting with the user or to supply functionality for other applications to use - http://developer.android.com Example: music player application. All Android services are implemented as a subclass of Service class defined in Android SDK. There are two types of services in Android: Unbound Services Its a type of service which is not bounded to any components. Once started, it will run in the background even after the component that started the service gets killed. It can be run in the background indefinitely and should stop by itself after the operation its intended to carry out is completed. Bound Services Its bound to other components and runs only till the component to which it is bounded runs. 17

Content Providers Content providers are one of the primary building blocks of Android applications, providing content to applications. They encapsulate data and provide it to applications through the single ContentResolver interface. A content provider is only required if you need to share data between multiple applications. - http://developer.android.com Example: the contacts data is used by multiple applications and must be stored in a content provider If you don't need to share data amongst multiple applications you can use a database directly via SQLiteDatabase. 18

Broadcast Receivers Class: android.content.broadcastreceiver Broadcast receivers are one of Android application components that is used to receive messages that are broadcasted by the Android system or other Android applications. Examples: Warning that the battery is getting low Screen turned off Change of time zone The camera has been used to take a picture 19

Intents Class: android.content.intent An intent is an abstract description of an operation to be performed. It can be used with startactivity to launch an Activity, broadcastintent to send it to any interested BroadcastReceiver components, and startservice(intent) or bindservice(intent, ServiceConnection, int) to communicate with a background Service. - http://developer.android.com Examples: invoke a new activity from your current activity start other application from your activity By firing an intent, you are telling the Android system to make something happen. There are two types of Intents in Android: Explicit Intents: In explicit Intent, we are highly specific. We specify which activity should get active on receiving the intent. These are usually used for application s internal communications. Implicit Intents: In implicit Intent we are sending a message to the Android system to find a suitable Activity that can respond to the intent. Example: send an e-mail 20

Eclipse IDE DEMO 21

AS IDE DEMO 22

Список Источников http://developer.android.com http://www.android-appmarket.com/android-architecture.html http://www.android-appmarket.com/android-applicationcomponents.html 23