Between love and madness lies obsession

crookpatedhatMobile - Wireless

Dec 10, 2013 (3 years and 8 months ago)

80 views

Between love and madness lies obsession

Platform Presentation

Your First Android Experience

Shrey Malhotra

27 / April / 2011

Introduction

What’s an Android
?


“Android is a software stack for mobile devices

that includes an operating system, middleware

and key applications”


An droid

a
robot with a
human appearance.

Introduction

What’s an Android
?


Operating System for Mobile Devices

HTC G1, GOOGLE NEXUS S


SDK

Compiler, tools and IDE


Market

Free or paid


A Platform for your Applications

Based on the Linux kernel, Development on JAVA


Introduction

Google’s Master Plan


• make the cloud more
accessible


increase connectivity

• make the client more
powerful

Introduction

August 2005

Google’s Master Plan


Introduction

Open Handset Alliance

November
2007

Google’s Master Plan


Introduction

Open Handset Alliance

November
2007

Google’s Master Plan


Introduction

Android SDK

November 2007

Google’s Master Plan


Introduction


September 2008

Google’s Master Plan


Introduction

Google’s Master Plan


Why Android?

Why Android?

Why Android?

Hardware


Android is not a single piece of hardware; it's a complete, end
-
to
-
end software

platform that can be adapted to work on any number of hardware configurations.

Everything is there, from the bootloader all the way up to the applications.




Operating System(s)


Android uses Linux for its device drivers, memory management, process

management, and networking.


The next level up contains the
Android native libraries
. They are all written in

C/C++ internally, but you’ll be calling them through
Java

interfaces. In this layer

you can find the Surface Manager, 2D and 3D graphics, Media codecs, the

SQL database (SQLite), and a native web browser engine (WebKit).


Dalvik Virtual Machine.
Dalvik runs dex files, which are converted at compile

time from standard class and jar files.







Platform

Network Connectivity


It supports wireless communications using:


GSM mobile
-
phone technology


3G


Edge


802.11 Wi
-
Fi networks


Security


Android is a multi
-
process system, in which each application (and parts of the system) runs
in its own process. Most security between applications and the system is enforced at the
process level through standard Linux facilities, such as user and group IDs that are
assigned to applications.






Platform

Platform

Getting Started

Android 3.0 (Honeycomb)


SDK Ver 11


Android 2.3.3 (Gingerbread)


SDK Ver 10


Android 2.3 (Gingerbread)




SDK
Ver

9

Android 2.2 (Froyo)




SDK Ver 8

Android 2.1 (Eclair)




SDK Ver 7

Android 1.6 (Donut)



SDK Ver 4

Android 1.5 (Cupcake)


SDK Ver 3



Android


The Family





Getting Started
-

Prerequisites





Where to find all these ?

Lets see !!

IDE
-

Integrated Development Environment

Things
R
equired ?

Java Developers Kit(JDK)


Android SDK


Eclipse or any other IDE


Android Development Tool ADT



Getting Started
-

Prerequisites





Java Developers Kit (JDK)














http://www.oracle.com/technetwork/java/jav
ase/downloads/index.html

Or Google



download jdk
” :P

Getting Started
-

Prerequisites





Java Developers Kit (JDK)




















Getting Started
-

Prerequisites





Android SDK














http://developer.android.com/sdk/index.html




Getting Started
-

Prerequisites





Eclipse
-

IDE














http://www.eclipse.org/downloads/




Getting Started
-

Prerequisites





Android Developer Tool (ADT)














Add
https://dl
-
ssl.google.com/android/eclipse/

to
Eclipse Update Manager


or directly download it from

http://dl.google.com/android/ADT
-
10.0.1.zip



Getting Started
-

Prerequisites





Things
R
equired ?

Java Developers Kit(JDK)



Android SDK



Eclipse or any other IDE




䅮摲潩搠䑥v敬潰e敮琠e潯氠䅄T

















IDE
-

Integrated Development Environment

Getting Started
-

Installing


Installing


JDK

Eclipse

Android SDK

ADT



Lets see how it is done *


Preparing the Environment















*Screen
-
cast

Getting Started


Hello Android !!

















Hello Android !!

Getting Started


Hello Android !!
















Creating a New Android Project


From Eclipse,

Select File > New > Project >
Android Project (only after
everything was set up properly)








Getting Started


Hello Android !!
















Creating a New Android Project


Fill in the project details with the
following values:


Project name:
HelloAndroid

Application name
: HelloAndroid

Package name:
com.example.helloandroid

Create Activity:

HelloAndroid








Getting Started


Hello Android !!
















Getting Started


Hello Android !!
















Getting Started


Hello Android !!
















Getting Started


Hello Android !!
















Project Name

This is the Eclipse Project name


the name of the directory that will contain
the project files.


Application Name

This is the human
-
readable title for your application


the name that will appear
on the Android device.


Package Name

