SlideShare a Scribd company logo
1 of 22
Android Programming
• An Introduction ---
• Android is an
• Operating system
• Developed by Google
• For use in Notebooks
• & Mobile Phones.
Introduction
 Android is a software bunch comprising not only
operating system but also middleware and key
applications. Android Inc was founded in Palo
Alto of California, U.S. by Andy Rubin, Rich
miner, Nick sears and Chris White in 2003. Later
Android Inc. was acquired by Google in 2005.
After original release there have been number of
updates in the original version of Android.
 It is Java based and supports the
Google APIs
Main Features of
Android
 Application framework enabling reuse and replacement of components.
 Dalvik virtual machine optimized for mobile devices.
 Integrated browser based on the open source WebKit engine .
 Optimized graphics powered by a custom 2D graphics library; 3D
graphics based on the OpenGL ES 1.0 specification (hardware
acceleration optional).
 SQLite for structured data storage.
 Media support for common audio, video, and still image formats
(MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, GIF).
 GSM Telephony (hardware dependent).
 Bluetooth, EDGE, 3G, and Wi-Fi (hardware dependent).
 Camera, GPS, compass, and accelerometer (hardware dependent).
 Rich development environment including a device emulator, tools for
debugging, memory and performance profiling, and a plug-in for the
Eclipse IDE.
Android Framework
Google APIs in Android
 Google APIs Add-On is an extension to the Android SDK development environment that lets you
develop applications for devices that include Google's set of custom applications, libraries, and
services. A central feature of the add-on is the Maps external library, which lets you add powerful
mapping capabilities to your Android application.
 The add-on also provides a compatible Android system image that runs in the Android Emulator,
which lets you debug, profile, and test your application before publishing it to users. The system
image includes the the Maps library and other custom system components that your applications
may need, to access Google services (such as Android C2DM). The add-on does not include any
custom Google applications. When you are ready to publish your application, you can deploy it to
any Android-powered device that runs a compatible version of the Android platform and that also
includes the custom Google components, libraries, and services.
 The Google APIs add-on includes:
 The Maps external library
 The USB Open Accessory Library (only with API Levels 10 and 12+)
 A fully-compliant Android system image (with the Maps library and other custom system
components built in)
 A sample Android application called MapsDemo
 Full Maps library documentation
Google Cloud API
 Android Cloud to Device Messaging Framework
 Android Cloud to Device Messaging (C2DM) is a
service that helps developers send data from
servers to their applications on Android devices.
The service provides a simple, lightweight
mechanism that servers can use to tell mobile
applications to contact the server directly, to
fetch updated application or user data. The
C2DM service handles all aspects of queueing of
messages and delivery to the target application
running on the target device.
Using Google Maps API
• Build location-based apps
• Build maps for mobile apps
• Visualize Geospatial Data Create 3D images
with the Earth API, heat maps in Fusion Tables
• Customize your maps Create customized maps
that highlight your data, imagery, and brand.
Google Earth API
Google Earth API
 Google Earth is available in Android Market
on most devices that have Android 2.1 or
later versions. So as devices such as Droid get
updated to Android 2.1, others will also be
able to fly to the far reaches of the globe with
a swipe of their finger.
Google Earth for Nexus One is used in the
Android Market.
Google Search API
• Google search and Google image search are
both available for Android.
• Free licensing is provided for
1000 searches per day.
Animations in Android
• Animations are supported in Android
both programmatically and directively.
Android Animation
Example (1)
 HypatiaBasicAnimationActivity.java
 package hypatia.animation.basic;
