Top Banner
Android SDK Development Tools Build Systems Application Building Blocks Create a Simple App Boston, July 2015 #00 ANDROID PROGRAMMIN G, LET'S BREAK IT DOWN !
44
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Android, getting started

Android SDK Development Tools

Build Systems Application Building Blocks

Create a Simple AppBoston, July 2015 #00

ANDROID PROGRAMMING, LET'S BREAK IT DOWN!

Page 2: Android, getting started

WHO I AM?

@giorgionatili #mobiletea

Page 3: Android, getting started

ANDROID SDK

Page 4: Android, getting started

• The Android SDK includes a variety of tools that help you develop mobile applications Android

• The tools are classified into two groups: SDK tools and platform tools#01

ANDROID SDK

Page 5: Android, getting started

• Android Virtual Device Manager (AVD)

• Android Emulator • The mksdcard utility

#01

VIRTUAL DEVICE TOOLS

Page 6: Android, getting started

• Android Debug Bridge (aka $ ./adb) • Dalvik Debug Monitor Service (aka $ ./ddms)

• Lint (aka $ ./lint) • Logs analysis tool (aka $ ./dmtracedump)

#01

DEBUGGING TOOLS

Page 7: Android, getting started

• ProGuard • Zipaling

#01

BUILD TOOLS

Page 8: Android, getting started

X#00

Page 9: Android, getting started

ANDROID EMULATOR(S)

Page 10: Android, getting started

• Based on existing configurations

• Consistent usage across platforms

• Extremely slow (developers usually don’t use it)

ANDROID VIRTUAL DEVICE MANAGER #02

Page 11: Android, getting started

• Based on Virtual Box

• Distributed with several devices

• Extremely fast and integrated (Eclipse, Android Studio and Visual Studio)

GENYMOTION

#02

Page 12: Android, getting started

• Based on Virtual Box

• Distributed with several devices

• Extremely fast and integrated (Eclipse, Android Studio and Visual Studio)

GENYMOTION

#02

Page 13: Android, getting started

• Integrated Android emulator

• Distributed with several devices

• Works only on Windows (soon it will be available online)

VISUAL STUDIO

#02

Page 14: Android, getting started

EXPORT PATHS#02

(optional)

Page 15: Android, getting started

Let’s play with the SDK Tools!

#02

Page 16: Android, getting started

DEVELOPMENT TOOLS

Page 17: Android, getting started

Do you recognize the

tools?

#03

Page 18: Android, getting started

• Solid and well known cross platform development tool

• Great plugin ecosystem

• Supports Android (till the end of the year)

ECLIPSE#03

Page 19: Android, getting started

• Java Development Kit 7+ (JDK) (6 will not work!)

• Eclipse, the "Eclipse IDE for Java Developers" is usually sufficient.

• Android SDK, you only need the SDK, not the ADT bundle, which includes Eclipse. Install the latest stable platforms via the SDK Manager.

• Android Development Tools for Eclipse, aka ADT Plugin. Use this update site: https://dl-ssl.google.com/android/eclipse/

• Eclipse Integration Gradle, use this update site: http://dist.springsource.com/snapshot/TOOLS/gradle/nightly (for Eclipse 4.4) or http://dist.springsource.com/release/TOOLS/gradle (for Eclipse < 4.4)

SETUP#03

Page 20: Android, getting started

• Based upon the IntelliJ platform

• Supports the user interface design

• Offers advanced code completion / refactoring tools

• Supports Gradle as a build system

ANDROID STUDIO

#03

Page 21: Android, getting started

• Java Development Kit 7+ (JDK) (6 will not work!)

• Android Studio Android Studio already comes packaged with the Android SDK

SETUP#03

Page 22: Android, getting started

ANDROID TOOLS#03

Page 23: Android, getting started

#03

CONFIGURE THE SDK AND JAVA PATH

Page 24: Android, getting started

#00

Complete your setup!

Page 25: Android, getting started

…and then everything will

change!