This is the package namespace (following the same rules as for packages in the
Java programming language) that you want all your source code to reside
under. The example above uses the "com.example" namespace


Create Activity

An Activity is simply a class that can run and do work. It can create a User
Interface if it chooses, but it doesn't need to. As the checkbox suggests, this is
optional, but an Activity is almost always used as the basis for an application.

Getting Started


Hello Android !!
















SOURCE CODE

Source
directories,
where your
classes go…

Getting Started


Hello Android !!
















package com.example.helloandroid;


import android.app.Activity;

import android.os.Bundle;


public class HelloAndroid extends Activity {


/** Called when the activity is first created. */


@Override


public void onCreate(Bundle
savedInstanceState) {


super.onCreate(savedInstanceState);


setContentView(R.layout.main);


}

}

Getting Started


Hello Android !!


Run the Application


The Eclipse plug
-
in makes it easy to run
your applications:

Select Run > Run.

Select "Android Application".

`

Getting Started


Hello Android !!


Run the Application


OOPS!! An Error

Getting Started


Running Your Application
















Create an Android Virtual Device (Emulator )

Start the AVD
Manager:


In Eclipse: select
Window > Android SDK
and AVD Manager, or
click the Android SDK
and AVD Manager icon
in the Eclipse toolbar.

An Android Virtual Device (AVD) is an emulator that simulates a real
-
world
Android device, such as a mobile phone or Tablet PC. You can use AVDs to
test how your application performs on a wide variety of Android devices,
without having to buy every gadget on the market.

Getting Started


Running Your Application
















Create an Android Virtual Device (Emulator )

In the Virtual Devices panel, you'll see
a list of existing AVDs. Click New to
create a new AVD. The Create New
AVD dialog appears.

Getting Started


Running Your Application
















Create an Android Virtual Device (Emulator )

Fill in the details for the AVD.


Give it a name, a platform target, an
SD card size, and a skin (HVGA is
default). You can also add specific
hardware features of the emulated
device by clicking the New... button
and selecting the feature.


Getting Started


Running Your Application
















Start an Android Virtual Device (Emulator )

Getting Started


Running Your Application
















It takes times to start up the emulator...

Getting Started


Running Your Application
















Getting Started


Hello Android !!


Lets run the App again !!


Select Run > Run.

Select "Android Application".

or

Press Ctrl + F11

`

Getting Started


Running Your Application
















Congratulations your first Android App !!

Getting Started


Running Your Application
















Getting Started


Running Your Application
















Understanding the Code


Activity:

A single screen.

Your app is made up of

one or more Activities


Service:
A task that can

be running while not

visible.



Understanding the Code


Intent:
Code to

accomplish a verb, like

“call number” or “open

comic” and to allow app to

app communication.



Understanding the Code


Content Provider:
Data

and an API that any app

can access.


Android provides contact information

through a Content Provider.


Understanding the Code


Resource:
Text, pictures,

sound, etc. Everything is

broken out of the code

into a resource, which is

compiled into a class

called R

Understanding the Code


Drawable
:
A bitmap or xml

definition of something

that can be drawn.

Understanding the Code


The manifest

• Declares the permissions the application will need


(uses
-
permission)

• Declare permissions that activities or services might require to
use your app (permission)



Defines the activities, services, broadcast receivers etc

• Provide hardware access

And much more..

Understanding the Code


<?xml version=
"1.0" encoding="utf
-
8"?>

<manifest
xmlns:android
=
"http://schemas.android.com/apk/res/android"

package=
"
com.bikerolas
"

android:versionCode
=
"30"

android:versionName
=
"1.2">

<uses
-
permission
android:name
=
"
android.permission.RECEIVE_BOOT_COMPLETED
" />

<uses
-
permission
android:name
=
"
android.permission.ACCESS_LOCATION

/>

<uses
-
permission
android:name
=
"
android.permission.ACCESS_GPS
" />

<uses
-
permission
android:name
=
"
android.permission
. ACCESS_CELL_ID />

<application
android:icon
=
"@
drawable
/flingicn1"
android:label
="@string/
app_name
"
android:debuggable
="false">

<activity
android:name
=
".Fling"

android:label
=
"@string/
app_name
">

<intent
-
filter>

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

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

</intent
-
filter>

</activity>

<service
android:name
=
".
FlingService
" />

<receiver
android:name
=
".
FlingServiceManager
"

android:permission
=
"
android.permission.RECEIVE_BOOT_COMPLETED
">

<intent
-
filter>

<action
android:name
=
"
android.intent.action.BOOT_COMPLETED
" />

</intent
-
filter>

</receiver>

</application>

<uses
-
sdk

android:minSdkVersion
=
"2"></uses
-
sdk
>

</manifest>

Understanding the Code


The XML Layout



Lets have a look *

*Screen
-
cast

Understanding the Code





To be continued…








Any questions?





Q & A




Thank You !!