User Tools

Site Tools


android-labs-s14:class-01

Class 01

The class gives an introduction to Android. It also touches upon Android architecture from a very high level, and then quickly jumps into building first Android Hello World App.

What is Android?

  • An open source, open platform for mobile development
  • All the SDK, API, platform source is available
  • No licensing, no app review
  • Replace any system app with your own
  • Unified approach to application development (Apps should be able to run on different devices running Android)

Market Share

Android has leading market share worldwide. Following are some recent stats over top 5 Android and iOS markets:

Android Operating System

  • Mobile Operating System based on Linux Kernel
  • Supports background processing
  • Provides a rich user interface library
  • Supports 2-D and 3-D graphics using the OpenGL standard
  • Access to the file system
  • Provides an embedded SQLite database

Android Versions

Since April 2009, Android versions have been developed under a codename and released according to alphabetical order:

  • Cupcake (1.5)
  • Donut (1.6)
  • Eclair (2.0 - 2.1)
  • Froyo (2.2 - 2.2.3)
  • GingerBread (2.3 - 2.3.7)
  • HoneyComb (3.0 - 3.2.6)
  • IceCreamSandwich (4.0 - 4.0.4)
  • JellyBean (4.1 - 4.3)
  • KitKat (4.4)

Android Architecture

Main Components:

  • Linux Kernel
  • Libraries
  • Android Runtime
  • Enables every Android app to run in its own process, with its own instance of Dalvik virtual machine (Android apps are compiled into Dalvik executables (.apk)).
  • Dalvik is a specialized virtual machine designed specifically for Android and optimized for battery-powered devices with limited memory and CPU.
  • Application Framework
  • Applications

Environment Setup

:!: For a fresh setup, you can simply install ADT Bundle from Google. See 'Setting up ADT Bundle' for details. And, then, create an Android Virtual Device (AVD) (Link)

:-\ Otherwise, if you want to work on already installed Eclipse, you can follow below mentioned steps to setup Android environment:

  • Install appropriate JDK

Following commands should help you install jdk:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

If the above didn't work, check here for more details.

  • Download Android SDK (Link)
  • Configure Android SDK Manager (Link)
  • Download latest SDK tools & platforms by running following command: <android-sdk>/tools/android
  • Installing Eclipse ADT Plugin(Link)
  • Creating Android Virtual Device (AVD) (Link)

Building Your First App - Hello World!

Following are the steps to create a Hello World Project:

  • Now, just click on 'Run' to launch your application on our device/emulator.

Anatomy of Android Project

  • src - Contains .java source files.
  • gen - Contains compiler generated R.java file, having references to resources in the project.
  • Android 4.0 library - Contains android.jar file, which has all class libraries needed for app.
  • assets - Contains all assets (e.g., a audio or a video file), used by app.
  • bin - Contains binary files (including .apk file) built by ADT during the build process.
  • res - Contains all resources used by app.
  • AndroidManifest.xml - Allows to specify permissions required by app, as well as other features like intent-filters, intent receivers, etc.
android-labs-s14/class-01.txt · Last modified: 2014/01/27 00:16 by prakhar