SlideShare uma empresa Scribd logo
1 de 31
Android Training
Session - 1
Presented By: A.T.M. Hassan Uzzaman
Agendas
• Introduction to Android
• Application Structure
• Layouts & Drawable Resources
• Activities and Activity lifecycle
• First sample Application
• Launching emulator
Introduction
 A Linux based Operating System designed primarily for touch
screen mobile devices
 Initially developed by Android Inc
 and later purchased by Google in 2005
 The first Android powered device was sold in Oct 2008
 Android is Open Source and Google releases code under Apache2
license
 Google Play Store
Brief History – Android
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
 SDK 2.2 (Froyo)
 Flash support, tethering
 SDK 2.3 (Gingerbread)
 UI update, system-wide copy-paste
5
2011
– SDK 3.0/3.1/3.2 (Honeycomb) for tablets only
New UI for tablets, support multi-core processors
– SDK 4.0/4.0.1/4.0.2/4.0.3 (Ice Cream Sandwich)
Changes to the UI, Voice input, NFC
2012
 SDK 4.1/4.1.1/4.2(Jelly Bean)
 Performance optimization, refined UI
Honeycomb
Android 3.0-3.2
Ice cream
Sandwich
Android 4.0+
Jelly Bean 4.1+
6
API Level
Platform Version API Level Version Name
Android 4.2 17 Jelly bean
Android 4.1, 4.1.1 16 Jelly bean
Android 4.0.3, 4.0.4 15 Ice cream sandwich
Android 4.0, 4.0.1, 4.0.2 14 Ice cream sandwich
Android 3.2 13 Honey Comb
Android 3.1.x 12 Honey Comb
Android 3.0.x 11 Honey Comb
Android 2.3.4
Android 2.3.3
10 Gingerbread
7
API Level
Platform Version API Level Version Name
Android 2.3.2
Android 2.3.1
Android 2.3
9 Gingerbread
Android 2.2.x 8 Froyo
Android 2.1.x 7 Eclair
Android 2.0.1 6 Eclair
Android 2.0 5 Eclair
Android 1.6 4 Donut
Android 1.5 3 Cupcake
Levels
Activity BackStack
• Main activity calls activity2
Activity 2Push
Operation(
Last in)
Activity 2 is
visible on screen
Main activity
goes in
background
backstack
main
Activity BackStack
• From activity2, user presses back button
Activity 2
Main activity is
visible on screen
and activity 2 is
destroyed
backstack
main
Pop
operation
(First Out)
Java Source Code
Java Byte Code
JVM
Java Byte Code
Dalvik Byte Code
Java
Compiler
Dex
Compiler
Dalvik Executable
DVM
Differences between DVM and JVM
Machine
Property
DVM JVM
Architecture
base
Register Stack
No of
operations
fewer more
File format .dex .class
JVM - Stack Based
POP 20
POP 7
ADD 20, 7, result
PUSH result
DVM - Register Based
Add R3,R1,R2
15
Android Java Consists of
Android Java
=
Java SE - AWT/Swing
+
Android API
APK file format:
 Application package file
 Zip package format based on JAR file format
 Apk holds
 Code(.dex file)
 Resources
 Assets
 Certificates
 Manifest file
Once .apk is installed on a device:
 Own security sandbox
 A unique Linux UserID
 Own Virtual Machine
 Own Linux process
