android development - process & tools

Post on 01-Jul-2015

530 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

Android Development - Process & Tools

TRANSCRIPT

Android DevelopmentProcess & Tools

by Lope Emano

The Android Stack

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

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

Where to find Environment Variables Dialog

How to set System Variable

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!

AVD Manager and Android SDKin Android Studio

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

Android SDK Manager

AVD Managerprovides a graphical user interface in which you can

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

AVD Manager

Creating an AVD

The Emulator

Enabling Developer Options (Device)

Enabling USB Debugging (Device)

Running and Debugging

Creating a new project

Templates

Finish!

Hello World

Android Project Structure

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.

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.

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

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

HDPI and MDPI

Images relative to DPI

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

AndroidManifest.xml

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!

build.gradle

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

top related