Android Application Development CSE 5520/4520 Wireless Networks.

Slides:



Advertisements
Similar presentations
Android Application Development A Tutorial Driven Course.
Advertisements

Application Fundamentals Android Development. Announcements Posting in D2L Tutorials.
Chapter 1: Voilà! Meet the Android
Programming Mobile Applications with Android
Joemarie Comeros Amparo Android Development Orientation for Starters.
1 Mobile Computing Mobile First (formerly Worklight) Copyright 2015 by Janson Industries.
DEPARTMENT OF COMPUTER ENGINEERING
ANDROID OPERATING SYSTEM Guided By,Presented By, Ajay B.N Somashekar B.T Asst Professor MTech 2 nd Sem (CE)Dept of CS & E.
Android: Hello World Frank Xu Gannon University. Steps Configuration ▫Android SDK ▫Android Development Tools (ADT)  Eclipse plug-in ▫Android SDK and.
Android and Project Structure. Android Android OS – Built on Linux Kernel – Phones – Netbooks – Readers – Other???
Mobile Application Development
Google Android as a mobile development platform T Internet Technologies for Mobile Computing Olli Mäkinen.
Android Programming Beomjoo Seo Sep., 12 CS5248 Fall 2012.
Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department.
ANDROID PROGRAMMING MODULE 1 – GETTING STARTED
How to make it work? Doncho Minkov Telerik Academy academy.telerik.com Technical Trainer
SET UP COMPUTER ** PLEASE BE AWARE SCREENSHOTS MAY NOT MATCH **
Getting Started with Android Programming Note: if you have already installed android development tools, please check that you have the same version as.
SEEM4570: XAMPP, Eclipse, Summary of Html Kangfei Zhao Room 711,ERB
Emerging Platform#4: Android Bina Ramamurthy.  Android is an Operating system.  Android is an emerging platform for mobile devices.  Initially developed.
Android Introduction Platform Overview.
Better reference the original webpage :
Mobile Programming Lecture 1 Getting Started. Today's Agenda About the Eclipse IDE Hello, World! Project Android Project Structure Intro to Activities,
Mobile Application Development with ANDROID Tejas Lagvankar UMBC 29 April 2009.
About me Yichuan Wang Android Basics Credit goes to Google and UMBC.
© Keren Kalif Intro to Android Development Written by Keren Kalif, Edited by Liron Blecher Contains slides from Google I/O presentation.
@2011 Mihail L. Sichitiu1 Android Introduction Platform Overview.
Android Programming By Mohsen Biglari Android Programming, Part1: Introduction 1 Part1: Introduction By Mohsen Biglari.
Chapter 1: Voilà! Meet the Android
1 Mobile Computing Set Up Copyright 2015 by Janson Industries.
Operating system for mobile devices with a Java programming interface. Provides tools, e.g. a compiler, debugger, device emulator, and its own Java Virtual.
Copyright© Jeffrey Jongko, Ateneo de Manila University Android.
Introduction to Android. Android as a system, is a java based operating system that runs on the Linux kernel. The system is very lightweight and full.
Ali Shahrokni Application Components Activities Services Content providers Broadcast receivers.
Presentation Seminar on “IMAGE SLIDER –AN ANDROID APPLICATION”
ANDROID Presented By Mastan Vali.SK. © artesis 2008 | 2 1. Introduction 2. Platform 3. Software development 4. Advantages Main topics.
Android for Java Developers Denver Java Users Group Jan 11, Mike
ANDROID 응용 프로그래밍 과정 – 목차 - 안드로이드란 - 안드로이드가 만들어지게 된배경 - 안드로이드의 철학 - 안드로이드 환경설정 ( SDK download, eclipse plug-in 설정, 간단한 프로그램 실행 ) - 안드로이드 동작원리 - 안드로이드 핵심.
10/10/2015 E.R.Edwards 10/10/2015 Staffordshire University School of Computing Introduction to Android Overview of Android System Android Components Component.
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
Presented By: Muhammad Tariq Software Engineer Android Training course.
Overview of Android Application Development
CS378 - Mobile Computing Intents. Allow us to use applications and components that are part of Android System – start activities – start services – deliver.
Android architecture & setting up. Android operating system comprises of different software components arranges in stack. Different components of android.
First Venture into the Android World Chapter 1 Part 2.
Created By. Jainik B Patel Prashant A Goswami Gujarat Vidyapith Computer Department Ahmedabad.
ANDROID APPLICATION DEVELOPMENT. ANDROID DEVELOPMENT DEVELOPER.ANDROID.COM/INDEX.HTML THE OFFICIAL SITE FOR ANDROID DEVELOPERS. PROVIDES THE ANDROID SDK.
Mobile Application Development with ANDROID Umang Patel(6537) LDCE.
1 Android Workshop Platform Overview. 2 What is Android?  Android is a software stack for mobile devices that includes an operating system, middleware.
Android Development For Beginners. What is Android? Android is an open mobile phone platform that was developed by Google and later by Open Handset Alliance.
Android operating system N. Sravani M. Tech(CSE) (09251D5804)
By Adam Reimel. Outline Introduction Platform Architecture Future Conclusion.
Android. Android An Open Handset Alliance Project A software platform and operating system for mobile devices Based on the Linux kernel Developed by Google.
IBM Worklight environment setup 1. Eclipse IDE Multi-purpose integrated development environment (IDE) Open source Supported for Windows, Mac OS X, Linux.
Day 1 Session 2. Setup & Installation
Introduction to Android Programming
The Basics of Android App Development Sankarshan Mridha Satadal Sengupta.
Android 01: Fundamentals
Obtaining the Required Tools
Android Runtime – Dalvik VM
Android.
CMPE419 Mobile Application Development
Application Development A Tutorial Driven Course
Android Application Development
Korea Software HRD Center
Android Platform, Android App Basic Components
Emerging Platform#3 Android & Programming an App
Mobile Programming Dr. Mohsin Ali Memon.
CMPE419 Mobile Application Development
Presentation transcript:

