SlideShare a Scribd company logo
June 21, 2017 www.snipe.co.in 1
June 21, 2017 2
Android Overview
June 21, 2017 3
Agenda
•Android Overview
- what is android
- Features of Android
- Why Android?
- Android History
• Platform
- Hardware
-operating system
-network connectivity
-security
-performance
• Development environment
- java
- android sdk
- eclipse
- IDE & Tools
-software
-Emulators
June 21, 2017 4
Android Overview
• What is Android ?
•Android is software stack for mobile devices that includes an
operating system, middleware and key applications.
• Built on Linux kernel
• Developed by Google and later the Open Handset Alliance(OHA)
• Allows writing managed code in Java Language
June 21, 2017 5
Android Overview
• 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)
June 21, 2017 6
Android Overview
• Features of Android ?
•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 WiFi (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 plugin for the Eclipse
IDE
June 21, 2017 7
Android Overview
• Why Android ?
•The OHA is committed to make their vision a reality: to deploy the
Android platform for every mobile operator, handset manufacturers and
developers to build innovative devices
• Google Android Sales to Overtake iPhone in 2012
• Engineering expertise to help run Android on embedded hardware, which
aside from cellphones, mobile internet devices, and portable media players,
could include GPS devices, thin-client computers and set-top boxes.
• The ability for anyone to customize the Google Android platform
June 21, 2017 8
Android Overview
• Android History?
• 2005
Google acquires startup Android Inc. to start Android platform
Work on Dalvik VM begins
• 2007
Open Handset Alliance announced
Early look at SDK
• 2008
Google sponsors 1st  Android Developer Challenge
T-Mobile G1 announced
SDK 1.0 released
Android released open source (Apache License)
Android Dev Phone 1 released
June 21, 2017 9
Android Overview
• History ..
•2009
•SDK 1.5 (Cupcake)
•New soft keyboard with “autocomplete” feature
•SDK 1.6 (Donut)
•Support Wide VGA
•SDK 2.0/2.0.1/2.1 (Eclair)
•Revamped UI, browser
•2010
•Nexus One released to the public
•SDK 2.2 (Froyo)
•Flash support, tethering
•SDK 2.3 (Gingerbread)
•UI update, system-wide copy-paste
June 21, 2017 10
Android Overview
• Android History ..
•2011
•SDK 3.0 (Honeycomb) for tablets only
•New UI for tablets, support multi-core processors
•SDK 3.1 and 3.2
•Hardware support and UI improvements
•SDK 4.0 (Ice Cream Sandwich)
•For Q4, combination of Gingerbread and Honeycomb
June 21, 2017 11
Android Overview
•
June 21, 2017 12
Android Platform
• 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
June 21, 2017 13
Android Platform
• Operating System ?
• 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.
June 21, 2017 14
Android Platform
• Network Connectivity
It supports wireless communications using:
 GSM mobile-phone technology
 3G
 Edge
 802.11 Wi-Fi networks
June 21, 2017 15
Android Platform
• 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.
• Additional finer-grained security features are provided through a
"permission" mechanism that enforces restrictions on the specific
operations that a particular process can perform, and per-URI
permissions for granting ad-hoc access to specific pieces of data.
June 21, 2017 16
Android Platform
• Performance
June 21, 2017 17
Development Environment
• Development Requirements
• Java.
• Android SDK.
• Eclipse IDE (optional)
• Emulators
June 21, 2017 18
Development Environment
• IDE & Tools
• Android SDK.
• Class Library
• Developer Tools
 dx – Dalvik Cross-Assembler
 aapt – Android Asset Packaging Tool
 adb – Android Debug Bridge
 ddms – Dalvik Debug Monitor Service
• Emulator and System Images
• Documentation and Sample Code
• Eclipse IDE + ADT (Android Development Tools)
• Reduces Development and Testing Time
• Makes User Interface-Creation easier
• Makes Application Description Easier
June 21, 2017 19
Development Environment
• Emulators or AVD
•Emulator is essential to testing app but is not a substitute for a real
device
•Emulators are called Android Virtual Devices (AVDs)
•Android SDK and AVD Manager allows you to create AVDs that
target any Android API level
•AVD have configurable resolutions, RAM, SD cards, skins, and other
hardware
June 21, 2017 20
Development Environment
• Emulators or AVD :1.6 Device
June 21, 2017 21
Development Environment
• Emulators or AVD : 2.2 Device
June 21, 2017 22
Development Environment
• Emulators or AVD : 3.0 Device
•
June 21, 2017 23
Development Environment
• Emulators Basics
•Host computer’s keyboard works
•Host’s mouse works like finger
•Uses host’s Internet connection
•Side buttons work: Home, Menu, Back, Search, volume up and down, etc.
•
•Ctrl-F11 toggle landscape  portrait
•Alt-Enter toggle full-screen mode
•More info at
http://developer.android.com/guide/developing/devices/emulator.html
June 21, 2017 24
Development Environment
• Emulators Limitations:
•No support for placing or receiving actual phone calls
•Simulate phone calls (placed and received) through the emulator console
•No support for USB connections
•No support for camera/video capture (input)
•No support for device-attached headphones
•No support for determining connected state
•No support for determining battery charge level and AC charging state
•No support for determining SD card insert/eject
•No support for Bluetooth
•
June 21, 2017 25
Development Environment
• Programming Languages
• Java Officially Supported
• C/C++ also possible but not Supported
June 21, 2017 26
Android Architecture
June 21, 2017 27
Agenda
•Architecture
- Applications
- Application Frameworks
- Libraries & Android Runtime
- Linux Kernel
June 21, 2017 28
Android Architecture
• Major Components
June 21, 2017 29
Android Architecture
• Applications
• Android will ship with a 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.
June 21, 2017 30
Android Architecture
• Application Frameworks
• By providing an open development platform, Android offers developers the ability
to build extremely rich and innovative applications.
• Developers are free to take advantage of the device hardware, access location
information, run background services, set alarms, add notifications to the status bar,
and much, much more.
• Developers have full access to the same framework APIs used by the core
applications.
• The application architecture is designed to simplify the reuse of components; any
application can publish its capabilities and any other application may then make use of
those capabilities (subject to security constraints enforced by the framework).
June 21, 2017 31
Android Architecture
• Application Frameworks
• A rich and extensible set of Views that can be used to build an application,
including lists, grids, text boxes, buttons, and even an embeddable web browser
• Content Providers that enable applications to access data from other applications
(such as Contacts), or to share their own data
• A Resource Manager, providing access to non-code resources such as localized
strings, graphics, and layout files
• A Notification Manager that enables all applications to display custom alerts in the
status bar
• An Activity Manager that manages the lifecycle of applications and provides a
common navigation backstack
June 21, 2017 32
Android Architecture
• Libraries
• Android includes a set of C/C++ libraries used by various components of the
Android system. These capabilities are exposed to developers through the
Android application framework. Some of the core libraries are listed below:
• System C library - a BSD-derived implementation of the standard C system
library (libc), tuned for embedded Linux-based devices
• Media Libraries - based on PacketVideo's OpenCORE; the libraries support
playback and recording of many popular audio and video formats, as well as
static image files, including MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG
• Surface Manager - manages access to the display subsystem and seamlessly
composites 2D and 3D graphic layers from multiple applications
June 21, 2017 33
Android Architecture
• Libraries
• LibWebCore - a modern web browser engine which powers both the Android
browser and an embeddable web view
• SGL - the underlying 2D graphics engine
• 3D libraries - an implementation based on OpenGL ES 1.0 APIs; the libraries
use either hardware 3D acceleration (where available) or the included, highly
optimized 3D software rasterizer
• FreeType - bitmap and vector font rendering
• SQLite - a powerful and lightweight relational database engine available to all
applications
June 21, 2017 34
Android Architecture
• Android Runtime
• Android includes a set of core libraries that provides most of the functionality
available in the core libraries of the Java programming language.
• Every Android application runs in its own process, with its own instance of the
Dalvik virtual machine.
• Dalvik has been written so that a device can run multiple VMs efficiently. The
Dalvik VM executes files in the Dalvik Executable (.dex) format which is optimized
for minimal memory footprint.
• The VM is register-based, and runs classes compiled by a Java language compiler
that have been transformed into the .dex format by the included "dx" tool.
• The Dalvik VM relies on the Linux kernel for underlying functionality such as
threading and low-level memory management
June 21, 2017 35
Android Architecture
• Linux Kernel
• Android relies on Linux version 2.6 for core system services such as security,
memory management, process management, network stack, and driver model. The
kernel also acts as an abstraction layer.
• performs security
• Memory management
• Process Management
• Power management
• Hardware drivers
June 21, 2017 36
Installation & Configuration
June 21, 2017 37
Agenda
• Installation & Configuration
- Setup Development Environment
- Overview of Tools
- Debugging
- Simple Example to test
June 21, 2017 38
Installation & Configuration
• Setup Development tools
• The best way to develop applications for Android is using the
Eclipse IDE and the Android plug-in for Eclipse called Android
Development Tools (ADT). The plug-in allows you to run your
applications on an Android Virtual Device (AVD), aka Android
emulator.
http://www.slideshare.net/magicshui/android-installation-guide Kindly
follow this url and prepare this installation guide as follows.
June 21, 2017 39
Installation & Configuration
• Installation Steps
• Install & Configure Java
• Download & Configure Eclipse
• Install ADT Plugin for eclipse
• How to develop simple project and Run the application
• How to debug
June 21, 2017 40
Install & Configure Java
• Installing JDK on Windows
• For the version of the JDK, download latest version from the URL
http://www.oracle.com/technetwork/java/archive-139210.html
• Select Download J2SE SDK. ( e.g. jdk is 6 update 1 )
• Select and download Windows Installation, Multi-language.
• Save and install the .exe file.
• If prompted, install the JDK to C Drive
June 21, 2017 41
Install & Configure Java
• Installing JDK on Windows
• For the version of the JDK, download latest version from the URL
http://www.oracle.com/technetwork/java/archive-139210.html
• Select Download J2SE SDK. ( e.g. jdk is 6 update 1 )
• Select and download Windows Installation, Multi-language.
• Save and install the .exe file.
• If prompted, install the JDK to C Drive
June 21, 2017 42
Install & Configure Java
• Installing JDK on Windows
• Now a "License Agreement" window opens. Just read the agreement
and click "Accept" button to accept and go further.
June 21, 2017 43
Install & Configure Java
• Installing JDK on Windows
• Now a "Custom Setup" window  opens.
June 21, 2017 44
Install & Configure Java
• Installing JDK on Windows
• Click on "Change" button to choose the installation directory. Here
it is "C:Program Files Javajdk1.6.0_01". Now click on "OK”
June 21, 2017 45
Install & Configure Java
• Installing JDK on Windows
• Clicking the "OK" button starts the installation. It is shown in the
following figure.
June 21, 2017 46
Install & Configure Java
• Installing JDK on Windows
• Next window asks to install Runtime Environment. 
June 21, 2017 47
Install & Configure Java
• Installing JDK on Windows
• Click the "Change" button to choose the installation directory of
Runtime Environment. We prefer not to change it. So click "OK“  
June 21, 2017 48
Install & Configure Java
• Installing JDK on Windows
• Click "OK"  button starts the installation. Click "Finish" after
installation.
June 21, 2017 49
Install & Configure Java
• Installing JDK on Windows
• The above installation will create two folders "jdk1.6.0_01" and
"jre1.6.0_01" in "C: Program Files java" folder.
June 21, 2017 50
Install & Configure Java
• Installing JDK on Windows
• To make available Java Compiler and Runtime Environment for
compiling and running java programs, set the system environment
variables. 
June 21, 2017 51
Install & Configure Java
• Installing JDK on Windows
• Now set the JAVA_HOME variable and set its value to "
C:Program FilesJavajdk1.6.0_01 ".
June 21, 2017 52
Install & Configure Java
• Installing JDK on Windows
• Now this is the final step to check that you have installed jdk
successfully and it is working fine. Just go to the command prompt
and type javac and hit enter key you will get the help screen on
command prompt.
June 21, 2017 53
Download & Configure Eclipse
• Setup Android SDK With Eclipse
• Operating Systems support for Android SDK
• Windows XP (32-bit), Vista (32- or 64-bit), or Windows 7 (32- or 64-
bit)
• Mac OS X 10.5.8 or later (x86 only)
• Linux (tested on Ubuntu Linux, Lucid Lynx). GNU C Library (glibc) 2.7
or later is required. On Ubuntu Linux, version 8.04 or later is required.
64-bit distributions must be capable of running 32-bit applications.
• Eclipse IDE support
• Eclipse 3.4 (Ganymede) or greater.
• Eclipse JDT plugin (included in most Eclipse IDE packages)
June 21, 2017 54
Download & Configure Eclipse
• Setup Android SDK With Eclipse
• download Android SDK for your system from
http://developer.android.com/sdk/index.html
• Windows : installer_r16-windows.exe or android-sdk_r16-windows.zip.
• Mac OS (intel) : android-sdk_r16-mac_x86.zip
• Linux (i386) : android-sdk_r16-linux_x86.tgz
• Need latest version of JDK to be able to use Android SDK with
Eclipse. We already seen in previous slides.
June 21, 2017 55
Download & Configure Eclipse
• Installing Android SDK
• Since we use Windows I present here how it works in Windows. but
it should be almost similar in other Operating Systems.
• The Android SDK we have just downloaded is not the complete
software required to begin the development. It is just the core SDK
tool which can be used to download the rest of the SDK components.
• When you click the '.exe' installer windows will ask you if you want
to save the file or cancel download as seen in the figure below. Select
Save File and wait for the file to download.
June 21, 2017 56
Download & Configure Eclipse
• Installing Android SDK
• After the file has downloaded run the setup file. You will be shown
the welcome screen. Press Next on this screen.
June 21, 2017 57
Download & Configure Eclipse
• Installing Android SDK
• If JDK is not found on your system you will be asked to download it
from the Java website. Click on Visit java.oracle.com to install the
JDK. Without the JDK you cannot continue with the installation. If
you already have JDK installed you can proceed next Step.
June 21, 2017 58
Download & Configure Eclipse
• Installing Android SDK
• After Installing the JDK you can press the Back button and then
click Next button on the Android SDK installer. Now you will see that
the previously disabled 'Next' button is enabled. Click the Next
button to proceed forward.
• We will now be asked to choose the directory where you want to
install Android SDK tools. Remember the name and location of the
SDK directory on your system as you will need to refer to the SDK
directory later, when setting up the ADT plugin and when using the
SDK tools from command line. In this article we use the default SDK
location C:Program FilesAndroidandroid-sdk.
June 21, 2017 59
Download & Configure Eclipse
• Installing Android SDK
After choosing the location where the SDK will be installed press Next.
June 21, 2017 60
Download & Configure Eclipse
• Installing Android SDK
• Next you will be asked to Choose if you want to make a Start Menu
Folder. If you do not want to make a Start Menu Folder select the
box Do not create shortcuts. If you want to create Start Menu
Folder than just click Install.
June 21, 2017 61
Download & Configure Eclipse
• Installing the ADT Plugin for Eclipse
• As stated on the Android's Developer website "Android offers a
custom plugin for the Eclipse IDE, called Android Development Tools
(ADT), that is designed to give you a powerful, integrated
environment in which to build Android applications. It extends the
capabilites of Eclipse to let you quickly set up new Android projects,
create an application UI, debug your applications using the Android
SDK tools, and even export signed (or unsigned) APKs in order to
distribute your application. In general, developing in Eclipse with ADT
is a highly recommended approach and is the fastest way to get
started with Android."
June 21, 2017 62
Download & Configure Eclipse
• Follow the steps below to install the ADT plugin in
Eclipse:
•  Eclipse must be installed on your system to proceed further from
here.
• Eclipse 3.6 (Helios). Start Eclipse and then select Help > Install
New Software
June 21, 2017 63
Download & Configure Eclipse
• Steps below to install the ADT plugin in Eclipse:
• Click Add, on the top right corner. A small Add Repository Dialog
appears. In this Dialog enter "ADT Plugin" for the Name and the URL
for the Location: https://dl-ssl.google.com/android/eclipse/
June 21, 2017 64
Download & Configure Eclipse
• Steps below to install the ADT plugin in Eclipse:
• Next you will be back in the Available Software dialog. In this dialog
select the checkbox next to Developer Tools and click Next.
June 21, 2017 65
Download & Configure Eclipse
• Steps below to install the ADT plugin in Eclipse:
• Eclipse will look for dependencies and then show you the next
window. Here you can see a list of the tools to be downloaded. Click
Next.
June 21, 2017 66
Download & Configure Eclipse
• Steps below to install the ADT plugin in Eclipse:
• Next you will be shown the license agreements. Read and accept the
license agreements, then click Finish.
• After the installation finishes, restart Eclipse.
June 21, 2017 67
Download & Configure Eclipse
• Configuring the ADT Plugin
• Till now we have been able to Install Android SDK tools and ADT
for Eclipse. The next step is to modify the ADT preferences in
Eclipse to point to the Android SDK. We follow the following steps to
do this task:
June 21, 2017 68
Download & Configure Eclipse
• Configuring the ADT Plugin
• Start Eclipse. Select Window > Preferences... to open the
Preferences panel.
June 21, 2017 69
Download & Configure Eclipse
• Configuring the ADT Plugin
• In the left panel you can see Android. Select Android. You can now
click Browse... to locate the folder where you have downloaded the
Android SDK. Select the folder which contains the tools folder.
• Now you are all done to move to the final step before you can start
development for Android SDK. Click Apply, then OK.
June 21, 2017 70
Download & Configure Eclipse
• Adding Platforms and Other Components
• This is the last step before you can start developing your apps for
Android SDK. In this step we will see how to use Android SDK and
AVD Manager to download the important SDK components for the
development environment. The steps involved are,
• Start Eclipse, select Window > Android SDK and AVD Manager or
we can go to the root directory ('C:Program FilesAndroidandroid-
sdk') where we have installed the Android SDK and double-click the
'SDK Manager.exe' file.
June 21, 2017 71
Download & Configure Eclipse
• Adding Platforms and Other Components
June 21, 2017 72
Application Development
June 21, 2017 73
Agenda
• Application Fundamental
• Key-concepts of Android
- Android Project Structure
- Activities
- Services
- Broadcast Receiver
- Content Provider
- Intents
June 21, 2017 74
Android Fundamental
• Android Fundamental
• Android applications are composed of one or more application components (activities,
services, content providers, and broadcast receivers)
• Each component performs a different role in the overall application behavior, and each
one can be activated individually (even by other applications)
•The manifest file must declare all components in the application and should also declare
all application requirements, such as the minimum version of Android required and any
hardware configurations required
•Non-code application resources (images, strings, layout files, etc.) should include
alternatives for different device configurations (such as different strings for different
languages and different layouts for different screen sizes)
June 21, 2017 75
Android Fundamental
• Android Fundamental
• Android applications are written in the Java programming language.
• The Android SDK tools compile the code—along with any data and resource
files—into an Android package, an archive file with an .apk suffix.
• All the code in a single .apk file is considered to be one application and is the
file that Android-powered devices use to install the application
• Once installed on a device, each Android application lives in its own security
sandbox
• The Android operating system is a multi-user Linux system in which each
application is a different user.
June 21, 2017 76
Android Fundamental
• Android Fundamental
• By default, the system assigns each application a unique Linux user
ID (the ID is used only by the system and is unknown to the
application).
• The system sets permissions for all the files in an application so
that only the user ID assigned to that application can access them.
• Each process has its own virtual machine (VM), so an application's
code runs in isolation from other applications.
June 21, 2017 77
Android Fundamental
• Android Fundamental
Java
code
Byte
code
Dalvik
exe
Byte
code <xml>
<str
>
.java .class
Other .class files
javac
dx
classes.dex
AndroidManifest.xml
Resources
.apk
aapt
June 21, 2017 78
Key-Concepts of Android
• Project Structure : Step to create android project
June 21, 2017 79
Key-Conceps of Android
• Project Structure : Step to provide details
June 21, 2017 80
Key-Conceps of Android
• Project Structure : created project structure
June 21, 2017 81
Key-Concepts of Android
• Project Structure
- When project is created, there are 8 key elements of project
structure are created as follows.
-AndroidManifest.xml
- build.xml
- bin/
- libs
- src/
- res
- assets
- gen
June 21, 2017 82
Key-Concepts of Android
• AndroidManifest.xml
- Declares all the app’s components
- Names of app libraries needs to be linked
- Identifies the permission of the app aspects to be granted
June 21, 2017 83
Key-Concepts of Android
•build.xml
It is an ANT script for compiling the application and installing on the device.
BIN /:
-When you compile your project (via ant or the IDE), the results go into the
bin/ directory under your project root. bin/classes/ holds the compiled Java classes
- Bin/classes.dex holds the executable created from those compiled Java
classes
- bin/nameapp.ap_ holds your application’s resources, packaged as a ZIP file
June 21, 2017 84
Key-Concepts of Android
• BIN /:
- bin/namedebug.apk or bin/nameapp-unsigned.apk is the actual
Android application (where nameap is the name of your application)
- The .apk file is a ZIP archive containing the .dex file, the
compiled edition of your resources, any un-compiled resources (such as
what you put in and the AndroidManifest.xml file. )
SRC/:
-It contains all source code file (.java file) of android application.
E.g hello_world.java
June 21, 2017 85
Key-Concepts of Android
• RES /:
- Resources are to store all external contents that used in android
applications.
These are external elements that you want to include and reference within your
application, like images, audio, video, text strings, layouts, themes, etc.It contains all
resources that are used in android application
Root directory:
- res/drawable : its contain images ,pictures (png, jpeg etc) e.g. .icon.png
- res/layout : contains XML(User Interface) that UI layout used in Project
or view window of an application.(E.g. main.xml)
- res/Values : it declare Arrays, colors, dimensions, strings, and styles.(E.g.
strings.xml)
-res/raw : it contains non-complied file (e.g. Audio file .mp3, video file .mpg)
June 21, 2017 86
Key-Concepts of Android
• RES /:
-
Declares layouts & widgets for the activity
86Tree from: http://developer.android.com/guide/topics/ui/index.html
June 21, 2017 87
Key-Concepts of Android
• ASSETS:
- Assets it also store an external content refer in android
applications. Just like images, audio, video, text strings .It same as
resources but different in assets directory will maintain its raw file
format and, in order to read it, you must use the AssetManager to read
the file as a stream of bytes. So keeping files and data in resources
(res/) makes them easily accessible.
LIBS/:
- It’s holds any third-party Java JARs your application Requires
June 21, 2017 88
Key-Concepts of Android
• GEN:
- create an application that time auto generated R.java file in gen
directory. The R.java file is an index (id) into all the resources defined in
the file. This class files use in source code file or it gives for reference
or location user interface object that uses in sources code
June 21, 2017 89
Key-Concepts of Android
•
June 21, 2017 90
Key concepts of Android
•ACTIVITY
•It is an application component that provides a screen with which user can interact to do
something.
e.g:- view a map, send email and enter the form fields is an activities.
• The system sets permissions for all the files in an application so that only the user ID assigned
to that application can access them.
•Each process has its own virtual machine (VM), so an application's code runs in isolation from
other applications.
•Each Activity is given a window in which to draw its user interfaces.
•Presents a visual UI for a single endeavor
•Single app may be composed of several activities
Examples: list of photos, buttons to start/stop a song
June 21, 2017 91
Key concepts of Android
• Life Cycle of Activity
• It is a class in which derived as subclass of Activity class.
• it must implement callback methods in which activity transition
between various states its life cycle i.e. when
created/stopped/resume and destroyed.
June 21, 2017 92
Key concepts of Android
• Life Cycle of Activity
June 21, 2017 93
Key concepts of Android
• Life Cycle of Activity
June 21, 2017 94
Key concepts of Android
• Declaring Activity in Manifest
• You must declare your activity in the manifest file in order for it to be accessible to
the system. To declare your activity, open your manifest file and add an <activity>
element as a child of the <application> element.
For example: AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.compname.modulename.sample"
android:versionCode="1“ android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".SampleActivity“ android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
June 21, 2017 95
Key concepts of Android
• Using Intent Filter
An <activity> element can also specify various intent filters—using the
<intent-filter> element—in order to declare how other application
components may activate it.
When you create a new application using the Android SDK tools, the stub
activity that's created for you automatically includes an intent filter that
declares the activity responds to the "main" action and should be placed
in the "launcher" category. The intent filter looks like this:
<activity android:name=".ExampleActivity"
android:icon="@drawable/app_icon">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>
June 21, 2017 96
Key concepts of Android
• Service
-A service is a component that runs in the background to perform
long-running operations or to perform work for remote processes.
- A service does not provide a user interface.
- A service is implemented as a subclass of Service.
- examples
Network downloads,
Playing music,
TCP/UDP Servers
June 21, 2017 97
Key concepts of Android
•Service
- Service can be two forms
Started
A service is "started" when an application component (such as an activity) starts it by calling
startService().
Once started, a service can run in the background indefinitely, even if the component that started it
is destroyed.
Usually, a started service performs a single operation and does not return a result to the caller.
For example, it might download or upload a file over the network. When the operation is done,
the service should stop itself.
Bound
A service is "bound" when an application component binds to it by calling bindService().
A bound service offers a client-server interface that allows components to interact with the service,
send requests, get results, and even do so across processes with interprocess communication (IPC).
June 21, 2017 98
Key concepts of Android
• Service
A bound service runs only as long as another application component is
bound to it. Multiple components can bind to the service at once, but
when all of them unbind, the service is destroyed.
June 21, 2017 99
Key concepts of Android
•Content Provider
• A content provider manages a shared set of application data. Makes some of the
application data available to other application.
• You can store the data in the file system, an SQLite database, on the web, or any other
persistent storage location your application can access.
• A content provider is implemented as a subclass of ContentProvider and must implement a
standard set of APIs that enable other applications to perform transactions.
• it is the only way to transfer data between applications(no shared memory/pipes/shared
files so on).
June 21, 2017 100
Key concepts of Android
•Broadcast Receivers
• A broadcast receiver is a component that responds to system-wide broadcast
announcements.
• Many broadcasts originate from the system—
for example, a broadcast announcing that the screen has turned off, the battery is
low, or a picture was captured.
Applications can also initiate broadcasts—for example, to let other applications know that
some data has been downloaded to the device and is available for them to use. Although
broadcast receivers don't display a user interface, they may
create a status bar notification to alert the user when a broadcast event occurs.
A broadcast receiver is implemented as a subclass of BroadcastReceiver and each
broadcast is delivered as an Intent object.
June 21, 2017 101
Key concepts of Android
• Intents
• Three of the core components of an application — activities, services,
and broadcast receivers — are activated through messages, called
intents.
• Intent messaging is a facility for late run-time binding between
components in the same or different applications.
• The intent itself, an Intent object, is a passive data structure holding
an abstract description of an operation to be performed
June 21, 2017 102
Key concepts of Android
•Intents
• There are separate mechanisms for delivering intents to each type of component
• An Intent object is passed to Context.startActivity() or Activity.startActivityForResult() to
launch an activity or get an existing activity to do something new. (It can also be passed to
Activity.setResult() to return information to the activity that called
startActivityForResult().)
• An Intent object is passed to Context.startService() to initiate a service or deliver new
instructions to an ongoing service. Similarly, an intent can be passed to Context.bindService()
to establish a connection between the calling component and a target service. It can
optionally initiate the service if it's not already running.
• Intent objects passed to any of the broadcast methods (such as Context.sendBroadcast(),
Context.sendOrderedBroadcast(), or Context.sendStickyBroadcast()) are delivered to all
interested broadcast receivers. Many kinds of broadcasts originate in system code.
June 21, 2017 103
Application Development
June 21, 2017 104
Agenda
Sample Programming
- Hello world Example
- Activity
- 4 ways of Event Handling
- Intents
- Content Provider
- Services
June 21, 2017 105
Hello world Example
June 21, 2017 106
Activity Example
Java code – HelloWorldTest
June 21, 2017 107
main.xml
(Contd..)
June 21, 2017 108
resource bundle – strings.xml & manifestfile
(Contd..)
June 21, 2017 109
(Contd..)
June 21, 2017 110
Activity Life Cycle Example
Java code – LifeCycleActivity
June 21, 2017 111
(Contd..)
main.xml
June 21, 2017 112
(Contd..)
resource bundle – strings.xml & manifestfile
June 21, 2017 113
(Contd..)
June 21, 2017 114
(Contd..)
June 21, 2017 115
4 Ways of Event Handling
Java code – EventHandlingDemoActivity
June 21, 2017 116
(Contd..)
June 21, 2017 117
main.xml
(Contd..)
June 21, 2017 118
(Contd..)
June 21, 2017 119
resource bundle – strings.xml & manifestfile
(Contd..)
June 21, 2017 120
(Contd..)
June 21, 2017 121
Intents
Java code – Form Navigation Demo
June 21, 2017 122
(Contd..)
June 21, 2017 123
(Contd..)
resource bundle – strings.xml & manifestfile
June 21, 2017 124
(Contd..)
main.xml
June 21, 2017 125
(Contd..)
June 21, 2017 126
(Contd..)
result.xml
June 21, 2017 127
(Contd..)
June 21, 2017 128
Content Provider
Java code – Form Navigation SQLite Activity
June 21, 2017 129
(Contd..)
June 21, 2017 130
(Contd..)
June 21, 2017 131
(Contd..)
resource bundle – strings.xml & manifestfileresource bundle – strings.xml & manifestfile
June 21, 2017 132
(Contd..)
display.xml
June 21, 2017 133
(Contd..)
June 21, 2017 134
Services
Java code – Music Service
June 21, 2017 135
(Contd..)
Java code – Service Demo Activity
June 21, 2017 136
(Contd..)
resource bundle – strings.xml & manifestfile
June 21, 2017 137
(Contd..)
main.xml
June 21, 2017 138
(Contd..)
Click Start Service Button – Music Plays on
June 21, 2017 139

More Related Content

What's hot

Android Presentation
Android PresentationAndroid Presentation
Android Presentation
Bram Vandeputte
 
Android Overview
Android OverviewAndroid Overview
Android Overview
Raju Kadam
 
Android understanding
Android understandingAndroid understanding
Android understanding
Ramesh Rao
 
Android
AndroidAndroid
Android
Lina Shamiah
 
Android Training - Part 2
Android Training - Part 2Android Training - Part 2
Android Training - Part 2
Tbldevelopment
 
Android development tutorial
Android development tutorialAndroid development tutorial
Android development tutorial
Vibrant Technologies & Computers
 
Android development classes in chandigarh : Big Boxx Academy
Android development classes in chandigarh : Big Boxx AcademyAndroid development classes in chandigarh : Big Boxx Academy
Android development classes in chandigarh : Big Boxx Academy
Big Boxx Animation Academy
 
Android architecture
Android architectureAndroid architecture
Android architecture
poojapainter
 
Android Operating System Architecture
Android Operating System ArchitectureAndroid Operating System Architecture
Android Operating System Architecture
DINESH KUMAR ARIVARASAN
 
Introduction to Android, Architecture & Components
Introduction to  Android, Architecture & ComponentsIntroduction to  Android, Architecture & Components
Introduction to Android, Architecture & Components
Vijay Rastogi
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
krishnastudent88
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
srinivasansoundar
 
Android Training
Android TrainingAndroid Training
Android Training
Tbldevelopment
 
android
androidandroid
android
indhuchezhian
 
Arduino - Android Workshop Presentation
Arduino - Android Workshop PresentationArduino - Android Workshop Presentation
Arduino - Android Workshop Presentation
Hem Shrestha
 
Android development tutorial
Android development tutorialAndroid development tutorial
Android development tutorial
nazzf
 
Android architecture
Android architectureAndroid architecture
Android architecture
Hari Krishna
 
Android introduction
Android introductionAndroid introduction
Android introduction
Rahul Pola
 
Android Programming
Android ProgrammingAndroid Programming
Android Programming
Pasi Manninen
 
Android Programming Basic
Android Programming BasicAndroid Programming Basic
Android Programming Basic
Duy Do Phan
 

What's hot (20)

Android Presentation
Android PresentationAndroid Presentation
Android Presentation
 
Android Overview
Android OverviewAndroid Overview
Android Overview
 
Android understanding
Android understandingAndroid understanding
Android understanding
 
Android
AndroidAndroid
Android
 
Android Training - Part 2
Android Training - Part 2Android Training - Part 2
Android Training - Part 2
 
Android development tutorial
Android development tutorialAndroid development tutorial
Android development tutorial
 
Android development classes in chandigarh : Big Boxx Academy
Android development classes in chandigarh : Big Boxx AcademyAndroid development classes in chandigarh : Big Boxx Academy
Android development classes in chandigarh : Big Boxx Academy
 
Android architecture
Android architectureAndroid architecture
Android architecture
 
Android Operating System Architecture
Android Operating System ArchitectureAndroid Operating System Architecture
Android Operating System Architecture
 
Introduction to Android, Architecture & Components
Introduction to  Android, Architecture & ComponentsIntroduction to  Android, Architecture & Components
Introduction to Android, Architecture & Components
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Android Training
Android TrainingAndroid Training
Android Training
 
android
androidandroid
android
 
Arduino - Android Workshop Presentation
Arduino - Android Workshop PresentationArduino - Android Workshop Presentation
Arduino - Android Workshop Presentation
 
Android development tutorial
Android development tutorialAndroid development tutorial
Android development tutorial
 
Android architecture
Android architectureAndroid architecture
Android architecture
 
Android introduction
Android introductionAndroid introduction
Android introduction
 
Android Programming
Android ProgrammingAndroid Programming
Android Programming
 
Android Programming Basic
Android Programming BasicAndroid Programming Basic
Android Programming Basic
 

Similar to Android overview

Introduction to android
Introduction to androidIntroduction to android
Introduction to android
Aravindharamanan S
 
Android programming Assignment Help
Android programming Assignment HelpAndroid programming Assignment Help
Android programming Assignment Help
smithjonny9876
 
01 03 - introduction to android
01  03 - introduction to android01  03 - introduction to android
01 03 - introduction to android
Siva Kumar reddy Vasipally
 
Android operating system
Android operating systemAndroid operating system
Android operating system
Dev Savalia
 
Android presentation slide
Android presentation slideAndroid presentation slide
Android presentation slide
APSMIND TECHNOLOGY PVT LTD.
 
Getting started with android
Getting started with androidGetting started with android
Getting started with android
amitgb
 
Introduction to Android.ppt
Introduction to Android.pptIntroduction to Android.ppt
Introduction to Android.ppt
ahmadfaisal744721
 
Introduction to Android - Seminar
Introduction to Android - SeminarIntroduction to Android - Seminar
Introduction to Android - Seminar
Akshay Sharma
 
Introduction to Android - Seminar
Introduction to Android - SeminarIntroduction to Android - Seminar
Introduction to Android - Seminar
Akshay Sharma
 
Android
AndroidAndroid
Android quick talk
Android quick talkAndroid quick talk
Android quick talk
SenthilKumar Selvaraj
 
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_osEnhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
Arnav Gupta
 
Chapter 1 Introduction to android.ppt pl
Chapter 1 Introduction to android.ppt plChapter 1 Introduction to android.ppt pl
Chapter 1 Introduction to android.ppt pl
ENBAKOMZAWUGA
 
Android development
Android developmentAndroid development
Android development
Raynax668
 
Project
ProjectProject
Android : Deep dive into developing MobileApp using Android
Android : Deep dive into developing MobileApp using AndroidAndroid : Deep dive into developing MobileApp using Android
Android : Deep dive into developing MobileApp using Android
Emertxe Information Technologies Pvt Ltd
 
Android
AndroidAndroid
Android
jobyxg
 
01 02 - introduction - adroid stack
01  02 - introduction - adroid stack01  02 - introduction - adroid stack
01 02 - introduction - adroid stack
Siva Kumar reddy Vasipally
 
Mobile appliaction w android week 1 by osama
Mobile appliaction w android week 1 by osamaMobile appliaction w android week 1 by osama
Mobile appliaction w android week 1 by osama
Osama Ghandour Geris
 
Android
AndroidAndroid
Android
vaisakhtg
 

Similar to Android overview (20)

Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Android programming Assignment Help
Android programming Assignment HelpAndroid programming Assignment Help
Android programming Assignment Help
 
01 03 - introduction to android
01  03 - introduction to android01  03 - introduction to android
01 03 - introduction to android
 
Android operating system
Android operating systemAndroid operating system
Android operating system
 
Android presentation slide
Android presentation slideAndroid presentation slide
Android presentation slide
 
Getting started with android
Getting started with androidGetting started with android
Getting started with android
 
Introduction to Android.ppt
Introduction to Android.pptIntroduction to Android.ppt
Introduction to Android.ppt
 
Introduction to Android - Seminar
Introduction to Android - SeminarIntroduction to Android - Seminar
Introduction to Android - Seminar
 
Introduction to Android - Seminar
Introduction to Android - SeminarIntroduction to Android - Seminar
Introduction to Android - Seminar
 
Android
AndroidAndroid
Android
 
Android quick talk
Android quick talkAndroid quick talk
Android quick talk
 
Enhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_osEnhancing and modifying_the_core_android_os
Enhancing and modifying_the_core_android_os
 
Chapter 1 Introduction to android.ppt pl
Chapter 1 Introduction to android.ppt plChapter 1 Introduction to android.ppt pl
Chapter 1 Introduction to android.ppt pl
 
Android development
Android developmentAndroid development
Android development
 
Project
ProjectProject
Project
 
Android : Deep dive into developing MobileApp using Android
Android : Deep dive into developing MobileApp using AndroidAndroid : Deep dive into developing MobileApp using Android
Android : Deep dive into developing MobileApp using Android
 
Android
AndroidAndroid
Android
 
01 02 - introduction - adroid stack
01  02 - introduction - adroid stack01  02 - introduction - adroid stack
01 02 - introduction - adroid stack
 
Mobile appliaction w android week 1 by osama
Mobile appliaction w android week 1 by osamaMobile appliaction w android week 1 by osama
Mobile appliaction w android week 1 by osama
 
Android
AndroidAndroid
Android
 

More from Mallikarjuna G D

Reactjs
ReactjsReactjs
Bootstrap 5 ppt
Bootstrap 5 pptBootstrap 5 ppt
Bootstrap 5 ppt
Mallikarjuna G D
 
CSS
CSSCSS
Angular 2.0
Angular  2.0Angular  2.0
Angular 2.0
Mallikarjuna G D
 
Spring andspringboot training
Spring andspringboot trainingSpring andspringboot training
Spring andspringboot training
Mallikarjuna G D
 
Hibernate
HibernateHibernate
Hibernate
Mallikarjuna G D
 
Jspprogramming
JspprogrammingJspprogramming
Jspprogramming
Mallikarjuna G D
 
Servlet programming
Servlet programmingServlet programming
Servlet programming
Mallikarjuna G D
 
Servlet programming
Servlet programmingServlet programming
Servlet programming
Mallikarjuna G D
 
Mmg logistics edu-final
Mmg  logistics edu-finalMmg  logistics edu-final
Mmg logistics edu-final
Mallikarjuna G D
 
Interview preparation net_asp_csharp
Interview preparation net_asp_csharpInterview preparation net_asp_csharp
Interview preparation net_asp_csharp
Mallikarjuna G D
 
Interview preparation devops
Interview preparation devopsInterview preparation devops
Interview preparation devops
Mallikarjuna G D
 
Interview preparation testing
Interview preparation testingInterview preparation testing
Interview preparation testing
Mallikarjuna G D
 
Interview preparation data_science
Interview preparation data_scienceInterview preparation data_science
Interview preparation data_science
Mallikarjuna G D
 
Interview preparation full_stack_java
Interview preparation full_stack_javaInterview preparation full_stack_java
Interview preparation full_stack_java
Mallikarjuna G D
 
Enterprunership
EnterprunershipEnterprunership
Enterprunership
Mallikarjuna G D
 
Core java
Core javaCore java
Core java
Mallikarjuna G D
 
Type script
Type scriptType script
Type script
Mallikarjuna G D
 
Angularj2.0
Angularj2.0Angularj2.0
Angularj2.0
Mallikarjuna G D
 
Git Overview
Git OverviewGit Overview
Git Overview
Mallikarjuna G D
 

More from Mallikarjuna G D (20)

Reactjs
ReactjsReactjs
Reactjs
 
Bootstrap 5 ppt
Bootstrap 5 pptBootstrap 5 ppt
Bootstrap 5 ppt
 
CSS
CSSCSS
CSS
 
Angular 2.0
Angular  2.0Angular  2.0
Angular 2.0
 
Spring andspringboot training
Spring andspringboot trainingSpring andspringboot training
Spring andspringboot training
 
Hibernate
HibernateHibernate
Hibernate
 
Jspprogramming
JspprogrammingJspprogramming
Jspprogramming
 
Servlet programming
Servlet programmingServlet programming
Servlet programming
 
Servlet programming
Servlet programmingServlet programming
Servlet programming
 
Mmg logistics edu-final
Mmg  logistics edu-finalMmg  logistics edu-final
Mmg logistics edu-final
 
Interview preparation net_asp_csharp
Interview preparation net_asp_csharpInterview preparation net_asp_csharp
Interview preparation net_asp_csharp
 
Interview preparation devops
Interview preparation devopsInterview preparation devops
Interview preparation devops
 
Interview preparation testing
Interview preparation testingInterview preparation testing
Interview preparation testing
 
Interview preparation data_science
Interview preparation data_scienceInterview preparation data_science
Interview preparation data_science
 
Interview preparation full_stack_java
Interview preparation full_stack_javaInterview preparation full_stack_java
Interview preparation full_stack_java
 
Enterprunership
EnterprunershipEnterprunership
Enterprunership
 
Core java
Core javaCore java
Core java
 
Type script
Type scriptType script
Type script
 
Angularj2.0
Angularj2.0Angularj2.0
Angularj2.0
 
Git Overview
Git OverviewGit Overview
Git Overview
 

Recently uploaded

Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
EduSkills OECD
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
haiqairshad
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
Wahiba Chair Training & Consulting
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
Jyoti Chand
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
TechSoup
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
HajraNaeem15
 

Recently uploaded (20)

Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
 

Android overview

  • 1. June 21, 2017 www.snipe.co.in 1
  • 2. June 21, 2017 2 Android Overview
  • 3. June 21, 2017 3 Agenda •Android Overview - what is android - Features of Android - Why Android? - Android History • Platform - Hardware -operating system -network connectivity -security -performance • Development environment - java - android sdk - eclipse - IDE & Tools -software -Emulators
  • 4. June 21, 2017 4 Android Overview • What is Android ? •Android is software stack for mobile devices that includes an operating system, middleware and key applications. • Built on Linux kernel • Developed by Google and later the Open Handset Alliance(OHA) • Allows writing managed code in Java Language
  • 5. June 21, 2017 5 Android Overview • 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)
  • 6. June 21, 2017 6 Android Overview • Features of Android ? •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 WiFi (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 plugin for the Eclipse IDE
  • 7. June 21, 2017 7 Android Overview • Why Android ? •The OHA is committed to make their vision a reality: to deploy the Android platform for every mobile operator, handset manufacturers and developers to build innovative devices • Google Android Sales to Overtake iPhone in 2012 • Engineering expertise to help run Android on embedded hardware, which aside from cellphones, mobile internet devices, and portable media players, could include GPS devices, thin-client computers and set-top boxes. • The ability for anyone to customize the Google Android platform
  • 8. June 21, 2017 8 Android Overview • Android History? • 2005 Google acquires startup Android Inc. to start Android platform Work on Dalvik VM begins • 2007 Open Handset Alliance announced Early look at SDK • 2008 Google sponsors 1st  Android Developer Challenge T-Mobile G1 announced SDK 1.0 released Android released open source (Apache License) Android Dev Phone 1 released
  • 9. June 21, 2017 9 Android Overview • History .. •2009 •SDK 1.5 (Cupcake) •New soft keyboard with “autocomplete” feature •SDK 1.6 (Donut) •Support Wide VGA •SDK 2.0/2.0.1/2.1 (Eclair) •Revamped UI, browser •2010 •Nexus One released to the public •SDK 2.2 (Froyo) •Flash support, tethering •SDK 2.3 (Gingerbread) •UI update, system-wide copy-paste
  • 10. June 21, 2017 10 Android Overview • Android History .. •2011 •SDK 3.0 (Honeycomb) for tablets only •New UI for tablets, support multi-core processors •SDK 3.1 and 3.2 •Hardware support and UI improvements •SDK 4.0 (Ice Cream Sandwich) •For Q4, combination of Gingerbread and Honeycomb
  • 11. June 21, 2017 11 Android Overview •
  • 12. June 21, 2017 12 Android Platform • 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
  • 13. June 21, 2017 13 Android Platform • Operating System ? • 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.
  • 14. June 21, 2017 14 Android Platform • Network Connectivity It supports wireless communications using:  GSM mobile-phone technology  3G  Edge  802.11 Wi-Fi networks
  • 15. June 21, 2017 15 Android Platform • 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. • Additional finer-grained security features are provided through a "permission" mechanism that enforces restrictions on the specific operations that a particular process can perform, and per-URI permissions for granting ad-hoc access to specific pieces of data.
  • 16. June 21, 2017 16 Android Platform • Performance
  • 17. June 21, 2017 17 Development Environment • Development Requirements • Java. • Android SDK. • Eclipse IDE (optional) • Emulators
  • 18. June 21, 2017 18 Development Environment • IDE & Tools • Android SDK. • Class Library • Developer Tools  dx – Dalvik Cross-Assembler  aapt – Android Asset Packaging Tool  adb – Android Debug Bridge  ddms – Dalvik Debug Monitor Service • Emulator and System Images • Documentation and Sample Code • Eclipse IDE + ADT (Android Development Tools) • Reduces Development and Testing Time • Makes User Interface-Creation easier • Makes Application Description Easier
  • 19. June 21, 2017 19 Development Environment • Emulators or AVD •Emulator is essential to testing app but is not a substitute for a real device •Emulators are called Android Virtual Devices (AVDs) •Android SDK and AVD Manager allows you to create AVDs that target any Android API level •AVD have configurable resolutions, RAM, SD cards, skins, and other hardware
  • 20. June 21, 2017 20 Development Environment • Emulators or AVD :1.6 Device
  • 21. June 21, 2017 21 Development Environment • Emulators or AVD : 2.2 Device
  • 22. June 21, 2017 22 Development Environment • Emulators or AVD : 3.0 Device •
  • 23. June 21, 2017 23 Development Environment • Emulators Basics •Host computer’s keyboard works •Host’s mouse works like finger •Uses host’s Internet connection •Side buttons work: Home, Menu, Back, Search, volume up and down, etc. • •Ctrl-F11 toggle landscape  portrait •Alt-Enter toggle full-screen mode •More info at http://developer.android.com/guide/developing/devices/emulator.html
  • 24. June 21, 2017 24 Development Environment • Emulators Limitations: •No support for placing or receiving actual phone calls •Simulate phone calls (placed and received) through the emulator console •No support for USB connections •No support for camera/video capture (input) •No support for device-attached headphones •No support for determining connected state •No support for determining battery charge level and AC charging state •No support for determining SD card insert/eject •No support for Bluetooth •
  • 25. June 21, 2017 25 Development Environment • Programming Languages • Java Officially Supported • C/C++ also possible but not Supported
  • 26. June 21, 2017 26 Android Architecture
  • 27. June 21, 2017 27 Agenda •Architecture - Applications - Application Frameworks - Libraries & Android Runtime - Linux Kernel
  • 28. June 21, 2017 28 Android Architecture • Major Components
  • 29. June 21, 2017 29 Android Architecture • Applications • Android will ship with a 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.
  • 30. June 21, 2017 30 Android Architecture • Application Frameworks • By providing an open development platform, Android offers developers the ability to build extremely rich and innovative applications. • Developers are free to take advantage of the device hardware, access location information, run background services, set alarms, add notifications to the status bar, and much, much more. • Developers have full access to the same framework APIs used by the core applications. • The application architecture is designed to simplify the reuse of components; any application can publish its capabilities and any other application may then make use of those capabilities (subject to security constraints enforced by the framework).
  • 31. June 21, 2017 31 Android Architecture • Application Frameworks • A rich and extensible set of Views that can be used to build an application, including lists, grids, text boxes, buttons, and even an embeddable web browser • Content Providers that enable applications to access data from other applications (such as Contacts), or to share their own data • A Resource Manager, providing access to non-code resources such as localized strings, graphics, and layout files • A Notification Manager that enables all applications to display custom alerts in the status bar • An Activity Manager that manages the lifecycle of applications and provides a common navigation backstack
  • 32. June 21, 2017 32 Android Architecture • Libraries • Android includes a set of C/C++ libraries used by various components of the Android system. These capabilities are exposed to developers through the Android application framework. Some of the core libraries are listed below: • System C library - a BSD-derived implementation of the standard C system library (libc), tuned for embedded Linux-based devices • Media Libraries - based on PacketVideo's OpenCORE; the libraries support playback and recording of many popular audio and video formats, as well as static image files, including MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG • Surface Manager - manages access to the display subsystem and seamlessly composites 2D and 3D graphic layers from multiple applications
  • 33. June 21, 2017 33 Android Architecture • Libraries • LibWebCore - a modern web browser engine which powers both the Android browser and an embeddable web view • SGL - the underlying 2D graphics engine • 3D libraries - an implementation based on OpenGL ES 1.0 APIs; the libraries use either hardware 3D acceleration (where available) or the included, highly optimized 3D software rasterizer • FreeType - bitmap and vector font rendering • SQLite - a powerful and lightweight relational database engine available to all applications
  • 34. June 21, 2017 34 Android Architecture • Android Runtime • Android includes a set of core libraries that provides most of the functionality available in the core libraries of the Java programming language. • Every Android application runs in its own process, with its own instance of the Dalvik virtual machine. • Dalvik has been written so that a device can run multiple VMs efficiently. The Dalvik VM executes files in the Dalvik Executable (.dex) format which is optimized for minimal memory footprint. • The VM is register-based, and runs classes compiled by a Java language compiler that have been transformed into the .dex format by the included "dx" tool. • The Dalvik VM relies on the Linux kernel for underlying functionality such as threading and low-level memory management
  • 35. June 21, 2017 35 Android Architecture • Linux Kernel • Android relies on Linux version 2.6 for core system services such as security, memory management, process management, network stack, and driver model. The kernel also acts as an abstraction layer. • performs security • Memory management • Process Management • Power management • Hardware drivers
  • 36. June 21, 2017 36 Installation & Configuration
  • 37. June 21, 2017 37 Agenda • Installation & Configuration - Setup Development Environment - Overview of Tools - Debugging - Simple Example to test
  • 38. June 21, 2017 38 Installation & Configuration • Setup Development tools • The best way to develop applications for Android is using the Eclipse IDE and the Android plug-in for Eclipse called Android Development Tools (ADT). The plug-in allows you to run your applications on an Android Virtual Device (AVD), aka Android emulator. http://www.slideshare.net/magicshui/android-installation-guide Kindly follow this url and prepare this installation guide as follows.
  • 39. June 21, 2017 39 Installation & Configuration • Installation Steps • Install & Configure Java • Download & Configure Eclipse • Install ADT Plugin for eclipse • How to develop simple project and Run the application • How to debug
  • 40. June 21, 2017 40 Install & Configure Java • Installing JDK on Windows • For the version of the JDK, download latest version from the URL http://www.oracle.com/technetwork/java/archive-139210.html • Select Download J2SE SDK. ( e.g. jdk is 6 update 1 ) • Select and download Windows Installation, Multi-language. • Save and install the .exe file. • If prompted, install the JDK to C Drive
  • 41. June 21, 2017 41 Install & Configure Java • Installing JDK on Windows • For the version of the JDK, download latest version from the URL http://www.oracle.com/technetwork/java/archive-139210.html • Select Download J2SE SDK. ( e.g. jdk is 6 update 1 ) • Select and download Windows Installation, Multi-language. • Save and install the .exe file. • If prompted, install the JDK to C Drive
  • 42. June 21, 2017 42 Install & Configure Java • Installing JDK on Windows • Now a "License Agreement" window opens. Just read the agreement and click "Accept" button to accept and go further.
  • 43. June 21, 2017 43 Install & Configure Java • Installing JDK on Windows • Now a "Custom Setup" window  opens.
  • 44. June 21, 2017 44 Install & Configure Java • Installing JDK on Windows • Click on "Change" button to choose the installation directory. Here it is "C:Program Files Javajdk1.6.0_01". Now click on "OK”
  • 45. June 21, 2017 45 Install & Configure Java • Installing JDK on Windows • Clicking the "OK" button starts the installation. It is shown in the following figure.
  • 46. June 21, 2017 46 Install & Configure Java • Installing JDK on Windows • Next window asks to install Runtime Environment. 
  • 47. June 21, 2017 47 Install & Configure Java • Installing JDK on Windows • Click the "Change" button to choose the installation directory of Runtime Environment. We prefer not to change it. So click "OK“  
  • 48. June 21, 2017 48 Install & Configure Java • Installing JDK on Windows • Click "OK"  button starts the installation. Click "Finish" after installation.
  • 49. June 21, 2017 49 Install & Configure Java • Installing JDK on Windows • The above installation will create two folders "jdk1.6.0_01" and "jre1.6.0_01" in "C: Program Files java" folder.
  • 50. June 21, 2017 50 Install & Configure Java • Installing JDK on Windows • To make available Java Compiler and Runtime Environment for compiling and running java programs, set the system environment variables. 
  • 51. June 21, 2017 51 Install & Configure Java • Installing JDK on Windows • Now set the JAVA_HOME variable and set its value to " C:Program FilesJavajdk1.6.0_01 ".
  • 52. June 21, 2017 52 Install & Configure Java • Installing JDK on Windows • Now this is the final step to check that you have installed jdk successfully and it is working fine. Just go to the command prompt and type javac and hit enter key you will get the help screen on command prompt.
  • 53. June 21, 2017 53 Download & Configure Eclipse • Setup Android SDK With Eclipse • Operating Systems support for Android SDK • Windows XP (32-bit), Vista (32- or 64-bit), or Windows 7 (32- or 64- bit) • Mac OS X 10.5.8 or later (x86 only) • Linux (tested on Ubuntu Linux, Lucid Lynx). GNU C Library (glibc) 2.7 or later is required. On Ubuntu Linux, version 8.04 or later is required. 64-bit distributions must be capable of running 32-bit applications. • Eclipse IDE support • Eclipse 3.4 (Ganymede) or greater. • Eclipse JDT plugin (included in most Eclipse IDE packages)
  • 54. June 21, 2017 54 Download & Configure Eclipse • Setup Android SDK With Eclipse • download Android SDK for your system from http://developer.android.com/sdk/index.html • Windows : installer_r16-windows.exe or android-sdk_r16-windows.zip. • Mac OS (intel) : android-sdk_r16-mac_x86.zip • Linux (i386) : android-sdk_r16-linux_x86.tgz • Need latest version of JDK to be able to use Android SDK with Eclipse. We already seen in previous slides.
  • 55. June 21, 2017 55 Download & Configure Eclipse • Installing Android SDK • Since we use Windows I present here how it works in Windows. but it should be almost similar in other Operating Systems. • The Android SDK we have just downloaded is not the complete software required to begin the development. It is just the core SDK tool which can be used to download the rest of the SDK components. • When you click the '.exe' installer windows will ask you if you want to save the file or cancel download as seen in the figure below. Select Save File and wait for the file to download.
  • 56. June 21, 2017 56 Download & Configure Eclipse • Installing Android SDK • After the file has downloaded run the setup file. You will be shown the welcome screen. Press Next on this screen.
  • 57. June 21, 2017 57 Download & Configure Eclipse • Installing Android SDK • If JDK is not found on your system you will be asked to download it from the Java website. Click on Visit java.oracle.com to install the JDK. Without the JDK you cannot continue with the installation. If you already have JDK installed you can proceed next Step.
  • 58. June 21, 2017 58 Download & Configure Eclipse • Installing Android SDK • After Installing the JDK you can press the Back button and then click Next button on the Android SDK installer. Now you will see that the previously disabled 'Next' button is enabled. Click the Next button to proceed forward. • We will now be asked to choose the directory where you want to install Android SDK tools. Remember the name and location of the SDK directory on your system as you will need to refer to the SDK directory later, when setting up the ADT plugin and when using the SDK tools from command line. In this article we use the default SDK location C:Program FilesAndroidandroid-sdk.
  • 59. June 21, 2017 59 Download & Configure Eclipse • Installing Android SDK After choosing the location where the SDK will be installed press Next.
  • 60. June 21, 2017 60 Download & Configure Eclipse • Installing Android SDK • Next you will be asked to Choose if you want to make a Start Menu Folder. If you do not want to make a Start Menu Folder select the box Do not create shortcuts. If you want to create Start Menu Folder than just click Install.
  • 61. June 21, 2017 61 Download & Configure Eclipse • Installing the ADT Plugin for Eclipse • As stated on the Android's Developer website "Android offers a custom plugin for the Eclipse IDE, called Android Development Tools (ADT), that is designed to give you a powerful, integrated environment in which to build Android applications. It extends the capabilites of Eclipse to let you quickly set up new Android projects, create an application UI, debug your applications using the Android SDK tools, and even export signed (or unsigned) APKs in order to distribute your application. In general, developing in Eclipse with ADT is a highly recommended approach and is the fastest way to get started with Android."
  • 62. June 21, 2017 62 Download & Configure Eclipse • Follow the steps below to install the ADT plugin in Eclipse: •  Eclipse must be installed on your system to proceed further from here. • Eclipse 3.6 (Helios). Start Eclipse and then select Help > Install New Software
  • 63. June 21, 2017 63 Download & Configure Eclipse • Steps below to install the ADT plugin in Eclipse: • Click Add, on the top right corner. A small Add Repository Dialog appears. In this Dialog enter "ADT Plugin" for the Name and the URL for the Location: https://dl-ssl.google.com/android/eclipse/
  • 64. June 21, 2017 64 Download & Configure Eclipse • Steps below to install the ADT plugin in Eclipse: • Next you will be back in the Available Software dialog. In this dialog select the checkbox next to Developer Tools and click Next.
  • 65. June 21, 2017 65 Download & Configure Eclipse • Steps below to install the ADT plugin in Eclipse: • Eclipse will look for dependencies and then show you the next window. Here you can see a list of the tools to be downloaded. Click Next.
  • 66. June 21, 2017 66 Download & Configure Eclipse • Steps below to install the ADT plugin in Eclipse: • Next you will be shown the license agreements. Read and accept the license agreements, then click Finish. • After the installation finishes, restart Eclipse.
  • 67. June 21, 2017 67 Download & Configure Eclipse • Configuring the ADT Plugin • Till now we have been able to Install Android SDK tools and ADT for Eclipse. The next step is to modify the ADT preferences in Eclipse to point to the Android SDK. We follow the following steps to do this task:
  • 68. June 21, 2017 68 Download & Configure Eclipse • Configuring the ADT Plugin • Start Eclipse. Select Window > Preferences... to open the Preferences panel.
  • 69. June 21, 2017 69 Download & Configure Eclipse • Configuring the ADT Plugin • In the left panel you can see Android. Select Android. You can now click Browse... to locate the folder where you have downloaded the Android SDK. Select the folder which contains the tools folder. • Now you are all done to move to the final step before you can start development for Android SDK. Click Apply, then OK.
  • 70. June 21, 2017 70 Download & Configure Eclipse • Adding Platforms and Other Components • This is the last step before you can start developing your apps for Android SDK. In this step we will see how to use Android SDK and AVD Manager to download the important SDK components for the development environment. The steps involved are, • Start Eclipse, select Window > Android SDK and AVD Manager or we can go to the root directory ('C:Program FilesAndroidandroid- sdk') where we have installed the Android SDK and double-click the 'SDK Manager.exe' file.
  • 71. June 21, 2017 71 Download & Configure Eclipse • Adding Platforms and Other Components
  • 72. June 21, 2017 72 Application Development
  • 73. June 21, 2017 73 Agenda • Application Fundamental • Key-concepts of Android - Android Project Structure - Activities - Services - Broadcast Receiver - Content Provider - Intents
  • 74. June 21, 2017 74 Android Fundamental • Android Fundamental • Android applications are composed of one or more application components (activities, services, content providers, and broadcast receivers) • Each component performs a different role in the overall application behavior, and each one can be activated individually (even by other applications) •The manifest file must declare all components in the application and should also declare all application requirements, such as the minimum version of Android required and any hardware configurations required •Non-code application resources (images, strings, layout files, etc.) should include alternatives for different device configurations (such as different strings for different languages and different layouts for different screen sizes)
  • 75. June 21, 2017 75 Android Fundamental • Android Fundamental • Android applications are written in the Java programming language. • The Android SDK tools compile the code—along with any data and resource files—into an Android package, an archive file with an .apk suffix. • All the code in a single .apk file is considered to be one application and is the file that Android-powered devices use to install the application • Once installed on a device, each Android application lives in its own security sandbox • The Android operating system is a multi-user Linux system in which each application is a different user.
  • 76. June 21, 2017 76 Android Fundamental • Android Fundamental • By default, the system assigns each application a unique Linux user ID (the ID is used only by the system and is unknown to the application). • The system sets permissions for all the files in an application so that only the user ID assigned to that application can access them. • Each process has its own virtual machine (VM), so an application's code runs in isolation from other applications.
  • 77. June 21, 2017 77 Android Fundamental • Android Fundamental Java code Byte code Dalvik exe Byte code <xml> <str > .java .class Other .class files javac dx classes.dex AndroidManifest.xml Resources .apk aapt
  • 78. June 21, 2017 78 Key-Concepts of Android • Project Structure : Step to create android project
  • 79. June 21, 2017 79 Key-Conceps of Android • Project Structure : Step to provide details
  • 80. June 21, 2017 80 Key-Conceps of Android • Project Structure : created project structure
  • 81. June 21, 2017 81 Key-Concepts of Android • Project Structure - When project is created, there are 8 key elements of project structure are created as follows. -AndroidManifest.xml - build.xml - bin/ - libs - src/ - res - assets - gen
  • 82. June 21, 2017 82 Key-Concepts of Android • AndroidManifest.xml - Declares all the app’s components - Names of app libraries needs to be linked - Identifies the permission of the app aspects to be granted
  • 83. June 21, 2017 83 Key-Concepts of Android •build.xml It is an ANT script for compiling the application and installing on the device. BIN /: -When you compile your project (via ant or the IDE), the results go into the bin/ directory under your project root. bin/classes/ holds the compiled Java classes - Bin/classes.dex holds the executable created from those compiled Java classes - bin/nameapp.ap_ holds your application’s resources, packaged as a ZIP file
  • 84. June 21, 2017 84 Key-Concepts of Android • BIN /: - bin/namedebug.apk or bin/nameapp-unsigned.apk is the actual Android application (where nameap is the name of your application) - The .apk file is a ZIP archive containing the .dex file, the compiled edition of your resources, any un-compiled resources (such as what you put in and the AndroidManifest.xml file. ) SRC/: -It contains all source code file (.java file) of android application. E.g hello_world.java
  • 85. June 21, 2017 85 Key-Concepts of Android • RES /: - Resources are to store all external contents that used in android applications. These are external elements that you want to include and reference within your application, like images, audio, video, text strings, layouts, themes, etc.It contains all resources that are used in android application Root directory: - res/drawable : its contain images ,pictures (png, jpeg etc) e.g. .icon.png - res/layout : contains XML(User Interface) that UI layout used in Project or view window of an application.(E.g. main.xml) - res/Values : it declare Arrays, colors, dimensions, strings, and styles.(E.g. strings.xml) -res/raw : it contains non-complied file (e.g. Audio file .mp3, video file .mpg)
  • 86. June 21, 2017 86 Key-Concepts of Android • RES /: - Declares layouts & widgets for the activity 86Tree from: http://developer.android.com/guide/topics/ui/index.html
  • 87. June 21, 2017 87 Key-Concepts of Android • ASSETS: - Assets it also store an external content refer in android applications. Just like images, audio, video, text strings .It same as resources but different in assets directory will maintain its raw file format and, in order to read it, you must use the AssetManager to read the file as a stream of bytes. So keeping files and data in resources (res/) makes them easily accessible. LIBS/: - It’s holds any third-party Java JARs your application Requires
  • 88. June 21, 2017 88 Key-Concepts of Android • GEN: - create an application that time auto generated R.java file in gen directory. The R.java file is an index (id) into all the resources defined in the file. This class files use in source code file or it gives for reference or location user interface object that uses in sources code
  • 89. June 21, 2017 89 Key-Concepts of Android •
  • 90. June 21, 2017 90 Key concepts of Android •ACTIVITY •It is an application component that provides a screen with which user can interact to do something. e.g:- view a map, send email and enter the form fields is an activities. • The system sets permissions for all the files in an application so that only the user ID assigned to that application can access them. •Each process has its own virtual machine (VM), so an application's code runs in isolation from other applications. •Each Activity is given a window in which to draw its user interfaces. •Presents a visual UI for a single endeavor •Single app may be composed of several activities Examples: list of photos, buttons to start/stop a song
  • 91. June 21, 2017 91 Key concepts of Android • Life Cycle of Activity • It is a class in which derived as subclass of Activity class. • it must implement callback methods in which activity transition between various states its life cycle i.e. when created/stopped/resume and destroyed.
  • 92. June 21, 2017 92 Key concepts of Android • Life Cycle of Activity
  • 93. June 21, 2017 93 Key concepts of Android • Life Cycle of Activity
  • 94. June 21, 2017 94 Key concepts of Android • Declaring Activity in Manifest • You must declare your activity in the manifest file in order for it to be accessible to the system. To declare your activity, open your manifest file and add an <activity> element as a child of the <application> element. For example: AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.compname.modulename.sample" android:versionCode="1“ android:versionName="1.0"> <uses-sdk android:minSdkVersion="8" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".SampleActivity“ android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>
  • 95. June 21, 2017 95 Key concepts of Android • Using Intent Filter An <activity> element can also specify various intent filters—using the <intent-filter> element—in order to declare how other application components may activate it. When you create a new application using the Android SDK tools, the stub activity that's created for you automatically includes an intent filter that declares the activity responds to the "main" action and should be placed in the "launcher" category. The intent filter looks like this: <activity android:name=".ExampleActivity" android:icon="@drawable/app_icon">     <intent-filter>         <action android:name="android.intent.action.MAIN" />         <category android:name="android.intent.category.LAUNCHER" />     </intent-filter> </activity>
  • 96. June 21, 2017 96 Key concepts of Android • Service -A service is a component that runs in the background to perform long-running operations or to perform work for remote processes. - A service does not provide a user interface. - A service is implemented as a subclass of Service. - examples Network downloads, Playing music, TCP/UDP Servers
  • 97. June 21, 2017 97 Key concepts of Android •Service - Service can be two forms Started A service is "started" when an application component (such as an activity) starts it by calling startService(). Once started, a service can run in the background indefinitely, even if the component that started it is destroyed. Usually, a started service performs a single operation and does not return a result to the caller. For example, it might download or upload a file over the network. When the operation is done, the service should stop itself. Bound A service is "bound" when an application component binds to it by calling bindService(). A bound service offers a client-server interface that allows components to interact with the service, send requests, get results, and even do so across processes with interprocess communication (IPC).
  • 98. June 21, 2017 98 Key concepts of Android • Service A bound service runs only as long as another application component is bound to it. Multiple components can bind to the service at once, but when all of them unbind, the service is destroyed.
  • 99. June 21, 2017 99 Key concepts of Android •Content Provider • A content provider manages a shared set of application data. Makes some of the application data available to other application. • You can store the data in the file system, an SQLite database, on the web, or any other persistent storage location your application can access. • A content provider is implemented as a subclass of ContentProvider and must implement a standard set of APIs that enable other applications to perform transactions. • it is the only way to transfer data between applications(no shared memory/pipes/shared files so on).
  • 100. June 21, 2017 100 Key concepts of Android •Broadcast Receivers • A broadcast receiver is a component that responds to system-wide broadcast announcements. • Many broadcasts originate from the system— for example, a broadcast announcing that the screen has turned off, the battery is low, or a picture was captured. Applications can also initiate broadcasts—for example, to let other applications know that some data has been downloaded to the device and is available for them to use. Although broadcast receivers don't display a user interface, they may create a status bar notification to alert the user when a broadcast event occurs. A broadcast receiver is implemented as a subclass of BroadcastReceiver and each broadcast is delivered as an Intent object.
  • 101. June 21, 2017 101 Key concepts of Android • Intents • Three of the core components of an application — activities, services, and broadcast receivers — are activated through messages, called intents. • Intent messaging is a facility for late run-time binding between components in the same or different applications. • The intent itself, an Intent object, is a passive data structure holding an abstract description of an operation to be performed
  • 102. June 21, 2017 102 Key concepts of Android •Intents • There are separate mechanisms for delivering intents to each type of component • An Intent object is passed to Context.startActivity() or Activity.startActivityForResult() to launch an activity or get an existing activity to do something new. (It can also be passed to Activity.setResult() to return information to the activity that called startActivityForResult().) • An Intent object is passed to Context.startService() to initiate a service or deliver new instructions to an ongoing service. Similarly, an intent can be passed to Context.bindService() to establish a connection between the calling component and a target service. It can optionally initiate the service if it's not already running. • Intent objects passed to any of the broadcast methods (such as Context.sendBroadcast(), Context.sendOrderedBroadcast(), or Context.sendStickyBroadcast()) are delivered to all interested broadcast receivers. Many kinds of broadcasts originate in system code.
  • 103. June 21, 2017 103 Application Development
  • 104. June 21, 2017 104 Agenda Sample Programming - Hello world Example - Activity - 4 ways of Event Handling - Intents - Content Provider - Services
  • 105. June 21, 2017 105 Hello world Example
  • 106. June 21, 2017 106 Activity Example Java code – HelloWorldTest
  • 107. June 21, 2017 107 main.xml (Contd..)
  • 108. June 21, 2017 108 resource bundle – strings.xml & manifestfile (Contd..)
  • 109. June 21, 2017 109 (Contd..)
  • 110. June 21, 2017 110 Activity Life Cycle Example Java code – LifeCycleActivity
  • 111. June 21, 2017 111 (Contd..) main.xml
  • 112. June 21, 2017 112 (Contd..) resource bundle – strings.xml & manifestfile
  • 113. June 21, 2017 113 (Contd..)
  • 114. June 21, 2017 114 (Contd..)
  • 115. June 21, 2017 115 4 Ways of Event Handling Java code – EventHandlingDemoActivity
  • 116. June 21, 2017 116 (Contd..)
  • 117. June 21, 2017 117 main.xml (Contd..)
  • 118. June 21, 2017 118 (Contd..)
  • 119. June 21, 2017 119 resource bundle – strings.xml & manifestfile (Contd..)
  • 120. June 21, 2017 120 (Contd..)
  • 121. June 21, 2017 121 Intents Java code – Form Navigation Demo
  • 122. June 21, 2017 122 (Contd..)
  • 123. June 21, 2017 123 (Contd..) resource bundle – strings.xml & manifestfile
  • 124. June 21, 2017 124 (Contd..) main.xml
  • 125. June 21, 2017 125 (Contd..)
  • 126. June 21, 2017 126 (Contd..) result.xml
  • 127. June 21, 2017 127 (Contd..)
  • 128. June 21, 2017 128 Content Provider Java code – Form Navigation SQLite Activity
  • 129. June 21, 2017 129 (Contd..)
  • 130. June 21, 2017 130 (Contd..)
  • 131. June 21, 2017 131 (Contd..) resource bundle – strings.xml & manifestfileresource bundle – strings.xml & manifestfile
  • 132. June 21, 2017 132 (Contd..) display.xml
  • 133. June 21, 2017 133 (Contd..)
  • 134. June 21, 2017 134 Services Java code – Music Service
  • 135. June 21, 2017 135 (Contd..) Java code – Service Demo Activity
  • 136. June 21, 2017 136 (Contd..) resource bundle – strings.xml & manifestfile
  • 137. June 21, 2017 137 (Contd..) main.xml
  • 138. June 21, 2017 138 (Contd..) Click Start Service Button – Music Plays on

Editor's Notes

  1. &amp;quot;My Computer&amp;quot; icon and right click the mouse button. Now click on &amp;quot;system Properties&amp;quot; option. It provides the &amp;quot;System Properties&amp;quot; window , click the &amp;apos;Advanced&amp;apos; tab. Then Click the &amp;quot;Environment Variables&amp;quot; button. It provides &amp;quot;Environment Variables&amp;quot; window. Now select the path in System variables and click &amp;apos;Edit&amp;apos; button. The &amp;quot;Edit System Variable&amp;quot; window will open. Add &amp;quot;c:\Program Files\Java\jdk1.6.0_01\bin&amp;quot; to &amp;apos;variable value&amp;apos; and click &amp;apos;Ok&amp;apos;, &amp;apos;Ok&amp;apos; and &amp;apos;Ok&amp;apos; buttons. 
  2. If this variable has not been declared earlier then create a new system variable by clicking on &amp;quot;New&amp;quot; button and give variable name as &amp;quot;JAVA_HOME&amp;quot; and variable value as &amp;quot; C:\Program Files\Java\jdk1.6.0_01 &amp;quot;. Now click &amp;quot;OK&amp;quot;. This variable is used by other applications to find  jdk  installation directory. For example, Tomcat server needs &amp;quot;JAVA_HOME&amp;quot; variable to find the installation directory of jdk.
  3. If you have trouble downloading the plugin, try using &amp;apos;http&amp;apos; in the Location URL, instead of &amp;apos;https&amp;apos;. Now Click OK.
  4. We can now use the graphical user interface to browse through the SDK repository and select new or updated components. The Android SDK and AVD manager then installs the selected components in your SDK environment. This can be seen as in the image below