android development - process & tools

35
Android Development Process & Tools by Lope Emano

Upload: lope-emano

Post on 01-Jul-2015

530 views

Category:

Documents


1 download

DESCRIPTION

Android Development - Process & Tools

TRANSCRIPT

Page 1: Android Development - Process & Tools

Android DevelopmentProcess & Tools

by Lope Emano

Page 2: Android Development - Process & Tools

The Android Stack

Page 3: Android Development - Process & Tools

Overview● Setting up development environment● Android Studio● Android AVD & SDK Manager● Project Structure Overview● Hello World!

Page 4: Android Development - Process & Tools

Setting up the environment● Download & install JDK 1.6 or jdk-6 from Oracle

Oracle password requirements can be a pain (needs capital letters, 11 chars)● set JDK_HOME environment variable● Download and install Android Studio

v0.8.0, June 2014

Page 5: Android Development - Process & Tools

Where to find Environment Variables Dialog

Page 6: Android Development - Process & Tools

How to set System Variable

Page 7: Android Development - Process & Tools

Android Studio● Based on IntelliJ IDE● Replaces Eclipse as the standard Android

Development IDE● Announced on 16 May 2013 at the Google I/O● Still in beta● Live Layout & Real-time App Rendering● Template-based wizards to create common Android

designs and components● More!

Page 8: Android Development - Process & Tools
Page 9: Android Development - Process & Tools

AVD Manager and Android SDKin Android Studio

Page 10: Android Development - Process & Tools

SDK ManagerThe Android SDK separates tools, platforms, and

other components into packages you can download using the SDK Manager.

● Download different versions of the Android SDK● Different System Images for testing purposes● Download build tools and its different images● Download developer preview sdks, i.e. Android L

Page 11: Android Development - Process & Tools

Android SDK Manager

Page 12: Android Development - Process & Tools

AVD Managerprovides a graphical user interface in which you can

create and manage Android Virtual Devices (AVDs), which are required by the Android Emulator

Page 13: Android Development - Process & Tools

AVD Manager

Page 14: Android Development - Process & Tools

Creating an AVD

Page 15: Android Development - Process & Tools

The Emulator

Page 16: Android Development - Process & Tools

Enabling Developer Options (Device)

Page 17: Android Development - Process & Tools

Enabling USB Debugging (Device)

Page 18: Android Development - Process & Tools

Running and Debugging

Page 19: Android Development - Process & Tools

Creating a new project

Page 20: Android Development - Process & Tools

Templates

Page 21: Android Development - Process & Tools

Finish!

Page 22: Android Development - Process & Tools

Hello World

Page 23: Android Development - Process & Tools

Android Project Structure

Page 24: Android Development - Process & Tools

Project StructureTwo main directories:

i. src/main/javaknown as source folder in Android project includes

stub MainActivity.java file. They contain the java code of the application.

Page 25: Android Development - Process & Tools

Project StructureTwo main directories:

ii. src/main/resContains all the resources required like images,

layouts and values.Resources are external files(non-code files) that are

used by your code and compiled into your application at build time.

Android Supports a number of different kinds of resources files, including XML, PNG and MP3 files.

Page 26: Android Development - Process & Tools

Project StructureThe resources (src/main/res) folder:

● res/drawabledrawable-xhdpi, drawable-hdpi, drawable-mdpi for

multiple screen size support.● res/layout

layouts are expressed in xml format● res/layout-land

layout for landscape mode● res/values

colors, text copies● res/menu

where you define your menu items in xml format

Page 27: Android Development - Process & Tools

Project StructureScreen densities:

● Dots Per Inch (DPI) or Pixels Per InchThe number of individual dots that can be placed in a

line within the span of 1 inch

● Density-independent pixelA virtual pixel unit that you should use when defining

UI layout, to express layout dimensions or position in a density-independent way

Page 28: Android Development - Process & Tools

HDPI and MDPI

Page 29: Android Development - Process & Tools

Images relative to DPI

Page 30: Android Development - Process & Tools

Project StructureThe AndroidManifest.xml file● Every application must have this file (with precisely

that name) in its root directory.● Presents essential information about your app to the

Android system.● Names the Java package for the application. The

package name serves as a unique identifier for the application. “com.google.android.gmail”

● Specifies the app’s name, versionCode, launcher icon, starting activity

● Specifies the different permissions needed to run the app

Page 31: Android Development - Process & Tools

AndroidManifest.xml

Page 32: Android Development - Process & Tools

Project StructureThe build.gradle file● Gradle is a project automation tool● Manages library dependencies, version for each

library and where to get them● Manages build types, i.e. debug build / release build● Specify the version of the android sdk to be used● and a whole lot more!

Page 33: Android Development - Process & Tools

build.gradle

Page 34: Android Development - Process & Tools

What we’ve learned:● The project structure provides support for multiple

screen types● Building your first app is easy● I don’t need a device to start working on the android

app I want to build● The AndroidManifest.xml file can be tedious so I really

need to read the docs in order to configure my android app properly

● Gradle can be very useful, especially on a team setting