Android Application Development CSE 5520/4520 Wireless Networks

Outline Introduction to Android Applications Setting up the Android application development Environment Creating and Running Applications Anatomy of ANDROID Applications

INTRODUCTION TO ANDROID APPLICATIONS

Introduction to Android Applications Android is a mobile software platform (OS) from Google and the Open Handset Alliance. It is powered by the Linux Kernel The underlying OS is written in C or C++ But applications are built using Java Built-in Apps = Apps created in SDK Is an open source platform – Thus third party can add functionalities and does not have to rely on Google (ex: Multimedia Codecs, Sophisticated shell environment, etc.)

Android Features Reuse and replacement of components Dalvik virtual machine Integrated browser Optimized graphics SQLite – DB owned by each application (can be shared) Media support GSM Telephony Bluetooth, EDGE, 3G, and WiFi Camera, GPS, compass, and accelerometer Rich development environment

What is Dalvik VM (DVM)? Dalvik is the process virtual machine (VM) that runs the apps on Android devices. DVM is optimized to run on slow-cpu, low-ram, and low-power devices Every Android application runs in its own process, with its own instance of the DVM DVM is written so that a device can run multiple VMs efficiently Programs are commonly written in Java and compiled to bytecode. Then they are converted from Java Virtual Machine- compatible.class files to Dalvik-compatible.dex (Dalvik Executable) files before installation on a device.

Android Architecture

Android API vs. Android SDK Application Programming Interface (API) is an interface (set of libraries) that allows you to communicate with the Android platform. Android Standard Development Kit (SDK) provides you the API libraries and the developer tools necessary to build, test and debug apps for Android.

What is an API Level? API Level is an integer value that uniquely identifies the framework API revision offered by a version of the Android platform. The framework API consists of: – A core set of packages and classes – A set of XML elements and attributes for declaring a manifest file – A set of XML elements and attributes for declaring and accessing resources – A set of Intents – A set of permissions that applications can request Each successive version of the Android platform can include updates to the Android application framework API that it delivers.

