Andriod For Beginner

Android Programming

Android is an open source and Linux-based Operating System for mobile devices such as smartphones and tablet computers.

Speciality of android

  • open source
  • Larger developer and community research
  • Increased marketing
  • Inter app integration
  • Reduced cost of development
  • Higher Success Ratio
  • Rich development environment


Android IDEs

There are so many Technologies are available to develop android applications, the familiar technologies, but tools we are using now is

  • Android Studio
  • Eclips IDE


Android SDK

The Android SDK (software development kit) is a set of development tools used to develop applications for Android platform.

For Example Syntax :

<uses-sdk android:minSdkVersion=”integer”


android:maxSdkVersion=”integer” />

What is API Level?

API Level is an integer value that uniquely identifies the framework API revision offered by a version of the Android platform.

The Android platform provides a framework API that applications can use to interact with the underlying Android system. The framework API consists of:

  • A core set of packages and classes
  • A set of XML elements and attributes for declaring a manifest file
  • A set of XML elements and attributes for declaring and accessing resources
  • A set of Intents
  • A set of permissions that applications can request, as well as permission enforcements included in the system


Platform VersionAPI LevelVERSION_CODENotes
Android 6.023MAPI Changes
Android 5.122LOLLIPOP_MR1Platform Highlights
Android 5.021LOLLIPOP
Android 4.4W20KITKAT_WATCHKitKat for Wearables Only
Android 4.419KITKATPlatform Highlights
Android 4.318JELLY_BEAN_MR2Platform Highlights
Android 4.2, 4.2.217JELLY_BEAN_MR1Platform Highlights
Android 4.1, 4.1.116JELLY_BEANPlatform Highlights
Android 4.0.3, 4.0.415ICE_CREAM_SANDWICH_MR1Platform Highlights
Android 4.0, 4.0.1, 4.0.214ICE_CREAM_SANDWICH
Android 3.213HONEYCOMB_MR2
Android 3.1.x12HONEYCOMB_MR1Platform Highlights
Android 3.0.x11HONEYCOMBPlatform Highlights
Android 2.3.4
Android 2.3.3
10GINGERBREAD_MR1Platform Highlights
Android 2.3.2
Android 2.3.1
Android 2.3
Android 2.2.x8FROYOPlatform Highlights
Android 2.1.x7ECLAIR_MR1Platform Highlights
Android 2.0.16ECLAIR_0_1
Android 2.05ECLAIR
Android 1.64DONUTPlatform Highlights
Android 1.53CUPCAKEPlatform Highlights
Android 1.12BASE_1_1
Android 1.01BASE


Android Libraries

This category encompasses those Java-based libraries that are specific to Android development. Examples of libraries in this category include the application framework libraries in addition to those that facilitate user interface building, graphics drawing and database access. A summary of some key core Android libraries available to the Android developer is as follows − − Provides access to the application model and is the cornerstone of all Android applications.

android.content − Facilitates content access, publishing and messaging between applications and application components.

android.database − Used to access data published by content providers and includes SQLite database management classes.

android.opengl − A Java interface to the OpenGL ES 3D graphics rendering API.

android.os − Provides applications with access to standard operating system services including messages, system services and inter-process communication.

android.text − Used to render and manipulate text on a device display.

android.view − The fundamental building blocks of application user interfaces.

android.widget − A rich collection of pre-built user interface components such as buttons, labels, list views, layout managers, radio buttons etc.

android.webkit − A set of classes intended to allow web-browsing capabilities to be built into applications.

Having covered the Java-based core libraries in the Android runtime, it is now time to turn our attention to the C/C++ based libraries contained in this layer of the Android software stack.


An activity represents a single screen with a user interface,in-short Activity performs actions on the screen. If an application has more than one activity, then one of them should be marked as the activity that is presented when the application is launched.

For Example :

public class MainActivity extends Activity {


Create Android Application

The first step is to create a simple Android Application using Android studio. Follow the option File -> New -> New Project . Now name your application as HelloWorld , select Company domain , package name and click next.

In next page select select SDKs level , most commonly used SDKs level is API 15 by default because it will support upto 94{1d6e369f27b3b55fac77a13f30e13d2b04ce9713b9295394d4a423074fd2099f} of mobile devices. click next and select the Activity you want , here select activity_name , layout_name that you are going to use and click finish.

Anatomy of Android Application

Before you run your app, you should be aware of a few directories and files in the Android project −

1. src

This contains the .java source files for your project. By default, it includes an source file having an activity class that runs when your app is launched using the app icon.

2. gen

This contains the .R file, a compiler-generated file that references all the resources found in your project. You should not modify this file.

3. bin

This folder contains the Android package files .apk built by the ADT during the build process and everything else needed to run an Android application.

4. res/drawable-hdpi

This is a directory for drawable objects that are designed for high-density screens.

5. res/layout

This is a directory for files that define your app’s user interface.

6. res/values

This is a directory for other various XML files that contain a collection of resources, such as strings and colours definitions.

7. AndroidManifest.xml

This is the manifest file which describes the fundamental characteristics of the app and defines each of its components.

Main Activity .java

package com.example.helloworld;

import android.os.Bundle;


import android.view.Menu;

import android.view.MenuItem;


public class MainActivity extends Activity {


public void onCreate(Bundle savedInstanceState) {





public boolean onCreateOptionsMenu(Menu menu) {

getMenuInflater().inflate(, menu);

return true;



The Manifest File

Whatever component you develop as a part of your application, you must declare all its components in a manifest.xml which resides at the root of the application project directory. This file works as an interface between Android OS and your application, so if you do not declare your component in this file, then it will not be considered by the OS.

For Example :

<manifest xmlns:android=””



android:versionName=”1.0″ >



android:targetSdkVersion=”22″ />




android:theme=”@style/AppTheme” >



android:label=”@string/title_activity_main” >


<action android:name=”android.intent.action.MAIN” />

<category android:name=”android.intent.category.LAUNCHER”/>





The String File

The strings.xml file is located in the res/values folder and it contains all the text that your application uses. For example, the names of buttons, labels, default text, and similar types of strings go into this file. This file is responsible for their textual content.

For Example :


<string name=”app_name”>HelloWorld</string>

<string name=”hello_world”>Hello world!</string>

<string name=”menu_settings”>Settings</string>

<string name=”title_activity_main”>MainActivity</string>


The Layout File

The activity_main.xml is a layout file available in res/layout directory, that is referenced by your application when building its interface. You will modify this file very frequently to change the layout of your application.

For Example :

<RelativeLayout xmlns:android=””



android:layout_height=”match_parent” >








tools:context=”.MainActivity” />


Basic Java Programming (Prev Lesson)
(Next Lesson) Web Services
Back to Andriod For Beginner
Inquire Now
close slider