COMPLETE YOUR SETUP #03

Page 26: Android, getting started

BUILD SYSTEMS

Page 27: Android, getting started

• Pure Java build tool

• Flexible and without formal conventions (aka directory structure)

• Procedural tasks based tool

ANT#04

Page 28: Android, getting started

• Based on the concept of a project object model (POM.xml)

• Describes how the software is built and its dependencies

• Built with a plugin based architecture

MAVEN#04

Page 29: Android, getting started

• Mixes the flexibility of ANT and the architecture of Maven

• Project files are written in Groovy (more readable)

• Based on scripting more than on conventions

GRADLE#04

Page 30: Android, getting started

MAVEN VS GRADLE

#04

Page 31: Android, getting started

APPLICATION BUILDING BLOCKS

Page 32: Android, getting started

• app, contains the actual project folder

• build, contains the compiled classes and the actual output

• res, contains images, locales, etc.

• gradle, contains the gradle system jar wrapper

• External libraries, it’s where external source code is referenced

PROJECT STRUCTURE

#05

Page 33: Android, getting started

#05

PROJECT VS

ANDROID

Page 34: Android, getting started

• Application components are the essential building blocks of an Android application

• These components are loosely coupled by the application manifest file AndroidManifest.xml

• There are following four main components that can be used: Activities, Services, Broadcast Receivers, Content Providers

COMPONENTS

#05

Page 35: Android, getting started

• An activity represents a single screen with a user interface

• In-short Activity performs actions on the screen

ACTIVITY#05

Page 36: Android, getting started

• A service is a component that runs in the background to perform long-running operations

• For example, a service might fetch data over the network without blocking user interaction with an activity

SERVICE#05

Page 37: Android, getting started

• Broadcast Receivers simply respond to broadcast messages from other applications or from the system

• Each message is broadcaster as an Intent object

BROADCAST RECEIVER

#05

Page 38: Android, getting started

• A content provider component supplies data from one application to others on request

• The data may be stored in the file system, the database or somewhere else entirely

CONTENT PROVIDER

#05

Page 39: Android, getting started

• Fragments, represent a portion of user interface in an Activity

• Views, UI elements that are drawn on-screen including buttons, lists forms etc.

• Layouts, view hierarchies that control screen format and appearance of the views.

• Intents, messages wiring components together

OTHERS#05

Page 40: Android, getting started

• It is a passive data structure holding an abstract description of an operation to be performed

• The Action is mandatory part of the Intent object and is a string naming the action to be performed

• Adds a data specification to an intent filter, a filter is an expression in an app's manifest file that specifies the type of intents that the component would like to receive

INTENT#05

Page 41: Android, getting started

• Using Intents

• Using Shared Preferences

• Usually not with a Service

COMMUNI-CATION

#05

Page 42: Android, getting started

• Layouts are an XML representation of the UI elements of an activity

• A style is defined in an XML resource that is separate from the XML that specifies the layout

• Once your style is defined, you can use it in your XML Layout file

LAYOUTS AND STYLES #05

Page 43: Android, getting started

LET’S CODE IT!#00

Page 44: Android, getting started

• http://www.drdobbs.com/jvm/why-build-your-java-projects-with-gradle/240168608

• http://stackoverflow.com/questions/603189/differences-between-ant-and-maven

• http://technologyconversations.com/2014/06/18/build-tools/

• http://www.drdobbs.com/jvm/why-build-your-java-projects-with-gradle/240168608

• http://www.helloandroid.com/tutorials/communicating-between-running-activities

• http://stackoverflow.com/questions/21393287/how-should-i-communicate-between-activities

• http://www.tutorialspoint.com/android/android_tutorial.pdf

• https://developer.android.com/training/basics/firstapp/index.html?hl=p

• http://www.sitepoint.com/better-user-interfaces-android-action-bar/

• http://www.objc.io/issues/11-android/android_101_for_ios_developers/

• http://www.sitepoint.com/scheduling-background-tasks-android/

#00

Resources