Platform VersionAPI LevelVERSION_CODE Android 4.1, JELLY_BEAN Android 4.0.3, ICE_CREAM_SANDWICH_MR1 Android 4.0, 4.0.1, ICE_CREAM_SANDWICH Android 3.213HONEYCOMB_MR2 Android 3.1.x12HONEYCOMB_MR1 Android 3.0.x11HONEYCOMB Android Android GINGERBREAD_MR1 Android Android Android 2.3 9GINGERBREAD Android 2.2.x8FROYO Android 2.1.x7ECLAIR_MR1 Android ECLAIR_0_1 Android 2.05ECLAIR Android 1.64DONUT Android 1.53CUPCAKE Android 1.12BASE_1_1 Android 1.01BASE

SETTING UP THE ANDROID APPLICATION DEVELOPMENT ENVIRONMENT

Setting up the Android development environment 1.Download and install Java 6 (JDK 1.6)JDK Download Eclipse (JEE, Classic or Java developers)Eclipse 3.Download and install Android SDK base – Download: – Install Eclipse ADT Plugin (Android Development Tools in Eclipse)Eclipse ADT Plugin 5.Adding platforms and SDK components 6.AVD (Android Virtual Device)

Installing Android SDK First download and install Android SDK This is not the complete SDK environment. – It includes only the core SDK tools, which you can use to download the rest of the SDK packages (such as the latest system image). The installer will check for machine requirements and then saves the Android SDK Tools into a default location (or you can specify the location). Make a note of the name and location of the SDK directory – you will need to refer to this directory later, when setting up the ADT plugin and when using the SDK tools from the command line.

Install Eclipse ADT 1.Start Eclipse, then select Help > Install New Software. 2.Click Add, in the top-right corner. 3.In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and the following URL for the Location: 4.Click OK. 5.In the Available Software dialog, select the checkbox next to Developer Tools and click Next. 6.In the next window, you'll see a list of the tools to be downloaded. Click Next. 7.Read and accept the license agreements, then click Finish. 8.When the installation completes, restart Eclipse.

Using SDK components Run Android SDK manager – Window -> Android SDK Manager Probably prompted automatically after installing ADT plugin and restarting Eclipse – Select all entries, except that you can omit Android versions older than 2.2 Click “Install n packages” Runs for a long time Detailed instructions – packages.html packages.html

Create an Android Virtual Device (AVD) Defines the system image and device settings used by the Emulator To create an AVD through Eclipse: 1.Select Window > Android SDK and AVD Manager. The Android SDK and AVD Manager displays. 2.Make sure the entry for Virtual Devices is selected and click New. The Create new AVD window displays. 3.Enter a Name for the AVD. 4.Select Google APIs (API level 9) as the Target. 5.Click Create AVD. 6.Close the Android SDK and AVD Manager.

DEVELOPING AND RUNNING APPLICATIONS

Application Components Activity ◦ Present a visual user interface for one focused endeavor the user can undertake ◦ Example: a list of menu items users can choose from

Application Components Cont. Services ◦ Run in the background for an indefinite period of time ◦ Example: calculate and provide the result to activities that need it

Application Components Cont. Broadcast Receivers ◦ Receive and react to broadcast announcements ◦ Example: announcements that the battery is low

Application Components Cont. Content Providers ◦ Store and retrieve data and make it accessible to all applications ◦ Example: Android ships with a number of content providers for common data types (e.g., audio, video, images, personal contact information, etc.) Intents ◦ Activities, services, and broadcast receivers — are activated by asynchronous messages called intents. ◦ Hold the content of a message ◦ Example: convey a request for an activity to let the user edit some text

Usage of Intent to start an activity Allows communication between components – Message passing – Bundle Intent intent = new Intent(CurrentActivity.this, OtherActivity.class); startActivity(intent);

