A Best Android Introdtuction .
1. Android Introduction (Android components, Android Architecture, Activity life cycle, Activity stack etc.)
2. Near Field Communication (NFC) Overview.
3. Google map and GPS.
4. Push notification and C2DM concept.
2. Android Introduction
Near Field Communication
(NFC) Overview
Google map and GPS
C2DM
Android Push notification
Current Project
MyC-Calling on the Way
3. What is Android ?
Android: How it came to
be
Android Features
Android Architecture
Android Application
Component
4. Android is a software stack for mobile
devices that includes
Operating system
Middleware
Key mobile applications
Android SDK Provides the tool and
APIs to developer for developing
Application on android platform using
JAVA programming language.
What is Android ?
6. A simple and powerful SDK.
No fees for licensing, distribution,
development .
Development over many platform Linux,
Mac OS, windows .
Excellent documentation.
Based on Linux Kernel.
Led by Google and
Developed by Open Handset Alliance (OHA).
7. Android
The first complete, open and free mobile
platform
Release in November 2007
Initially rumoured to be some kind of
Gphone
An Open Handset Alliance Project.
Android: How it came to
be ?
8. Open Handset Alliance
Group of more that 30
technology and mobile
companies developing Android
Goal
Accelerate innovation in
mobile and offer consumers a
richer, less expensive, and
better mobile experience.
9.
10.
11. Application framework enable 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 .
SQLite for structured data storage
Android Features
12. Media support for common audio,
video, and image formats (MPEG4,
MP3, AAC, AMR, JPG, PNG, GIF)
GSM Telephony (hardware dependent)
Bluetooth, EDGE, 3G, and Wi-Fi
,NFC(hardware dependent)
Camera, GPS, compass, and
accelerometer (hardware dependent)
14. Android Architecture
Relies on Linux Kernel 2.6 for core system services:
Memory and Process Management
Network Stack
Driver Model
Security
The Kernel also acts as an abstraction layer
between the Hardware and rest of the Software stack
.
15. Android Architecture
Android Includes a set of C/C++ Libraries
used by various component of android
system .
These libraries tells the device how to
handle different kinds of data.
The Android runtime layer which includes
set of core java libraries and DVM (Dalvik
Virtual Machine) is also located in same
layer.
16. Android Architecture
This layer includes set of base libraries
that are required for java libraries. Every
Android application gets its own instance
of Dalvik virtual machine. Dalvik has
been written so that a device can run
multiple VMs efficiently and it executes
files in executable (.Dex) optimized for
minimum memory.
.Dex + Menifest = .Apk
17. Android Architecture
The application framework is a set of basic
tools with which a developer can build much
more complex tools.
18. Android Architecture
Android has set of core applications
including an email client, SMS
program, calendar, maps, browser,
contacts, and others. All applications
are written using the Java
programming language.
20. Android ArchitectureAndroid Component
An activity provides a user interface
for User as single screen of an
application.
For example, an activity might present a
list of menu items users can choose from
or it might display photographs along
with their captions.
Each one is implemented as a
subclass of the Activity base class.
23. Android Architecture
Android Application
Component
A service doesn't have a visual user interface,
but runs in the background for an indefinite
period of time.
For Example a service might play background music
as the user might fetch data over the network or
calculate some thing and provide the result to
activities that need it. Each service extends the
Service base class.
A service can essentially take two forms:
Started
Bound
24. Android Architecture
Android Application
Component
Started: A service is started when an
application component(such an activity)
starts by calling stratService(). Once
started, a service can run in background
indefinitely, even if thier component that
started it is destroyed.
Example : it might download or upload a file
over the network. When operation is done,
the service should stop itself .
25. Android Architecture
Android Application
Component
Bound: A service is Bound when an
application component(such an activity)
Bind to it by calling BindService(). A bound
service runs only application component is
bound to it but when all of them unbind,
the service is destroyed
Example : In music player when we play any
song it start with audio and it bind with all
activity of application .it stop only when
application component destroyed before
destroyed component ,it unbind that service .
Then service is destroyed .
26. Android Architecture
Android Application
Component
A content provider manages a shared
set of application data. We can store
the data in the file system, an SQLite
database, on the web or somewhere
else .But through the content
provider, other applications can
query or even modify the data.
Using Content Provider :
1.Contact Contact details
2.Browser Browser Bookmarks, history
3.SdCard Media files such as audio, video and
image
27. Android Architecture
Android Application
Component
A broadcast receiver is a component that
does nothing but receive and react to
broadcast announcements.
For Example, announcements that the
timezone has changed, that the battery is
low, that a picture has been taken, internet
connected .
29. Android Architecture
Android Application
Important Part :Manifest File
The Manifest is a structured XML file and is always
named AndroidManifest.xml for all applications.
it describes the components of the application like
its activities, services, broadcast receivers .
It determines which processes will host application
components, and it also declares the permission of
the application .
31. Android Architecture
Android Application
Important Part :Manifest File
Three of the core component of an application
–Activity , Services and Broadcast Receivers –
are activated through massages called Intent .For
example an Activity can send an Intents to the
Android system which starts another Activity.
The destination is explicitly defined in Intents.
32. Android Architecture
Android Application
Important Part :Manifest File
An Intent Filter define to
application system which intents
they can handle. An activities,
services, and broadcast receivers
can have one or more intent filters.
Each intent filter describes a
capability of the component.
It declare in manifest file of
application .
35. Android Architecture
Android Application
Important Part :Manifest File
NFC Near Field Communication is one of the
latest wireless communication technologies.
As a short-range wireless connectivity
technology, NFC offers safe— yet simple and
intuitive — communication between electronic
devices. Users of NFC-enabled devices can
simply point or touch their devices to other
NFC-enabled elements in the environment to
communicate with them, making application
and data usage easy and convenient.
Near Field Communication
(NFC) Overview
36. Android Architecture
Android Application
Important Part :Manifest File
NFC (Near Field Communication)
Communication technology based on radio waves at
13.56 MHz frequency
Short range (<= 10 cm theoretical, 1-4 cm typical)
Low speed (106 / 216 / 414 kbps)
Low friction setup (no discovery, no pairing)
• Setup-time < 0.1 Sec
Communication roles:
• Master Device: NFC Initiator (starts communication,
typically a device)
• Slave Device: NFC Target (passive tag or device)
NFC Forum (founded 2004 by NXP, Sony, Nokia)
• Popularization of NFC
Today: More than 150 members
Near Field Communication
(NFC) Overview
38. Android Architecture
Android Application
Important Part :Manifest File
Near Field Communication
(NFC) Overview
Android and NFC
Android Gingerbread
Tag reading (2.3.2)
Tag writing (2.3.3)
Limited P2P (NDEF push only, 2.3.3)
Android NFC Devices
Nexus S contains PN544 NFC Controller from NXP + SecureMX
–Embedded Secure Element
–Support of SE on SIM
Samsung Galaxy S2
–SWP (no embedded SE)
43. Android Architecture
Android Application
Important Part :Manifest File
Near Field Communication
(NFC) OverviewGoogle map and GPS
Android provides us with a library
known as Google Maps Library, using
which we can create a map viewing
acivity of our own.
It is completed in two steps:-
• Generate MD5 fingerprint
• Generate unique API key
44. Android Architecture
Android Application
Important Part :Manifest File
Near Field Communication
(NFC) OverviewGoogle map and GPS
We need the "debug.keystore" file that can be
found at the following path
"C:Documents and Settingsrahul.tripathi.android“
Open command Prompt and go to the Java installed
directory. ("C:Program FilesJava<JDK1.6>bin")
Then type the below line (given in box) and press
enter.
keytool.exe -list -alias androiddebugkey -keystore "
C:Documents and Settingsrahul.tripathi.android " -
storepass android -keypass android
45. Android Architecture
Android Application
Important Part :Manifest File
Near Field Communication
(NFC) OverviewGoogle map and GPS
It is necessary to login in google account to
generate the API key.
Then follow this link :
http://code.google.com/android/maps-api-signup.html
47. Android Architecture
Android Application
Important Part :Manifest File
Near Field Communication
(NFC) Overview
Known As Global Positioning System
The Global Positioning System (GPS) is a
space-based satellite navigation system
that provides location information
anywhere on the Earth.
G.P.S. is freely accessible to anyone with a
GPS receiver.
Only devices which are GPS hardware
enable can receive the signal and show
the position.
Google map and GPS
48. Android Architecture
Android Application
Important Part :Manifest File
Knowing where the user is, allows our
application to be smarter and deliver
better information to the user.
When developing a location-aware
application for Android, we can utilize
GPS.
To use Gps in android we need a
reference to the system Location
Manager. And a listener that responds
to location updates.
On location changed() method gives
the position when device position
changes.
Near Field Communication
(NFC) OverviewGoogle map and GPS
51. Android Architecture
Android Application
Important Part :Manifest File
Near Field Communication
(NFC) OverviewGoogle map and GPS
C2DM
Android Push notification
Pull :
Most of useful applications on your mobile phone use
the internet to keep users connected .Traditionally
many apps use pulling to fetch data periodically .
Example :Connect to the server every 15 minute .
Some time it get data some times not .it create
unnecessary stress on the server and network .
Polling is especially problematic for mobile device
because it consume s Precious network bandwidth
and battery life .
52. Android Architecture
Android Application
Important Part :Manifest File
Near Field Communication
(NFC) OverviewGoogle map and GPS
C2DM
Android Push notification
Push Notification :
• After android 2.2 is possible to push notification
to an Android app. This service is called "Cloud to
Device messaging" or short C2DM.
• In the iOS world it is knows as “push
notifications”
53. Android Architecture
Android Application
Important Part :Manifest File
Near Field Communication
(NFC) OverviewGoogle map and GPS
C2DM
Android Push notification
Android Cloud to Device Messaging (C2DM)
was launched in 2010. it 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 queuing of messages and
delivery to the target application running on
the target device.
54. Android Architecture
Android Application
Important Part :Manifest File
Near Field Communication
(NFC) OverviewGoogle map and GPS
C2DM
Android Push notification
It allows third-party application.
C2DM makes no guarantees about delivery or the
order of messages.
An application on an Android device doesn’t need to
be running to receive messages.
It does not provide any built-in user interface or other
handling for message data.
It requires devices running Android 2.2 or higher that
also have the Market application installed.
It uses an existing connection for Google services.
56. Android Architecture
Android Application
Important Part :Manifest File
Near Field Communication
(NFC) OverviewGoogle map and GPS
C2DM
Android Push notification
Lifecycle Flow
Here are the primary processes involved in
cloud-to-device messaging:
Enabling C2DM An Android application
running on a mobile device registers to
receive messages.
Sending a message A third-party application
server sends messages to the device.
Receiving a message An Android application
receives a message from a C2DM server.
57. Android Architecture
Android Application
Important Part :Manifest File
Near Field Communication
(NFC) OverviewGoogle map and GPS
C2DM
Android Push notification
Limitations
C2DM imposes the following limitations:
The message size limit is 1024 bytes.
Google limits the number of messages
a sender sends in aggregate, and the
number of messages a sender sends to
a specific device.
58. Android Architecture
Android Application
Important Part :Manifest File
Near Field Communication
(NFC) OverviewGoogle map and GPS
C2DM
Android Push notification
Goodbye C2DM ! Welcome GCM !
GCM is the next generation of C2DM
59. Android Architecture
Android Application
Important Part :Manifest File
Near Field Communication
(NFC) OverviewGoogle map and GPS
C2DM
Android Push notification
Google Cloud Massaging (GCM)
Google Cloud Massaging (GCM) replaces the beta
version of Android cloud to device messaging (C2DM).
Google Cloud Messaging for Android (GCM) is a service
that helps developers send data from servers to their
Android applications on Android devices.
This could be a lightweight message telling the Android
application that there is new data to be fetched from
the server (for instance, a movie uploaded by a friend),
or it could be a message containing up to 4kb of
payload data (so apps like instant messaging can
consume the message directly).
60. Android Architecture
Android Application
Important Part :Manifest File
Near Field Communication
(NFC) OverviewGoogle map and GPS
C2DM
Android Push notification
Google Cloud Massaging (GCM)
GCM uses an existing connection for
Google services. For pre-3.0 devices,
this requires users to set up their
Google account on their mobile
devices.
A Google account is not a
requirement on devices running
Android 4.0.4 or higher.
61. Android Architecture
Android Application
Important Part :Manifest File
Near Field Communication
(NFC) OverviewGoogle map and GPS
C2DM
Android Push notification
GCM replaces C2DM. The focus of
GCM is as follows:
• Ease of use. No sign-up forms.
• No quotas.
• GCM and C2DM stats are available
through the Android Developer
Console.
• Battery efficiency.
• Rich set of new APIs.
62. Android Architecture
Android Application
Important Part :Manifest File
Near Field Communication
(NFC) OverviewGoogle map and GPS
C2DM
Android Push notification
Difference Between C2DM and GCM
GCM builds on the core foundation of C2DM. Here is
what's different:
• Simple API Key
• Sender ID
• JSON format
• Multicast messages
• Multiple senders
• Time-to-live messages
• Messages with payload
• Canonical registration ID
64. Android Architecture
Android Application
Important Part :Manifest File
Near Field Communication
(NFC) OverviewGoogle map and GPS
C2DM
Android Push notification
Current Project
MyC-Calling on the Way
If you call mostly out of India then you purchase calling card
from the market . Scratch off Card and get Number mostly
given on the back of the card .This is the gateway or the Toll
Free number that you need to dial to make an international
call. Using Country region pin (Like India +91) with Number
of friend which you want to Call but if you have lot of call out
of India then Its very irritating to us to keep card and save this
with different different International number .
My C Calling Card Application make help to its user MyC
provide service to save there calling card Data and use
that saved calling card with any of international number
which is saved in our mobile . It gives option when we want
to make a international call can choose any one of saved
calling card .
65. Android Architecture
Android Application
Important Part :Manifest File
Near Field Communication
(NFC) OverviewGoogle map and GPS
C2DM
Android Push notification
Current Project
MyC-Calling on the Way
Important Keyword of Apps :
Title of the card : Its easy to name your cards by either
the brand of card you use, or the card you use to dial a
particular country.
For example, Japanese Card for all your Japan contacts.
Number : This is the gateway or the Toll Free number
that you need to dial to make an international call. Its
mostly given on the back of the card.
Pin Code : Pin Code is Country region Code .It printed
with card .
EX. Card title = Jpn
Country Code Number = 23435336
Card Pin Code = 85