Android Development Exercises Version - 2012.02. Hands On Exercises for. Android Development. v. 2012.02

Similar documents
Getting Started with Android Programming (5 days) with Android 4.3 Jelly Bean

Android Application Development

Android Application Development - Exam Sample

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)

How To Develop Android On Your Computer Or Tablet Or Phone

Login with Amazon Getting Started Guide for Android. Version 2.0

Getting Started with Android Development

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

Introduction to Android Programming (CS5248 Fall 2015)

ITG Software Engineering

Android Development Tutorial. Nikhil Yadav CSE40816/ Pervasive Health Fall 2011

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

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 (

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

UNIVERSITY AUTHORISED EDUCATION PARTNER (WDP)

OpenCV on Android Platforms

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

1. Introduction to Android

How to Create an Android Application using Eclipse on Windows 7

Introduction to Android. CSG250 Wireless Networks Fall, 2008

ADT Plugin for Eclipse

Android Development. Marc Mc Loughlin

Mobile Application Development

Android Tutorial. Larry Walters OOSE Fall 2011

Android Environment SDK

Developer's Cookbook. Building Applications with. The Android. the Android SDK. A Addison-Wesley. James Steele Nelson To

Android Environment SDK

Android Developer Fundamental 1

Oracle FLEXCUBE Direct Banking Android Tab Client Installation Guide Release

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

System Reference 2013

Developing for MSI Android Devices

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

Android Certified Application Developer AND-401

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

Android For Java Developers. Marko Gargenta Marakana

Android Programming. Høgskolen i Telemark Telemark University College. Cuong Nguyen,

Home Course Catalog Schedule Pricing & Savings Training Options Resources About Us

Cisco Cius Development Guide Version 1.0 September 30, 2010

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

HP AppPulse Mobile. Adding HP AppPulse Mobile to Your Android App

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

Installing the Android SDK

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

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

Running a Program on an AVD

Open Source Telemedicine Android Client Development Introduction

Mocean Android SDK Developer Guide

Introduction to Android Development. Jeff Avery CS349, Mar 2013

Tutorial: BlackBerry Object API Application Development. Sybase Unwired Platform 2.2 SP04

Android Basics. Xin Yang

«compl*tc IDIOT'S GUIDE. Android App. Development. by Christopher Froehlich ALPHA. A member of Penguin Group (USA) Inc.

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

Android 4.4 App Development Essentials

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

Android on Intel Course App Development - Advanced

Practical Android Projects Lucas Jordan Pieter Greyling

How to install and use the File Sharing Outlook Plugin

Introduction to Android Development

Jordan Jozwiak November 13, 2011

Tutorial on Basic Android Setup

Developing NFC Applications on the Android Platform. The Definitive Resource

How to develop your own app

Sophos Mobile Control user help. Product version: 6.1

Download and Installation Instructions. Android SDK and Android Development Tools (ADT)

PTC Integrity Eclipse and IBM Rational Development Platform Guide

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

Download and Installation Instructions. Android SDK and Android Development Tools (ADT) Microsoft Windows

Mobile Security - Tutorial 1. Beginning Advanced Android Development Brian Ricks Fall 2014

Lab 0 (Setting up your Development Environment) Week 1

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

Download and Installation Instructions. Android SDK and Android Development Tools (ADT) Microsoft Windows

Kindle Fire App Development Essentials

Android Application Development Distance Learning Program Brochure

Android Development Tools for Eclipse

Programming with Android: SDK install and initial setup. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna

Dashboard Admin Guide

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

Hello World. by Elliot Khazon

Android Mobile App Building Tutorial

Using Extensions or Cordova Plugins in your RhoMobile Application Darryn

Android: How To. Thanks. Aman Nijhawan

Kaseya 2. User Guide. Version 6.1

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

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

Fahim Uddin 1. Java SDK

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

Sabre Red Apps. Developer Toolkit Overview. October 2014

UP L18 Enhanced MDM and Updated Protection Hands-On Lab

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

Getting Started: Creating a Simple App

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

CHAPTER 1: INTRODUCTION TO ANDROID, MOBILE DEVICES, AND THE MARKETPLACE

Spring Design ScreenShare Service SDK Instructions

Practice Fusion API Client Installation Guide for Windows

Sophos Mobile Control Startup guide. Product version: 3

ANDROID INTRODUCTION TO ANDROID

Supplement I.B: Installing and Configuring JDK 1.6

Transcription:

Hands On Exercises for Android Development v. 2012.02 WARNING: The order of the exercises does not always follow the same order of the explanations in the slides. When carrying out the exercises, carefully follow the exercise requirements. Do NOT blindly type the commands or code as found in the slides. Read every exercise in its entirety before carrying out the instructions. OPERSYS INC. 1/8

These exercises are made available to you under a Creative Commons Share Alike 3.0 license. The full terms of this license are here: https://creativecommons.org/licenses/by sa/3.0/ Attribution requirements and misc.: This page must remain as is in this specific location (page #2), everything else you are free to change; including the logo : ) Use of figures in other documents must feature the below Originals at URL immediately under that figure and the below copyright notice where appropriate. You are free to fill in the space in the below Delivered and/or customized by section as you see fit. (C) Copyright 2010 2012, Opersys inc. These exercises created by: Karim Yaghmour Originals at: www.opersys.com/training/android development Delivered and/or customized by: OPERSYS INC. 2/8

Android Class Exercises Day 1 A quick introduction to Java 1. Install Sun's JDK and JRE (sun-java6-jdk and sun-java6-jre) 2. Create and run a HelloWorld in Java 3. Create a java program that creates two threads that call a same synchronized function that increments a number shared by the two threads and prints out the number's value along with a string identifying the caller. Introduction to Android Development 1. Install the SDK 2. Install the Eclipse plugin 3. Configure Eclipse for the SDK 4. Use the android tool to install platform support for 2.3. and 3.0 5. Create an Android 2.3 emulator image 6. Create a Hello World project using Eclipse and run it in the emulator 7. Make your Hello World use the toast function 8. Make your Hello World use the logging function and use logcat to view your output Application Fundamentals 1. Implement the onpause() handler for your Hello World app and monitor what happens when you switch applications 2. Implement onsaveinstancestate() to store data in a Bundle and check that the data is there in the subsequent oncreate() 3. Implement the onconfigurationchanged() and onretainnonconfigurationinstance callbacks and monitor their behavior 4. Implement a Service that is started by your Hello World... nothing fancy, just make sure the Service's onstart() is called User Interface From here on, we will start building components for a full app to which we will add more functionality along the way. The app is basically a Twitter-like client. The goal in this section is to create the following elements which will become active as we tie the components together: 1. Main Activity for: 1. Displaying list of events (ListView) 2. Creating a new event (EditText) 3. Managing list of people followed (Other Activity) 2. Menu for: 1. Entering credentials (Dialog) OPERSYS INC. 3/8

2. Changing background color (Dialog) 3. People Activity: 1. Adding new person (EditText) 2. List of people followed 4. Context menu for item in PeopleActivity 5. Credentials dialog (custom) 6. Background color dialog (custom) OPERSYS INC. 4/8

Android Class Exercises Day 2 Application resources 1. Have different layout for portrait and landscape mode for the UI elements created earlier. Intents 1. Implement a Broadcast Receiver that ties in to the Intent of your choice. You can see a full list of Intents you can listen to in the documentation. On firing, the Broadcast Receiver should notify the status bar. Make the selecting of the status bar expanded start the main user interface Activity implemented earlier. Data storage 1. Use the Shared Preferences to store/retrieve the username/password and color from your user interface. 2. Add a menu option and corresponding Activity or Dialog allowing the user to enter a URL to a file on the web. Implement the necessary functionality to retrieve the file from the net, store it locally and list the download in the event list. 3. Enable the user to open the file by selecting the corresponding event in the event list. Try using an Intent to get an app to take care of opening the file and presenting it to the user. 4. Use SQLite to store new events entered in the TextBox by the user. Those text events should also be added to the ListView and the ListView should restore itself on Activity restart. Use SQLiteOpenHelper(). Content providers 1. Take the store/retrieve functionality implemented in #4 of the previous section and wrap it inside a basic Content Provider. Your Activity should now be using a Content Provider to read/write its data. Your Content Provider should continue using SQLite for its storage. 2. Take the file functionality implemented in #2 and #3 of the previous section and make the files stored by the Content Provider instead of locally in the Activity. 3. Make the Broadcast Receiver implemented in #1 of the Intents section exercise fire off a service that adds the description of the Intent captured by the Broadcast Receiver to the Content Provider. You will likely need to start a Service for that. Notice that your App will not see the new data in the Content Provider's DB since its last restart. Fixing this will be part of a later exercise. OPERSYS INC. 5/8

Android Class Exercises Day 3 REST applications 1. Tie the previously implemented Content Provider to the http://identi.ca service. Identi.ca is a Twitter-like service. It is based on the StatusNet open source project and provides a REST API. You can use parts of the API without having an account, but you will need to create an account in order to be able to post and to subscribe to friends' feeds. You can try out the REST API commands from your command line using the curl command in Ubuntu; some of them can also run from your browser. For example, here's how you: A user's timeline (no authentication required): curl http://identi.ca/api/statuses/friends_timeline/usr.xml Post (authentication required): curl -u usr:pwd http://identi.ca/api/statuses/update.xml -d status='howdy!' See your friends' timeline (authentication required): curl -u usr:pwd http://identi.ca/api/statuses/friends_timeline.xml Use the Sync Adapter example to copy/paste code in as much as possible. By the end of this exercise, you should be able to follow/unfollow other users and post messages to your feed so that everyone can see them. You will find more documentation about StatusNet's API here: http://status.net/wiki/howto_use_the_api http://status.net/docs/api/ http://status.net/wiki/twitter-compatible_api In addtion to XML, you can also get information in: json, rss, atom. OPERSYS INC. 6/8

Android Class Exercises Day 4 Remote Interfaces 1. Create a service that provides a remote interface that provides the following through the previously-implemented Content Provider: Sending a new event Getting the last N events 2. Create a new app that has a single Activity that uses the previously-implemented service and has two buttons: One for sending an event with the current time One for getting the last event and showing it in a dialog box Note here that by using two apps you'll be running in two separate processes, hence realizing the benefits of using a remote interface. Security and Permissions 1. Modify the service implemented in the previous exercise set to require a set of permissions for accessing its API. 2. Modify the new app implemented in the previous exercise to use the service permissions to access the service's API. Device Administration 1. Create a device administration app that: Sets the minimum password length to 10 characters and asks the user to enter a password Sets the maximum user inactivity period to 10 seconds 2. Write an app that uses an intent of type ACTION_VIEW on the package manager service to install a Hello Wold! app apk. Use the assets/'' directory to store the Hello World apk. You will need to copy the asset to local storage to get an absolute path to pass with the Intent. OPERSYS INC. 7/8

Android Class Exercises Day 5 Native Development 1. Get and install the NDK 2. Write an app that uses JNI to get the contents of /proc/cpuinfo and displays them to the user. 3. Write a fully native app that regularly updates a world-readable file and write a simple Activity that opens the file and shows its contents to the user. Note that the app name in the manifest must be: android.app.nativeactivity. OPERSYS INC. 8/8