Android “Hello World” File  New  Project  Android  Android Application Project – Next time you can do File  New  Android Application Project Fill in options as shown on next pages Run the project (will be explained later) – R-click  Run As  Android Application

“Hello World” - Setting Project Options Application Name – Shown in Play Store and Settings  Manage Application List. Usually same as Project Name. Project Name – Eclipse project name. Follow naming convention you use for Eclipse. Not used elsewhere. Package name – Apps on a particular Android device must have unique packages, – so use com.yourCompany.project Build SDK – The Android version used to build/compile your project. This can be any version (e.g., the most recent), but the safest option is to make it match the minimum SDK below. Minimum Required SDK – The Android version that you want to run on. – For most phone apps, choose 2.3.3, since that is the most common version in use worldwide. For learning new features, use latest version.

“Hello World” - Setting Project Options Cont. Configure Launcher Icon – To choose the picture displayed on the Android device, that, when clicked, launches the app. – Use defaults for development and testing. Just press “Next”. Create Activity – Choose “BlankActivity”

“Hello World” - Options for Blank Activity Activity Name – Name of “main” Java class. This is the class you will edit first. – Class name often corresponds to project name. Layout Name – Base name of XML file in res/layout folder. – Used to give layout to app. Often just called “main”. – Will be referred to in main Java class with R.layout.layout_name. Navigation Type – For now, leave this as “None” Hierarchical Parent – Parent Activity (for when user presses Up). Empty for now. Title – Text that will be shown on Android title bar.

Running New App on Emulator Same as with any project R-click  Run As  Android Application NOTE: do not close emulator after testing. Emulator takes a long time to start initially, but it is relatively fast to deploy a new or a changed project to the emulator.

Running App on Mobile Phone Deploying via USB Connection Prereq: install drivers for Android device – Plug phone (or other Android device) into computer. – Recent OS’s might find drivers automatically. If not, download from device manufacturer. – See list at usb.htmlhttp://developer.android.com/tools/extras/oem- usb.html – After installation, plug in phone, then go to android- dir/platform-tools/ and run “adb devices”. Your device should now be listed.

Running App on Mobile Phone Cont. In the Android device – Enable USB debugging – Allow unknown sources – Verify USB drivers are on computer – Plug into computer via USB In Eclipse – R-click app, Run As -> Android Application – If emulator is open, will be given a choice of which device to deploy to. – If emulator not open, will deploy to physical device automatically.

ANATOMY OF ANDROID APPLICATION

Anatomy of Android Application

Android Manifest Every application must have an AndroidManifest.xml file (with precisely that name) in its root directory.AndroidManifest.xml The manifest presents essential information about the application to the Android system, information the system must have before it can run any of the application's code. Among other things, the manifest does the following: – It names the Java package for the application. The package name serves as a unique identifier for the application. – It describes the components of the application — the activities, services, broadcast receivers, and content providers that the application is composed of.

Android Manifest – It determines which processes will host application components. – It declares which permissions the application must have in order to access protected parts of the API and interact with other applications. – It also declares the permissions that others are required to have in order to interact with the application's components. – It declares the minimum level of the Android API that the application requires. – It lists the libraries that the application must be linked against.

Structure of the Manifest File

Structure of the Manifest File Cont.

The lifecycle of and Android Activity

Example Create a network monitor using Android’s TrafficStats class builder/create-a-network-monitor-using- androids-trafficstats-class/774

More Android Samples In Eclipse – File -> New -> Project… – Select Android -> Android Sample Project – Select the API Level – Select the desired sample and click finish (Ex: Snake)

Project 3 - Objectives 1.Logging smart phone activities or resource usage while an application is running 2.What are the resources available to monitor – Monitoring the resources requested and test it with one single application. 3.Download and test with a certain category of applications 4.What are the plots and graphs to produce the resources used across all the applications.

References Android Developers - Android Tutorial - Dr. Lotzi Bölöni - Dr. Lotzi Bölöni (slides)- AndroidTutorial.ppt AndroidTutorial.ppt Dr. Natasa Przulj -