Intro To Android Programming

Slides:



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

Google Android Introduction to Mobile Computing. Android is part of the build a better phone process Open Handset Alliance produces Android Comprises.
Ando-it-yourself droid Praveen Kumar Pendyala. Outline Brief intro to the Droid developement Setting up the Life saviors - Development tools Hello Droid.
Android OS : Core Concepts Dr. Jeyakesavan Veerasamy Sr. Lecturer University of Texas at Dallas
A Developer’s Introduction to Google Android Dr. Frank McCown Harding University Spring 2010.
Programming with Android: SDK install and initial setup Luca Bedogni Marco Di Felice Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna.
Filip Debelić What is it? Android is a mobile operating system (OS) based on the Linux kernel and currently developed by Google Android,
This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit
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
UFCFX5-15-3Mobile Device Development Android Development Environments and Windows.
Emerging Platform#4: Android Bina Ramamurthy.  Android is an Operating system.  Android is an emerging platform for mobile devices.  Initially developed.
Android Programming Day best Android Apps Lzo&feature=fvwrel.
Android Introduction Platform Overview.
Mobile Programming Lecture 1 Getting Started. Today's Agenda About the Eclipse IDE Hello, World! Project Android Project Structure Intro to Activities,
Intro to Android Programming George Nychis Srinivasan Seshan.
Mobile Application Development with ANDROID Tejas Lagvankar UMBC 29 April 2009.
About me Yichuan Wang Android Basics Credit goes to Google and UMBC.
Introduction to Android Swapnil Pathak Advanced Malware Analysis Training Series.
© 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.
Introduction to Android Programming (CS5248 Fall 2015) Aditya Kulkarni August 26, 2015 *Based on slides from Paresh Mayami.
Android development basics Introduction,Structure,Development Boncho Valkov.Net Developer.
Prerequisites Android Studio – io.html io.html Java.
Copyright© Jeffrey Jongko, Ateneo de Manila University Android.
01. Introduction to Android Prof. Oum Saokosal Master of Engineering in Information Systems, South Korea
Basic Android Tutorial USF’s Association for Computing Machinery.
ANDROID Presented By Mastan Vali.SK. © artesis 2008 | 2 1. Introduction 2. Platform 3. Software development 4. Advantages Main topics.
CS378 - Mobile Computing Intents.
Android for Java Developers Denver Java Users Group Jan 11, Mike
Overview of Android Application Development
ANDROID L. Grewe Components  Java Standard Development Kit (JDK) (download) (latest version)  AndroidStudio.
 Installation of Android Development Environment  Creating the App with OpenGL ES API  Running the App on Emulator Android App Development.
HW#9 Clues CSCI 571 Fall, HW#9 Prototype
ANDROID APPLICATION DEVELOPMENT. ANDROID DEVELOPMENT DEVELOPER.ANDROID.COM/INDEX.HTML THE OFFICIAL SITE FOR ANDROID DEVELOPERS. PROVIDES THE ANDROID SDK.
Intoduction to Andriod studio Environment With a hello world program.
Guide To Develop Mobile Apps With Titanium. Agenda Overview Installation of Platform SDKs Pros of Appcelerator Titanium Cons of Appcelerator Titanium.
CHAPTER 1 part 1 Introduction. Chapter objectives: Understand Android Learn the differences between Java and Android Java Examine the Android project.
Introduction to Android Programming
Introduction to Android Chapter 1 1. Objectives Understand what Android is Learn the differences between Java and Android Java Examine the Android project.
The Basics of Android App Development Sankarshan Mridha Satadal Sengupta.
A presentation on Android and Android project Around Me
Mobile Device Development
Android Mobile Application Development
Mobile Device Development
Lecture 2: Android Concepts
Android 01: Fundamentals
Android Application Development 1 6 May 2018
Obtaining the Required Tools
Android Runtime – Dalvik VM
Android Studio, Android System Basics and Git
Android.
Contents: Introduction Different Mobile Operating Systems
CA16R405 - Mobile Application Development (Theory)
CMPE419 Mobile Application Development
Application Development A Tutorial Driven Course
Android Developer Fundamentals V2 Lesson 1
Android Topics UI Thread and Limited processing resources
CHAPTER 1 Introduction Chapter objectives: Understand what Android is
Android Developer Fundamentals V2
Android Programming Tutorial
The Most Popular Android UI Automation Testing Tool Andrii Voitenko
Android Platform, Android App Basic Components
Emerging Platform#3 Android & Programming an App
Getting Started with Android…
Lecture 2: Android Concepts
Android Development Introduction to Android Development 2011/01/16
CMPE419 Mobile Application Development
Presentation transcript:

Intro To Android Programming DISCLAIMER: Android expertise + largest Android project experience Raj Joshi

Quick Poll Java classes are compiled into a proprietary bytecode format and run on Android Runtime (ART) which performs the translation of the application's bytecode into native instructions that are later executed by the device's runtime environment.

Getting Up To Speed With Java You can do it in one week (~2 hours a day): https://www.tutorialspoint.com/java/ http://www.learnjavaonline.org/ Head First Java (book) Learn just what is required: Basics: classes, methods, data types, loops & conditionals, file I/O, exceptions Parallelism: multi-threading, asynchronous function calls Do NOT waste time on advanced OOP concepts, design patterns, etc. Hate Java? Try Kotlin or both Java & Kotlin NOT a Java programming language class or Android class. We want to pick-up just enough to get this project done!

Machine code (ELF shared object) Android ‘OS’ Overview Operating System based on Linux Code compilation workflow: Android Runtime (ART): javac .class files dx classes.dex aapt .apk file .jar files resource files The dx command stitches all of the .class and .jar files together into a single classes.dex file written in Dalvik byte-code format. The classes.dex file and the resources from your application, such as images and layouts, are then compressed into a zip-like file called an Android Package or .apk file. This is done with the Android Asset Packaging Tool or aapt Technically, the classes.dex will be converted into an ELF shared object. Android calls this library format OAT and the tool that converts the classes.dex file is called dex2oat. dex2oat classes.dex Machine code (ELF shared object) https://github.com/dogriffiths/HeadFirstAndroid/wiki/How-Android-Apps-are-Built-and-Run

Android Environment Setup What we need? Java compiler and libraries Android SDK (Android Java libs, dx, aapt, etc.) IDE and build system Install Oracle Java 8 JDK (download link) Install Android Studio (download link)

Android Studio Official IDE for Android based on IntelliJ IDEA Uses Gradle – a flexible build system Gradle build scripts automate the process of making apk Simplifies dependency management and thus life  Bundles together all that is needed: Java IDE Android SDK Android Virtual Device emulator The gradle build scripts take the source code, resources and everything associated with the project and turn it into an apk file The dependencies are automatically fetched from online repos (Maven Central) during the compilation process.

Getting Started With Android Head First Android Development: http://shop.oreilly.com/product/0636 920029045.do Trial on Safari books OR buy Kindle version from Amazon (~ 50 SGD) NUS Library: just one copy  Official Getting Started Tutorial Udacity Android Fundamentals - Google Stanford CS 193A http://www.vogella.com/tutori als/Android/article.html

Project Structure (Logical View) AndroidManifest: project configurations, permissions, etc.

Application Fundamentals Four Application Components Activities Services Content Providers Broadcast Receivers More details for interested readers: https://developer.android.com/guide/components/ fundamentals.html Communication between components (except content providers): Intents Activity: Single screen with a user interface. An app can consists of multiple activities (inbox, compose email). Activities are independent of each other. Even outside app can call a specific activity of an app (camera app calls compose email). Service: Just like Linux/Windows service. Performs long running tasks in the background. It has no UI.

Intents Asynchronous message that binds individual components to each other at runtime. Think of it like: messengers that request an action from other components (even from other apps) Usage: Pass info from one activity (or app) to another. E.g. Camera app sharing photo via email. Pass info to a service

The manifest file Carries all the metadata about your app Important functions: MUST declare all components of the app Permissions that the app requires: Internet access, camera, sdcard, etc. java.lang.SecurityException: Permission denied (missing INTERNET permission?) Other functions: Minimum API level required by the app

User Interface and Events Activity: a single screen of UI in the app “fundamental unit” of GUI in Android View: visible on-screen items (XML code) Layout: invisible container to position/size the widgets Widgets: GUI control items like a button, drop-down menu, etc. Event: an action that occurs when user interacts with widgets Event Handlers (Java code) adapted from Stanford CS 193A

Multi-threading Concerns in Android Main thread responsible for interacting with UI components Do NOT make a blocking I/O call from the main thread e.g. a blocking HTTP request leads to NetworkOnMainThreadException Use a different thread explicitly OR AsyncTask Do not access UI components outside UI thread Just a good practice to avoid race conditions

Debugging in Android android.util.Log API Log.v(), Log.d(), Log.i(), Log.w(), and Log.e() methods Output: logcat tab of Android Monitor within Android Studio

Important API References MediaRecorder MediaCodec Sometimes you need to get down and dirty! Useful third-party libraries: MP4Parser: for playing around MP4 container in Java OkHttp or Retrofit: for HTTP GET and POST Otto: event bus (publish-subscribe model)

Demo: Bigger Number Game adapted from Stanford CS 193A