Application Fundamentals
Android Application Components
• Activities: An Activity is an application component that
provides a screen with which users can interact in order to do
something.
• Services: A Service is an application component that can
perform long-running operations in the background and does
not provide a user interface.
• Content Providers: A content provider manages a shared
set of application data.
• Broadcast Receivers: A broadcast receiver is a
component that responds to system-wide broadcast
announcements.
Activity Lifecycle
Configuring
Android Development
Environment
Requirements
JDK 6 (Java Development Kit ) and above
– (JRE alone is not sufficient)
– http://www.oracle.com/technetwork/java/javase/downloads/index.html
Eclipse IDE
– Eclipse + ADT plugin
– Android SDK Tools
– Android Platform-tools
– The latest Android platform
– The latest Android system image for the emulator
• http://developer.android.com/sdk/index.html
Other development environments
• Apache Ant 1.8 or later ( http://ant.apache.org/ )
• Not compatible with Gnu Compiler for Java (gcj)
Note: Some Linux distributions may
Include JDK 1.4 or Gnu Compiler for Java,
both of which are not supported
for Android development.
Adding
Platforms
and
Packages
Figure . The Android SDK Manager shows the
SDK packages that are available, already
installed, or for which an update is available.
Sample Application
Understanding Android Project Structure
• AndroidManifest.xml
– The manifest file describes the fundamental characteristics of the app and
defines each of its components.
• src/
– Directory for your app's main source files. By default, it includes an Activity
class that runs when your app is launched using the app icon.
• res/
– Contains several sub-directories for app resources. Here are just a few:
– drawable-hdpi/
• Directory for drawable objects (such as bitmaps) that are designed for high-
density (hdpi) screens. Other drawable directories contain assets designed for
other screen densities.
– layout/
• Directory for files that define your
app's user interface.
– values/
• Directory for other various XML files that
contain a collection of resources,
such as string and color definitions.
AndroidManifest.xml file
• Every application must have an AndroidManifest.xml file.
• The manifest presents essential information about the
application to the Android system.
• The manifest does the following
– It names the Java package for the application. The package name
serves as a unique identifier for the application.
– It describes the components of the application: The activities,
services, broadcast receivers, and content providers.
– It determines which processes will host application components.
– It also declares the permissions that others are required to have,
in order to interact with the components of the application
– It declares the minimum level of the Android API, that the
application requires.
 The file R.java is an auto-generated file, that is added to your
application, by the Android plug-in.
 This file contains pointers into the drawable, layout, and values
directories.
 You should never modify this file directly. You will be only
referencing R.java in most of your applications.
R.Java
package testPackage.HelloWorldText;
public final class R {
public static final class attr {}
public static final class drawable{
public static final int icon=0x7f020000;
}
public static final class layout {
public static final int main=0x7f030000;
}
public static final class string {
public static final int app_name=0x7f040000;
}
}
R.Java: Content
Resources
 Almost all Android applications will have some sort of
resources in them; at a minimum they often have the
user interface layouts in the form of XML files.
• Android offers one more directory
where you can keep files which also will
be included is package.
This directory called /assets.
•The difference between /res and
/assets is that, Android does not
generate IDs of assets content.
•You need to specify relative path and
name, for files inside /assets.
InputStream is = getAssets().open("text.txt");
Code to Access Assets :
References
www.developer.android.com
www.developer.android.com/sdk/index.html
Questions ?
Thank You.

Mais conteúdo relacionado

Mais procurados

What’s new in aNdroid [Google I/O Extended Bangkok 2016]
What’s new in aNdroid [Google I/O Extended Bangkok 2016]What’s new in aNdroid [Google I/O Extended Bangkok 2016]
What’s new in aNdroid [Google I/O Extended Bangkok 2016]Sittiphol Phanvilai
 
Android Development in a Nutshell
Android Development in a NutshellAndroid Development in a Nutshell
Android Development in a NutshellAleix Solé
 
Android basic principles
Android basic principlesAndroid basic principles
Android basic principlesHenk Laracker
 
Basic of Android App Development
Basic of Android App DevelopmentBasic of Android App Development
Basic of Android App DevelopmentAbhijeet Gupta
 
Android Overview
Android OverviewAndroid Overview
Android OverviewRaju Kadam
 
Getting started with android programming
Getting started with android programmingGetting started with android programming
Getting started with android programmingPERKYTORIALS
 
Android Programming Basics
Android Programming BasicsAndroid Programming Basics
Android Programming BasicsEueung Mulyana
 
Android application development for TresmaxAsia
Android application development for TresmaxAsiaAndroid application development for TresmaxAsia
Android application development for TresmaxAsiaMichael Angelo Rivera
 
Android - From Zero to Hero @ DEVit 2017
Android - From Zero to Hero @ DEVit 2017Android - From Zero to Hero @ DEVit 2017
Android - From Zero to Hero @ DEVit 2017Ivo Neskovic
 
Android terminologies
Android terminologiesAndroid terminologies
Android terminologiesjerry vasoya
 
Arduino - Android Workshop Presentation
Arduino - Android Workshop PresentationArduino - Android Workshop Presentation
Arduino - Android Workshop PresentationHem Shrestha
 
Intro To Android App Development
Intro To Android App DevelopmentIntro To Android App Development
Intro To Android App DevelopmentMike Kvintus
 
Android Programming Basic
Android Programming BasicAndroid Programming Basic
Android Programming BasicDuy Do Phan
 

Mais procurados (20)

Android Programming
Android ProgrammingAndroid Programming
Android Programming
 
What’s new in aNdroid [Google I/O Extended Bangkok 2016]
What’s new in aNdroid [Google I/O Extended Bangkok 2016]What’s new in aNdroid [Google I/O Extended Bangkok 2016]
What’s new in aNdroid [Google I/O Extended Bangkok 2016]
 
Android Development in a Nutshell
Android Development in a NutshellAndroid Development in a Nutshell
Android Development in a Nutshell
 
Android
AndroidAndroid
Android
 
Android basic principles
Android basic principlesAndroid basic principles
Android basic principles
 
Basic of Android App Development
Basic of Android App DevelopmentBasic of Android App Development
Basic of Android App Development
 
Android Overview
Android OverviewAndroid Overview
Android Overview
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Getting started with android programming
Getting started with android programmingGetting started with android programming
Getting started with android programming
 
Android Programming Basics
Android Programming BasicsAndroid Programming Basics
Android Programming Basics
 
Android
Android Android
Android
 
Android application development for TresmaxAsia
Android application development for TresmaxAsiaAndroid application development for TresmaxAsia
Android application development for TresmaxAsia
 
Android Presentation
Android PresentationAndroid Presentation
Android Presentation
 
Android - From Zero to Hero @ DEVit 2017
Android - From Zero to Hero @ DEVit 2017Android - From Zero to Hero @ DEVit 2017
Android - From Zero to Hero @ DEVit 2017
 
Android terminologies
Android terminologiesAndroid terminologies
Android terminologies
 
Arduino - Android Workshop Presentation
Arduino - Android Workshop PresentationArduino - Android Workshop Presentation
Arduino - Android Workshop Presentation
 
Ramakri
RamakriRamakri
Ramakri
 
Intro To Android App Development
Intro To Android App DevelopmentIntro To Android App Development
Intro To Android App Development
 
Android Programming Basic
Android Programming BasicAndroid Programming Basic
Android Programming Basic
 
Intro to Android Programming
Intro to Android ProgrammingIntro to Android Programming
Intro to Android Programming
 

Semelhante a Android session-1-sajib

Android development-tutorial
Android development-tutorialAndroid development-tutorial
Android development-tutorialilias ahmed
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to androidzeelpatel0504
 
Android For Java Developers
Android For Java DevelopersAndroid For Java Developers
Android For Java DevelopersMike Wolfson
 
Introduction to Android Development Part 1
Introduction to Android Development Part 1Introduction to Android Development Part 1
Introduction to Android Development Part 1Kainda Kiniel Daka
 
Android application development
Android application developmentAndroid application development
Android application developmentslidesuren
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions newJoe Jacob
 
Android development tutorial
Android development tutorialAndroid development tutorial
Android development tutorialnazzf
 
Android development tutorial
Android development tutorialAndroid development tutorial
Android development tutorialMohammad Taj
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_authlzongren
 
Android Application Development Using Java
Android Application Development Using JavaAndroid Application Development Using Java
Android Application Development Using Javaamaankhan
 
Android and its feature
Android and its featureAndroid and its feature
Android and its featureShubham Kumar
 

Semelhante a Android session-1-sajib (20)

Android development-tutorial
Android development-tutorialAndroid development-tutorial
Android development-tutorial
 
Android Anatomy
Android  AnatomyAndroid  Anatomy
Android Anatomy
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
PPT Companion to Android
PPT Companion to AndroidPPT Companion to Android
PPT Companion to Android
 
Andriod
Andriod Andriod
Andriod
 
Android For Java Developers
Android For Java DevelopersAndroid For Java Developers
Android For Java Developers
 
Android My Seminar
Android My SeminarAndroid My Seminar
Android My Seminar
 
IntroToAndroid
IntroToAndroidIntroToAndroid
IntroToAndroid
 
Introduction to Android Development Part 1
Introduction to Android Development Part 1Introduction to Android Development Part 1
Introduction to Android Development Part 1
 
Session 2 beccse
Session 2 beccseSession 2 beccse
Session 2 beccse
 
Notes Unit2.pptx
Notes Unit2.pptxNotes Unit2.pptx
Notes Unit2.pptx
 
Android application development
Android application developmentAndroid application development
Android application development
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
 
Android development tutorial
Android development tutorialAndroid development tutorial
Android development tutorial
 
Intro to android (gdays)
Intro to android (gdays)Intro to android (gdays)
Intro to android (gdays)
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_auth
 
Android development tutorial
Android development tutorialAndroid development tutorial
Android development tutorial
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_auth
 
Android Application Development Using Java
Android Application Development Using JavaAndroid Application Development Using Java
Android Application Development Using Java
 
Android and its feature
Android and its featureAndroid and its feature
Android and its feature
 

Mais de Hussain Behestee

Mais de Hussain Behestee (7)

Android session-5-sajib
Android session-5-sajibAndroid session-5-sajib
Android session-5-sajib
 
Android session 3-behestee
Android session 3-behesteeAndroid session 3-behestee
Android session 3-behestee
 
Android session 2-behestee
Android session 2-behesteeAndroid session 2-behestee
Android session 2-behestee
 
Android session 4-behestee
Android session 4-behesteeAndroid session 4-behestee
Android session 4-behestee
 
iOS Training Session-3
iOS Training Session-3iOS Training Session-3
iOS Training Session-3
 
iOS Session-2
iOS Session-2iOS Session-2
iOS Session-2
 
iOS app dev Training - Session1
iOS app dev Training - Session1iOS app dev Training - Session1
iOS app dev Training - Session1
 

Último

Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 

Último (20)

Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 

Android session-1-sajib

  • 1. Android Training Session - 1 Presented By: A.T.M. Hassan Uzzaman
  • 2. Agendas • Introduction to Android • Application Structure • Layouts & Drawable Resources • Activities and Activity lifecycle • First sample Application • Launching emulator
  • 3. Introduction  A Linux based Operating System designed primarily for touch screen mobile devices  Initially developed by Android Inc  and later purchased by Google in 2005  The first Android powered device was sold in Oct 2008  Android is Open Source and Google releases code under Apache2 license  Google Play Store
  • 4. Brief History – Android 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  SDK 2.2 (Froyo)  Flash support, tethering  SDK 2.3 (Gingerbread)  UI update, system-wide copy-paste
  • 5. 5 2011 – SDK 3.0/3.1/3.2 (Honeycomb) for tablets only New UI for tablets, support multi-core processors – SDK 4.0/4.0.1/4.0.2/4.0.3 (Ice Cream Sandwich) Changes to the UI, Voice input, NFC 2012  SDK 4.1/4.1.1/4.2(Jelly Bean)  Performance optimization, refined UI Honeycomb Android 3.0-3.2 Ice cream Sandwich Android 4.0+ Jelly Bean 4.1+
  • 6. 6 API Level Platform Version API Level Version Name Android 4.2 17 Jelly bean Android 4.1, 4.1.1 16 Jelly bean Android 4.0.3, 4.0.4 15 Ice cream sandwich Android 4.0, 4.0.1, 4.0.2 14 Ice cream sandwich Android 3.2 13 Honey Comb Android 3.1.x 12 Honey Comb Android 3.0.x 11 Honey Comb Android 2.3.4 Android 2.3.3 10 Gingerbread
  • 7. 7 API Level Platform Version API Level Version Name Android 2.3.2 Android 2.3.1 Android 2.3 9 Gingerbread Android 2.2.x 8 Froyo Android 2.1.x 7 Eclair Android 2.0.1 6 Eclair Android 2.0 5 Eclair Android 1.6 4 Donut Android 1.5 3 Cupcake
  • 9. Activity BackStack • Main activity calls activity2 Activity 2Push Operation( Last in) Activity 2 is visible on screen Main activity goes in background backstack main
  • 10. Activity BackStack • From activity2, user presses back button Activity 2 Main activity is visible on screen and activity 2 is destroyed backstack main Pop operation (First Out)
  • 11. Java Source Code Java Byte Code JVM Java Byte Code Dalvik Byte Code Java Compiler Dex Compiler Dalvik Executable DVM
  • 12. Differences between DVM and JVM Machine Property DVM JVM Architecture base Register Stack No of operations fewer more File format .dex .class
  • 13. JVM - Stack Based POP 20 POP 7 ADD 20, 7, result PUSH result
  • 14. DVM - Register Based Add R3,R1,R2
  • 15. 15 Android Java Consists of Android Java = Java SE - AWT/Swing + Android API
  • 16. APK file format:  Application package file  Zip package format based on JAR file format  Apk holds  Code(.dex file)  Resources  Assets  Certificates  Manifest file Once .apk is installed on a device:  Own security sandbox  A unique Linux UserID  Own Virtual Machine  Own Linux process Application Fundamentals
  • 17. Android Application Components • Activities: An Activity is an application component that provides a screen with which users can interact in order to do something. • Services: A Service is an application component that can perform long-running operations in the background and does not provide a user interface. • Content Providers: A content provider manages a shared set of application data. • Broadcast Receivers: A broadcast receiver is a component that responds to system-wide broadcast announcements.
  • 20. Requirements JDK 6 (Java Development Kit ) and above – (JRE alone is not sufficient) – http://www.oracle.com/technetwork/java/javase/downloads/index.html Eclipse IDE – Eclipse + ADT plugin – Android SDK Tools – Android Platform-tools – The latest Android platform – The latest Android system image for the emulator • http://developer.android.com/sdk/index.html Other development environments • Apache Ant 1.8 or later ( http://ant.apache.org/ ) • Not compatible with Gnu Compiler for Java (gcj) Note: Some Linux distributions may Include JDK 1.4 or Gnu Compiler for Java, both of which are not supported for Android development.
  • 21. Adding Platforms and Packages Figure . The Android SDK Manager shows the SDK packages that are available, already installed, or for which an update is available.
  • 23. Understanding Android Project Structure • AndroidManifest.xml – The manifest file describes the fundamental characteristics of the app and defines each of its components. • src/ – Directory for your app's main source files. By default, it includes an Activity class that runs when your app is launched using the app icon. • res/ – Contains several sub-directories for app resources. Here are just a few: – drawable-hdpi/ • Directory for drawable objects (such as bitmaps) that are designed for high- density (hdpi) screens. Other drawable directories contain assets designed for other screen densities. – layout/ • Directory for files that define your app's user interface. – values/ • Directory for other various XML files that contain a collection of resources, such as string and color definitions.
  • 24. AndroidManifest.xml file • Every application must have an AndroidManifest.xml file. • The manifest presents essential information about the application to the Android system. • The manifest does the following – It names the Java package for the application. The package name serves as a unique identifier for the application. – It describes the components of the application: The activities, services, broadcast receivers, and content providers. – It determines which processes will host application components. – It also declares the permissions that others are required to have, in order to interact with the components of the application – It declares the minimum level of the Android API, that the application requires.
  • 25.  The file R.java is an auto-generated file, that is added to your application, by the Android plug-in.  This file contains pointers into the drawable, layout, and values directories.  You should never modify this file directly. You will be only referencing R.java in most of your applications. R.Java
  • 26. package testPackage.HelloWorldText; public final class R { public static final class attr {} public static final class drawable{ public static final int icon=0x7f020000; } public static final class layout { public static final int main=0x7f030000; } public static final class string { public static final int app_name=0x7f040000; } } R.Java: Content
  • 27. Resources  Almost all Android applications will have some sort of resources in them; at a minimum they often have the user interface layouts in the form of XML files.
  • 28. • Android offers one more directory where you can keep files which also will be included is package. This directory called /assets. •The difference between /res and /assets is that, Android does not generate IDs of assets content. •You need to specify relative path and name, for files inside /assets. InputStream is = getAssets().open("text.txt"); Code to Access Assets :