import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
public class HypatiaBasicAnimationActivity extends Activity {
 /** Called when the activity is first created. */
 static HypatiaAnimationView v;
static int[] colors={Color.WHITE,Color.YELLOW,Color.MAGENTA,Color.GREEN,Color.RED};
static int colorno=0;
@Override
public void onCreate(Bundle savedInstanceState) {
//This is the first method to be executed
super.onCreate(savedInstanceState);
v=new HypatiaAnimationView(this);//Create the view and store it in a static variable for further use
setContentView(v);//Make this view the current view. This means that whenever the view is invalidated it's onDraw method will be called
}
Android Animation
Example (1)
Android Animation
Example (2)
 public class HypatiaAnimationView extends View implements AnimationListener {
String themessage="Reserve your right to think, for even to think wrongly is better than not to think at all.";
public HypatiaAnimationView(Context context) {
super(context);
paint = new Paint();
paint.setColor(HypatiaBasicAnimationActivity.colors[HypatiaBasicAnimationActivity.colorno]);
HypatiaBasicAnimationActivity.colorno=(HypatiaBasicAnimationActivity.colorno + 1) %
HypatiaBasicAnimationActivity.colors.length;
// TODO Auto-generated constructor stub
}
Paint paint;//The paint object for the drawing
@Override
public void onDraw(Canvas canvas)
{
super.onDraw(canvas);
if (hypatiaanimationset == null) {//If the animation set is null, create it
//***********************Create the Animation Set****************************
{
hypatiaanimationset=new AnimationSet(true);
animation = new AlphaAnimation(1F, 0F);
animation.setRepeatMode(Animation.REVERSE);
animation.setRepeatCount(Animation.INFINITE);
animation.setDuration(5000);
animation.setAnimationListener(this);
Data Access in
Android
• Android comes with a inbuilt SQLite
database.
• SQLite is a software library that implements a
self-contained, serverless, zero-configuration,
transactional SQL database engine. SQLite is
the most widely deployed SQL database
engine in the world. The source code for
SQLite is in the public domain.
Main Feature of SQLite
 Main Feature of SQLite:-
 Transactions are atomic, consistent, isolated, and durable (ACID) even after system crashes and power failures.
 Zero-configuration - no setup or administration needed.
 Implements most of SQL92. (Features not supported)
 A complete database is stored in a single cross-platform disk file.
 Supports terabyte-sized databases and gigabyte-sized strings and blobs. (See limits.html.)
 Small code footprint: less than 350KiB fully configured or less than 200KiB with optional features omitted.
 Faster than popular client/server database engines for most common operations.
 Simple, easy to use API.
 Written in ANSI-C. TCL bindings included. Bindings for dozens of other languages available separately.
 Well-commented source code with 100% branch test coverage.
 Available as a single ANSI-C source-code file that you can easily drop into another project.
 Self-contained: no external dependencies.
 Cross-platform: Unix (Linux, Mac OS-X, Android, iOS) and Windows (Win32, WinCE, WinRT) are supported out of
the box. Easy to port to other systems.
 Sources are in the public domain. Use for any purpose.
 Comes with a standalone command-line interface (CLI) client that can be used to administer SQLite databases.
A Simple Android SQL Lite
Program(1)
 android.database.sqlite.SQLiteOpenHelper
This class needs to be subclassed to provide for creation of the database.
It has two methods
@Override
public void onCreate(SQLiteDatabase database) {
//Called when the database is created.
}
@Override
public void onUpgrade(SQLiteDatabase database, int oldversion, int newversion) {
//Called when the database is upgraded.
}
 android.database.sqlite.SQLiteDatabase
Encapsulates a connection to a SQLite database and provides methods for sending queries to the
Database and recovering the result.
android.database.Cursor 
This class provides methods for accessing the results of a select query.It can be compared to the
java.sql.ResultSet.
A Simple Android SQL Lite
Program(2)
 if(b.equals(bttncreate))
{
try
{
database.execSQL( "create table HypatiaBooks(bookname text primary key,price integer not null )");
txtResult.setText("Table Created");
}
catch (Exception ex) {
// TODO: handle exception
txtResult.setText(ex.getMessage());
}
}
if(b.equals(bttninsert))
{
try
{
String bookname="" + txtBookName.getText();
bookname=bookname.replaceAll("'", "''").trim();
String price="" + txtPrice.getText();
price=price.replaceAll("'","''").trim();
database.execSQL("insert into HypatiaBooks values('" + bookname + "'," + price + ")");
txtResult.setText("Data Inserted");
}
catch (Exception ex) {
// TODO: handle exception
txtResult.setText(ex.getMessage());
}
}
}
A Simple Android SQL Lite
Program(3)
 if(b.equals(bttnselect))
{
try
{
String bookname="" + txtBookName.getText();
bookname=bookname.replaceAll("'", "''").trim();
String[] columns={"Price"};
String selection="BookName='"+ bookname + "'";
cursor= database.query("HypatiaBooks", columns, selection, null, null, null, null);
if(cursor==null)
{
txtResult.setText("No Data Found");
return;
}
if(cursor.moveToFirst())
{
int price=cursor.getInt(0);
txtPrice.setText("" + price);
txtResult.setText("Data Selected");
}
else
txtResult.setText("No Data Found");
cursor.close();
}
catch (Exception ex) {
// TODO: handle exception
txtResult.setText(ex.getMessage());
}
}
Web Services in
Android
• A Web Service is a XML based system for
implementing Remote Procedure Calls.
• It uses SOAP , the Simple Object Access
Protocol for accessing the Remote Object.
• The WSDL or Web Services description
Language is used to describe the methods in
the Web Service.
Web Services in
Android
 @Override
    public void onClick(View arg0) {
        // TODO Auto-generated method stub
        try
        {
        String namespace = "http://tempuri.org/";
        String url ="http://hypatiasoftwaresolutions.com/HypatiaQuotesService.asmx?WSDL";    
        String soapaction = "http://tempuri.org/getBirthday";
        String methodname = "getBirthday";
        SoapObject request = new SoapObject(namespace, methodname);     
        request.addProperty("name","" + txtname.getText());
        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
        envelope.dotNet=true;
        envelope.setOutputSoapObject(request);
        HttpTransportSE androidHttpTransport = new HttpTransportSE (url);
        
            androidHttpTransport.call(soapaction, envelope);
            org.ksoap2.serialization.SoapObject resultsRequestSOAP =(org.ksoap2.serialization.SoapObject) envelope.bodyIn;
            txtBirthday.setText("" + resultsRequestSOAP.getProperty(0));
        }
        catch(Exception ex)
        {
            tv.setText("" + ex);
        }
    }
}
Conclusion
 Android is a truly open, free developement platform based on linux
and open source. Handset makers can use and customize the
platform without paying a royalty.
 A component-based architecture inspired by Internet mash-ups.
parts of one application can be used in another in ways not
originally envisioned by the developer. can use even replace built-
in components with own improved version.
 This will unleash a new round of creativity in the mobile space.
 Android is open to all : industry, developers and users.
 Participating in many of the successful open source projects.
 Aims to be as easy to build for as the web.
 Google Android is stepping into the next level of mobile Internet.
THANK YOU……..

More Related Content

What's hot

UIViewControllerのコーナーケース
UIViewControllerのコーナーケースUIViewControllerのコーナーケース
UIViewControllerのコーナーケース
Katsumi Kishikawa
 
Android Development project
Android Development projectAndroid Development project
Android Development project
Minhaj Kazi
 

What's hot (8)

Android - Android Application Configuration
Android - Android Application ConfigurationAndroid - Android Application Configuration
Android - Android Application Configuration
 
Mobile Application Development with JUCE and Native API’s
Mobile Application Development with JUCE and Native API’sMobile Application Development with JUCE and Native API’s
Mobile Application Development with JUCE and Native API’s
 
iOS Development (Part 3) - Additional GUI Components
iOS Development (Part 3) - Additional GUI ComponentsiOS Development (Part 3) - Additional GUI Components
iOS Development (Part 3) - Additional GUI Components
 
Android overview
Android overviewAndroid overview
Android overview
 
The Glass Class - Tutorial 3 - Android and GDK
The Glass Class - Tutorial 3 - Android and GDKThe Glass Class - Tutorial 3 - Android and GDK
The Glass Class - Tutorial 3 - Android and GDK
 
UIViewControllerのコーナーケース
UIViewControllerのコーナーケースUIViewControllerのコーナーケース
UIViewControllerのコーナーケース
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_auth
 
Android Development project
Android Development projectAndroid Development project
Android Development project
 

Viewers also liked (11)

Napkin instructions
Napkin  instructionsNapkin  instructions
Napkin instructions
 
FS PPT Napkin Folding
FS PPT Napkin FoldingFS PPT Napkin Folding
FS PPT Napkin Folding
 
HRMPS 13 - (MIDTERM) Chapter 3 Restaurant
HRMPS 13 - (MIDTERM) Chapter 3   RestaurantHRMPS 13 - (MIDTERM) Chapter 3   Restaurant
HRMPS 13 - (MIDTERM) Chapter 3 Restaurant
 
Napkin folding
Napkin foldingNapkin folding
Napkin folding
 
TABLE NAPKIN FOLDING (BBTE)
TABLE NAPKIN FOLDING (BBTE)TABLE NAPKIN FOLDING (BBTE)
TABLE NAPKIN FOLDING (BBTE)
 
Breakfast Service Sequence
Breakfast Service SequenceBreakfast Service Sequence
Breakfast Service Sequence
 
Different types of table napkin
Different types of table napkinDifferent types of table napkin
Different types of table napkin
 
Table Napkin Folding
Table Napkin FoldingTable Napkin Folding
Table Napkin Folding
 
04 sequence of service
04  sequence of service04  sequence of service
04 sequence of service
 
F&b service operation(week2)
F&b service operation(week2)F&b service operation(week2)
F&b service operation(week2)
 
HOSPITALITY FOOD & BEVERAGE SERVICE
HOSPITALITY FOOD & BEVERAGE SERVICE HOSPITALITY FOOD & BEVERAGE SERVICE
HOSPITALITY FOOD & BEVERAGE SERVICE
 

Similar to Android programming

Presentation on Android application
Presentation on Android applicationPresentation on Android application
Presentation on Android application
Atibur Rahman
 
Android Introduction
Android IntroductionAndroid Introduction
Android Introduction
aswapnal
 

Similar to Android programming (20)

Android OS & SDK - Getting Started
Android OS & SDK - Getting StartedAndroid OS & SDK - Getting Started
Android OS & SDK - Getting Started
 
PPT Companion to Android
PPT Companion to AndroidPPT Companion to Android
PPT Companion to Android
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Java Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development WorkshopJava Meetup - 12-03-15 - Android Development Workshop
Java Meetup - 12-03-15 - Android Development Workshop
 
Presentation on Android application
Presentation on Android applicationPresentation on Android application
Presentation on Android application
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android-Tutorial.ppt
Android-Tutorial.pptAndroid-Tutorial.ppt
Android-Tutorial.ppt
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
Technology and Android.pptx
Technology and Android.pptxTechnology and Android.pptx
Technology and Android.pptx
 
Android Applications Development: A Quick Start Guide
Android Applications Development: A Quick Start GuideAndroid Applications Development: A Quick Start Guide
Android Applications Development: A Quick Start Guide
 
Android
AndroidAndroid
Android
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspective
 
Android In A Nutshell
Android In A NutshellAndroid In A Nutshell
Android In A Nutshell
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_auth
 
Android Introduction
Android IntroductionAndroid Introduction
Android Introduction
 
Project
ProjectProject
Project
 
Android Basic
Android BasicAndroid Basic
Android Basic
 

Recently uploaded

Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
SanaAli374401
 

Recently uploaded (20)

Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 

Android programming

  • 1. Android Programming • An Introduction --- • Android is an • Operating system • Developed by Google • For use in Notebooks • & Mobile Phones.
  • 2. Introduction  Android is a software bunch comprising not only operating system but also middleware and key applications. Android Inc was founded in Palo Alto of California, U.S. by Andy Rubin, Rich miner, Nick sears and Chris White in 2003. Later Android Inc. was acquired by Google in 2005. After original release there have been number of updates in the original version of Android.  It is Java based and supports the Google APIs
  • 3. Main Features of Android  Application framework enabling reuse and replacement of components.  Dalvik virtual machine optimized for mobile devices.  Integrated browser based on the open source WebKit engine .  Optimized graphics powered by a custom 2D graphics library; 3D graphics based on the OpenGL ES 1.0 specification (hardware acceleration optional).  SQLite for structured data storage.  Media support for common audio, video, and still image formats (MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, GIF).  GSM Telephony (hardware dependent).  Bluetooth, EDGE, 3G, and Wi-Fi (hardware dependent).  Camera, GPS, compass, and accelerometer (hardware dependent).  Rich development environment including a device emulator, tools for debugging, memory and performance profiling, and a plug-in for the Eclipse IDE.
  • 5. Google APIs in Android  Google APIs Add-On is an extension to the Android SDK development environment that lets you develop applications for devices that include Google's set of custom applications, libraries, and services. A central feature of the add-on is the Maps external library, which lets you add powerful mapping capabilities to your Android application.  The add-on also provides a compatible Android system image that runs in the Android Emulator, which lets you debug, profile, and test your application before publishing it to users. The system image includes the the Maps library and other custom system components that your applications may need, to access Google services (such as Android C2DM). The add-on does not include any custom Google applications. When you are ready to publish your application, you can deploy it to any Android-powered device that runs a compatible version of the Android platform and that also includes the custom Google components, libraries, and services.  The Google APIs add-on includes:  The Maps external library  The USB Open Accessory Library (only with API Levels 10 and 12+)  A fully-compliant Android system image (with the Maps library and other custom system components built in)  A sample Android application called MapsDemo  Full Maps library documentation
  • 6. Google Cloud API  Android Cloud to Device Messaging Framework  Android Cloud to Device Messaging (C2DM) is a service that helps developers send data from servers to their applications on Android devices. The service provides a simple, lightweight mechanism that servers can use to tell mobile applications to contact the server directly, to fetch updated application or user data. The C2DM service handles all aspects of queueing of messages and delivery to the target application running on the target device.
  • 7. Using Google Maps API • Build location-based apps • Build maps for mobile apps • Visualize Geospatial Data Create 3D images with the Earth API, heat maps in Fusion Tables • Customize your maps Create customized maps that highlight your data, imagery, and brand.
  • 9. Google Earth API  Google Earth is available in Android Market on most devices that have Android 2.1 or later versions. So as devices such as Droid get updated to Android 2.1, others will also be able to fly to the far reaches of the globe with a swipe of their finger. Google Earth for Nexus One is used in the Android Market.
  • 10. Google Search API • Google search and Google image search are both available for Android. • Free licensing is provided for 1000 searches per day.
  • 11. Animations in Android • Animations are supported in Android both programmatically and directively.
  • 12. Android Animation Example (1)  HypatiaBasicAnimationActivity.java  package hypatia.animation.basic; import android.app.Activity; import android.graphics.Color; import android.os.Bundle; public class HypatiaBasicAnimationActivity extends Activity {  /** Called when the activity is first created. */  static HypatiaAnimationView v; static int[] colors={Color.WHITE,Color.YELLOW,Color.MAGENTA,Color.GREEN,Color.RED}; static int colorno=0; @Override public void onCreate(Bundle savedInstanceState) { //This is the first method to be executed super.onCreate(savedInstanceState); v=new HypatiaAnimationView(this);//Create the view and store it in a static variable for further use setContentView(v);//Make this view the current view. This means that whenever the view is invalidated it's onDraw method will be called } Android Animation Example (1)
  • 13. Android Animation Example (2)  public class HypatiaAnimationView extends View implements AnimationListener { String themessage="Reserve your right to think, for even to think wrongly is better than not to think at all."; public HypatiaAnimationView(Context context) { super(context); paint = new Paint(); paint.setColor(HypatiaBasicAnimationActivity.colors[HypatiaBasicAnimationActivity.colorno]); HypatiaBasicAnimationActivity.colorno=(HypatiaBasicAnimationActivity.colorno + 1) % HypatiaBasicAnimationActivity.colors.length; // TODO Auto-generated constructor stub } Paint paint;//The paint object for the drawing @Override public void onDraw(Canvas canvas) { super.onDraw(canvas); if (hypatiaanimationset == null) {//If the animation set is null, create it //***********************Create the Animation Set**************************** { hypatiaanimationset=new AnimationSet(true); animation = new AlphaAnimation(1F, 0F); animation.setRepeatMode(Animation.REVERSE); animation.setRepeatCount(Animation.INFINITE); animation.setDuration(5000); animation.setAnimationListener(this);
  • 14. Data Access in Android • Android comes with a inbuilt SQLite database. • SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. SQLite is the most widely deployed SQL database engine in the world. The source code for SQLite is in the public domain.
  • 15. Main Feature of SQLite  Main Feature of SQLite:-  Transactions are atomic, consistent, isolated, and durable (ACID) even after system crashes and power failures.  Zero-configuration - no setup or administration needed.  Implements most of SQL92. (Features not supported)  A complete database is stored in a single cross-platform disk file.  Supports terabyte-sized databases and gigabyte-sized strings and blobs. (See limits.html.)  Small code footprint: less than 350KiB fully configured or less than 200KiB with optional features omitted.  Faster than popular client/server database engines for most common operations.  Simple, easy to use API.  Written in ANSI-C. TCL bindings included. Bindings for dozens of other languages available separately.  Well-commented source code with 100% branch test coverage.  Available as a single ANSI-C source-code file that you can easily drop into another project.  Self-contained: no external dependencies.  Cross-platform: Unix (Linux, Mac OS-X, Android, iOS) and Windows (Win32, WinCE, WinRT) are supported out of the box. Easy to port to other systems.  Sources are in the public domain. Use for any purpose.  Comes with a standalone command-line interface (CLI) client that can be used to administer SQLite databases.
  • 16. A Simple Android SQL Lite Program(1)  android.database.sqlite.SQLiteOpenHelper This class needs to be subclassed to provide for creation of the database. It has two methods @Override public void onCreate(SQLiteDatabase database) { //Called when the database is created. } @Override public void onUpgrade(SQLiteDatabase database, int oldversion, int newversion) { //Called when the database is upgraded. }  android.database.sqlite.SQLiteDatabase Encapsulates a connection to a SQLite database and provides methods for sending queries to the Database and recovering the result. android.database.Cursor  This class provides methods for accessing the results of a select query.It can be compared to the java.sql.ResultSet.
  • 17. A Simple Android SQL Lite Program(2)  if(b.equals(bttncreate)) { try { database.execSQL( "create table HypatiaBooks(bookname text primary key,price integer not null )"); txtResult.setText("Table Created"); } catch (Exception ex) { // TODO: handle exception txtResult.setText(ex.getMessage()); } } if(b.equals(bttninsert)) { try { String bookname="" + txtBookName.getText(); bookname=bookname.replaceAll("'", "''").trim(); String price="" + txtPrice.getText(); price=price.replaceAll("'","''").trim(); database.execSQL("insert into HypatiaBooks values('" + bookname + "'," + price + ")"); txtResult.setText("Data Inserted"); } catch (Exception ex) { // TODO: handle exception txtResult.setText(ex.getMessage()); } } }
  • 18. A Simple Android SQL Lite Program(3)  if(b.equals(bttnselect)) { try { String bookname="" + txtBookName.getText(); bookname=bookname.replaceAll("'", "''").trim(); String[] columns={"Price"}; String selection="BookName='"+ bookname + "'"; cursor= database.query("HypatiaBooks", columns, selection, null, null, null, null); if(cursor==null) { txtResult.setText("No Data Found"); return; } if(cursor.moveToFirst()) { int price=cursor.getInt(0); txtPrice.setText("" + price); txtResult.setText("Data Selected"); } else txtResult.setText("No Data Found"); cursor.close(); } catch (Exception ex) { // TODO: handle exception txtResult.setText(ex.getMessage()); } }
  • 19. Web Services in Android • A Web Service is a XML based system for implementing Remote Procedure Calls. • It uses SOAP , the Simple Object Access Protocol for accessing the Remote Object. • The WSDL or Web Services description Language is used to describe the methods in the Web Service.
  • 20. Web Services in Android  @Override     public void onClick(View arg0) {         // TODO Auto-generated method stub         try         {         String namespace = "http://tempuri.org/";         String url ="http://hypatiasoftwaresolutions.com/HypatiaQuotesService.asmx?WSDL";             String soapaction = "http://tempuri.org/getBirthday";         String methodname = "getBirthday";         SoapObject request = new SoapObject(namespace, methodname);              request.addProperty("name","" + txtname.getText());         SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);          envelope.dotNet=true;         envelope.setOutputSoapObject(request);         HttpTransportSE androidHttpTransport = new HttpTransportSE (url);                      androidHttpTransport.call(soapaction, envelope);             org.ksoap2.serialization.SoapObject resultsRequestSOAP =(org.ksoap2.serialization.SoapObject) envelope.bodyIn;             txtBirthday.setText("" + resultsRequestSOAP.getProperty(0));         }         catch(Exception ex)         {             tv.setText("" + ex);         }     } }
  • 21. Conclusion  Android is a truly open, free developement platform based on linux and open source. Handset makers can use and customize the platform without paying a royalty.  A component-based architecture inspired by Internet mash-ups. parts of one application can be used in another in ways not originally envisioned by the developer. can use even replace built- in components with own improved version.  This will unleash a new round of creativity in the mobile space.  Android is open to all : industry, developers and users.  Participating in many of the successful open source projects.  Aims to be as easy to build for as the web.  Google Android is stepping into the next level of mobile Internet.