SlideShare a Scribd company logo
ANDROIDBeginners Workshop
Nitin R Patel
Purvik N Rana
Outline
 Era of Mobile OS
 Android
• What it is..!
• Software stack
• Components
• App fundamentals
 Development Environments
• Tools/Setups
 Application Structure
 Layouts and View
 Activity
 Fragments
 Services
ERA OF MOBILE OS
 Symbian
• low-end phones
 Android
• Sep 20th, 2008 (Astro)
 Apple iOS
• June 29th, 2007
 BlackBerry
• property of Research in Motion (RIM) found in1999
 Windows
• Started by Nokia to take his reputation back to forth
 BADA
• owns by Samsung
ANDROID OS
What it is..!!
 Free – open source OS (platform for app creation)
 Linux kernel based OS
 Developed by Google and later the Open Handset Alliance (OHA)
 Allow to write/manage code in the Java
 Core and third party app are equal
 Easy and fast app development
 Era of Android starts since 5 November 2007
OHA
 Open Handset Alliance
 Group of technology and mobile companies
 First free provided mobile platform is – Android
 Providing richer experience (with open standards)  main Goal
 Handset manufactures are free to pay licencing fees to load
Android
Version History
Version Codename API Distribution
4.0.3 -
4.0.4
Ice Cream
Sandwich
15 3.7%
4.2.x
Jelly Bean
17 15.2%
4.3 18 4.5%
4.4 KitKat 19 39.2%
5.0
Lollipop
21 15.9%
5.1 22 5.1%
Native Android Applications
 Home Screen
 Music Player, Picture Gallery
 SMS, E-mail
 Camera Apps
 Full PIM (Calendar, Contacts)
 Web Browsers
 Play Store
 Sensors
 Google Maps
 Google Talk
 Google Mail Client
 YouTube
 Data Stores
 Much more . . .
Android Software Stack
• Contain all the Low level drivers for various hardware components of
Android
• Relaying on Linux Kernel for core system services like
• Memory and process management
• Network stack
• Driver model
• Security
• Provide Abstraction between hardware and rest of the software stack
Linux Kernel
• Set of Core libraries – enable developers to write Android Apps using
Java Programming
• DVM – Dalvik Virtual Machine
Android Runtime
Dalvik Virtual Machine
 Provides environment to let us execute Android application
 Each Android application runs in its own process
• Have it’s own instance of the Dalvik VM
 Dalvik has been written such that a device can run multiple VMs
efficiently.
 Register-based virtual machine
• Executing the Dalvik Executable (.dex) format
• .dex format is optimized for minimal memory footprint.
 Compilation
• Relying on the Linux Kernel for: Threading & other Low-level
memory management
 Exposed to developers through the Android application framework
 Including a set of C/C++ libraries used by components of the Android system
 Code for main features
• SQLite library- data storage
• WebKit library – functions for web browsing and much more..
Libraries
 Expose various capabilities of Android – developers use them in their
Apps
 Enabling and simplifying the reuse of components
• Developers have full access to the same framework APIs used by
the core applications
• Users are allowed to replace components
Application Framework
 Features
 Apps that download and install from Android Market
 Android provides a set of core applications:
• Email Client
• SMS Program
• Calendar
• Maps
• Browser
• Contacts etc…
Applications
Android Components
 Activities
• Single UI that handle the user interaction, app contains one or more activities
 Services
• handle background processing for applications, doesn‟t have UI
 Broadcast Receivers
• handle communication between Android OS and applications
 Content Providers
• handle data and database management issues
 Views
• UI elements like Buttons, Textviews and many more…
Android Application Fundamental
 Individual app lives in its own world
• Each application has its own process
• Identify with unique Linux user ID
• File alteration only permitted – ID and apps (through permission)
 Applications in between can – process elements of each other
DEVELOPMENT ENVIRONMENT
Eclipse – Android Studio
System requirements
 OS
• Xp (32) , Vista (32 - 64), 7 (32 - 64)
• Mac OS (10.5.8 or later)
• Linux
 Eclipse IDE (3.6.2 or later)
 Android SDK
 ADT Plug In
 JDK 6 (or later)
Continue . .
 Remember to get download of right version of java
 Unpack ZIP of SDK at appropriate location
 Install additional version of Android as well as other packages
 Configure Android Development Environment on Eclipse
• Add New Software to Eclipse
• ADT Plug In configuration
ADT integration in Eclipse
SDK Manager
Android Virtual Device
DDMS Perspective
Debug..
Android Studio
Studio interface
First Hello World Example (Demo)
ANDROID APPLICATION STRUCTURE
 Codes & Resources resides in Different Folders
 Can be added as needed
• src : all source codes
• gen : java files generated by ADT
• assets : store raw assests files
• bin : output directory
• res : resources of our application
• res/drawable : image/image-descriptor files
• res/layouts : layouts of application
• res/menus : application menus
• res/values : other resources of application like
• Strings, Styles, Colors and so on… (xml based)
Studio file structure
 Benefits
• Good to keep code away from all other things
• Easy to maintain – update – manage
• Support different devices and localization
• Resource selection dynamically at runtime
 System resources defined under System.R
Strings.xml
Colors.xml
 Efficient to group all colors in one separate file like strings the
same way…
Androidmenifest.xml
 Application descriptor file
 Properties like..
• Activities
• Content Providers
• Services
• Intent Receivers
• Permissions
• Version Number
• And much more . . .
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.svit.helloworld"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="19"
android:targetSdkVersion="21" />
<application android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity" 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>
Different language and hardware
 Dynamic resource collection mechanism
• Done with dynamic directory structure
• Specific language, location, hardware
• Alternatives described with – mark
 Like.
• res/layout/main.xml
• res/layout-land/main.xml
• res/values-fi/strings.xml
• res/values-en/strings/xml
Screen orientation support
 Portrait and Landscape mode can be done easily by resources
• Portrait – automatically
• Landscape – specified in layout-land
• Phone switches layout automatically by when orientation changes
BREAK
LAYOUTS AND VIEWS
 Android Application UI is built using Views and Viewgroups
 Different “Widgets” like Button, Textview, which are the UI
objects are the subclass of the class “View”
 “Layouts‟‟ are the subclass of Viewgroup
 Different types of Layouts are available in this class
 Various Layouts
• Arrange the views in Single Row or Single Column
Linear Layout
• Group views into rows and column
• <TableRow> - design a Row in the Table
Table Layout
• Enables you to set child position relative to each other
Relative Layout
• A blank space on the screen which can later be filled with a
single object
Frame Layout
Defining Layouts with xml
 Most common way is to use XML for declaring Layout
 Each element of XML is ether a View or a Viewgroup
 The Name of the XML element is like the java class that
represents like <TextView> element creates a Textview in the UI
 Android attach the view hierarchy tree to the screen
 Activity call the setContentView() method and pass the reference
to the root node object
 Then draw() method of the view is called to draw the widget on
screen
 Linear Layout Example
 Relative Layout Example
 Relative Layout Example
 Relative Layout Example
 Relative Layout Example
Common Input controls
 Input controls are the interactive components of
the application‟s User Interface
 Android provides wide variety of controls like
Buttons, Text fields, seekbars, checkboxes,
spinners, pickers and so on….
 Use drag and drop the controls from palette to
set controls to layout or edit in XML file
directory
Handling UI Events
 Many ways to intercept the events from a user‟s interaction
depends on the SDK version
 The approach is to capture the events from the specific view
object that the user interacts with
 Use different EventListeners with code or in XML
• onClick, onLongClick, onFocusChange, …….
Handling UI Events
ACTIVITY
basic
 App Component (UI) – user interact to do something
 One app – multiple activities
• Main activity – launch time presented activity
• Other – specified to particular tasks
 Each activity can start another activity
 Subclass of Activity class
 callBack methods – system calls different states of app activity
 Activities are set in the stacks – root activity (begin the Task of
Application)
 Three main states: running, paused, stopped
• Pasued/stoppped : system can drop it from
memory
• UI, data sources and EventHandlers are
bind in onCreate()
• After onResume() : activity visible to user
• onPause() : save critical data at app data
store
 android:name - specify class name of the Activity
 Other attributes – specify additional information (label, icon,
theme..)
 Intent filter – make your activity available to system or other
applications
INTENTS
basics
 Most important and unique concepts
 Like „message‟to someone
 Can be used to
• Broadcast/Transfer data between application and app components
• Start Activities and Services
• Broadcast that event/action has occurred
 Intent Object  like bundle of information
 Contains
• Component : explicit name of component class to use for intent
• Action : action to be perform
• Data : URI of data to be acted on
• Category : string that indicate kind of a component that should handle
the intent
• Type : indicate Type of intent data
• Extras : key-value pairs of information
• Flags : instruct how to launch activity and how to treat it
Intent object actions
Intent object data
 ACTION_VIEW content://contacts/people/1
 ACTOIN_DIAL content://contacts/people/1
 ACTION_VIEW tel:123
 ACTION_DIAL tel:123
 ACTION_EDIT content://contacts/people/1
Intent object category
 Any no of category can be included for intent to categorized
Intent object extras
 Bundle of additional information
 Provide extended information to the component
Intent resolution
 Two groups
• Explicit : used for application-internal messages(b/w activities)
• Delivered to an instance of designated target class
• startActivity(intent)
• Starts new Activity (Data can be passed with intent)
• Parent does not notify when child activity completes
• startActivityForResult(intent, REQUEST_CODE)
• same but parent get notify when child activity completes by OnActivityCompletes()
• Implicit : used to activate components in other applications
• Resolved by intent filters by object‟s (Action – Data - Category)
• System must find best component to handle intent
Intent filter
 Explicit – always deliver to target class
 Activities, Services and Broadcast receivers can have one or more
intent filters
 Filter describes the capability of a component
 Defined in the manifest file
Passing data between activities
 Intent can have addtional data  extras
 Key/value pair
 Send data:
• intent.putExtra(“info”,value);
 Get data:
• Bundle extra = getIntent().getExtras();
• int var = extra.getInt(“info”);
Receiving result from an activity
 Custom Intents
• Customize name in the manifest to receive intent
 Broadcast Intents
• No activity needed
• Listen broadcast intents
• Register in manifest file as Receiver
• Intent-filter used to match with listened intent actions
Custom intent
Broadcast intents
FRAGMENTS
Fragment Basics
 Fragment represents a behaviour or a portion of user interface in
an Activity
 To build a multi-Pane UI, multiple fragments are combined in a
single activity
 Fragment must be embedded in an activity
 Fragment has its own lifecycle
 It supports more dynamic and flexible UI designs on large screens
 Example of Typical fragment:
• For Tablet: - list in left & content on right
• For Handset: - List & content on different Activity
SERVICES
basic
 Components runs in background (without UI)
 not a separate process or thread
 Can be stand alone process or part of an application
 Started, stopped, controlled by other application cpmponents
 Started services have higher priority than inactive or invisible activities
 Supports
• local services (not accessible outside of application)
• remote services (accessible outside of application)
Service creation
 Create class that extends Service class
 Override needed methods
• onCreate() : Launched on main application thread
• onStartCommand(Intent, int, int) : Create and run new thread
• onBind() : bind Activities to Service
• onDestroy() : do all clean up (stop threads,..)
Service lifcycle
 Context.startService()
• onCreate() : create a Service
• onStart() : start it
• onStartCommand()
• Context.stopService()/stopSelf() : Stops it
 Client.bindService()
• Create if it is not already running
• Doesn‟t call onStartCommand()
• onBind() : client will receive Ibinder object from
Service itself
• Remain running as long as connection is established
• Allows client to call back to Service
Day 1 ends here

More Related Content

What's hot

Android workshop
Android workshopAndroid workshop
Android workshop
SubashiniRathinavel
 
Android architecture
Android architectureAndroid architecture
Android architecture
poojapainter
 
Android- Introduction for Beginners
Android- Introduction for BeginnersAndroid- Introduction for Beginners
Android- Introduction for Beginners
Tripti Tiwari
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
srinivasansoundar
 
Android Presentation
Android PresentationAndroid Presentation
Android Presentation
Bram Vandeputte
 
Android primer
Android primerAndroid primer
Android primer
intellisenseit
 
Android architecture
Android architectureAndroid architecture
Android architecture
Saurabh Kukreja
 
Android software stack
Android software stackAndroid software stack
Android software stack
Soba Arjun
 
Anatomy of android aplication
Anatomy of android aplicationAnatomy of android aplication
Anatomy of android aplication
poojapainter
 
Android the new Mobile Technoogy
Android the new Mobile TechnoogyAndroid the new Mobile Technoogy
Android the new Mobile Technoogy
poojapainter
 
Android Architecture
Android ArchitectureAndroid Architecture
Android Architecture
Pietro Alberto Rossi
 
Android Seminar
Android SeminarAndroid Seminar
Android Seminar
Ganesh Waghmare
 
Android Anatomy
Android  AnatomyAndroid  Anatomy
Android Anatomy
Bhavya Siddappa
 
Android 1-intro n architecture
Android 1-intro n architectureAndroid 1-intro n architecture
Android 1-intro n architecture
Dilip Singh
 
Android Operating System Architecture
Android Operating System ArchitectureAndroid Operating System Architecture
Android Operating System Architecture
DINESH KUMAR ARIVARASAN
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
krishnastudent88
 
Android For Java Developers
Android For Java DevelopersAndroid For Java Developers
Android For Java Developers
Mike Wolfson
 
android
androidandroid
android
Akhil Kumar
 
Andriod
Andriod Andriod
Andriod
Chayan Upadhyay
 
Session 2 beccse
Session 2 beccseSession 2 beccse
Session 2 beccse
vin123456gangal
 

What's hot (20)

Android workshop
Android workshopAndroid workshop
Android workshop
 
Android architecture
Android architectureAndroid architecture
Android architecture
 
Android- Introduction for Beginners
Android- Introduction for BeginnersAndroid- Introduction for Beginners
Android- Introduction for Beginners
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Android Presentation
Android PresentationAndroid Presentation
Android Presentation
 
Android primer
Android primerAndroid primer
Android primer
 
Android architecture
Android architectureAndroid architecture
Android architecture
 
Android software stack
Android software stackAndroid software stack
Android software stack
 
Anatomy of android aplication
Anatomy of android aplicationAnatomy of android aplication
Anatomy of android aplication
 
Android the new Mobile Technoogy
Android the new Mobile TechnoogyAndroid the new Mobile Technoogy
Android the new Mobile Technoogy
 
Android Architecture
Android ArchitectureAndroid Architecture
Android Architecture
 
Android Seminar
Android SeminarAndroid Seminar
Android Seminar
 
Android Anatomy
Android  AnatomyAndroid  Anatomy
Android Anatomy
 
Android 1-intro n architecture
Android 1-intro n architectureAndroid 1-intro n architecture
Android 1-intro n architecture
 
Android Operating System Architecture
Android Operating System ArchitectureAndroid Operating System Architecture
Android Operating System Architecture
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Android For Java Developers
Android For Java DevelopersAndroid For Java Developers
Android For Java Developers
 
android
androidandroid
android
 
Andriod
Andriod Andriod
Andriod
 
Session 2 beccse
Session 2 beccseSession 2 beccse
Session 2 beccse
 

Similar to Android Workshop_1

Introduction to Android (before 2015)
Introduction to Android (before 2015)Introduction to Android (before 2015)
Introduction to Android (before 2015)
Chien-Ming Chou
 
Android Development
Android DevelopmentAndroid Development
Android Development
mclougm4
 
Introduction to Android and Android Studio
Introduction to Android and Android StudioIntroduction to Android and Android Studio
Introduction to Android and Android Studio
Suyash Srijan
 
Android architecture
Android architectureAndroid architecture
Android architecture
Deepa Rahul
 
Unit I- ANDROID OVERVIEW.ppt
Unit I- ANDROID OVERVIEW.pptUnit I- ANDROID OVERVIEW.ppt
Unit I- ANDROID OVERVIEW.ppt
dineshkumar periyasamy
 
Android fundamentals and tutorial for beginners
Android fundamentals and tutorial for beginnersAndroid fundamentals and tutorial for beginners
Android fundamentals and tutorial for beginners
Boom Shukla
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
Can Elmas
 
Android Penetration Testing - Day 1
Android Penetration Testing - Day 1Android Penetration Testing - Day 1
Android Penetration Testing - Day 1
Mohammed Adam
 
Introduction to Android Development.pptx
Introduction to Android Development.pptxIntroduction to Android Development.pptx
Introduction to Android Development.pptx
asmeerana605
 
Android OS and its Features
Android OS and its FeaturesAndroid OS and its Features
Android OS and its Features
Harshad Lokhande
 
Android Technology
Android TechnologyAndroid Technology
Android Technology
Anshul Sharma
 
Intro to android (gdays)
Intro to android (gdays)Intro to android (gdays)
Intro to android (gdays)
Omolara Adejuwon
 
Overview of Adroid Architecture.pptx
Overview of Adroid Architecture.pptxOverview of Adroid Architecture.pptx
Overview of Adroid Architecture.pptx
debasish duarah
 
Learn Android at edureka!
Learn Android at edureka! Learn Android at edureka!
Learn Android at edureka!
Edureka!
 
Android Deep Dive
Android Deep DiveAndroid Deep Dive
Android Deep Dive
Marko Gargenta
 
Intro To Android App Development
Intro To Android App DevelopmentIntro To Android App Development
Intro To Android App Development
Mike Kvintus
 
Android
Android Android
Android
Edureka!
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
Joe Jacob
 
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break editionMatteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
DuckMa
 
Android quick talk
Android quick talkAndroid quick talk
Android quick talk
SenthilKumar Selvaraj
 

Similar to Android Workshop_1 (20)

Introduction to Android (before 2015)
Introduction to Android (before 2015)Introduction to Android (before 2015)
Introduction to Android (before 2015)
 
Android Development
Android DevelopmentAndroid Development
Android Development
 
Introduction to Android and Android Studio
Introduction to Android and Android StudioIntroduction to Android and Android Studio
Introduction to Android and Android Studio
 
Android architecture
Android architectureAndroid architecture
Android architecture
 
Unit I- ANDROID OVERVIEW.ppt
Unit I- ANDROID OVERVIEW.pptUnit I- ANDROID OVERVIEW.ppt
Unit I- ANDROID OVERVIEW.ppt
 
Android fundamentals and tutorial for beginners
Android fundamentals and tutorial for beginnersAndroid fundamentals and tutorial for beginners
Android fundamentals and tutorial for beginners
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 
Android Penetration Testing - Day 1
Android Penetration Testing - Day 1Android Penetration Testing - Day 1
Android Penetration Testing - Day 1
 
Introduction to Android Development.pptx
Introduction to Android Development.pptxIntroduction to Android Development.pptx
Introduction to Android Development.pptx
 
Android OS and its Features
Android OS and its FeaturesAndroid OS and its Features
Android OS and its Features
 
Android Technology
Android TechnologyAndroid Technology
Android Technology
 
Intro to android (gdays)
Intro to android (gdays)Intro to android (gdays)
Intro to android (gdays)
 
Overview of Adroid Architecture.pptx
Overview of Adroid Architecture.pptxOverview of Adroid Architecture.pptx
Overview of Adroid Architecture.pptx
 
Learn Android at edureka!
Learn Android at edureka! Learn Android at edureka!
Learn Android at edureka!
 
Android Deep Dive
Android Deep DiveAndroid Deep Dive
Android Deep Dive
 
Intro To Android App Development
Intro To Android App DevelopmentIntro To Android App Development
Intro To Android App Development
 
Android
Android Android
Android
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
 
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break editionMatteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
 
Android quick talk
Android quick talkAndroid quick talk
Android quick talk
 

More from Purvik Rana

Software Quality Assurance - Software Engineering
Software Quality Assurance - Software EngineeringSoftware Quality Assurance - Software Engineering
Software Quality Assurance - Software Engineering
Purvik Rana
 
Software Designing - Software Engineering
Software Designing - Software EngineeringSoftware Designing - Software Engineering
Software Designing - Software Engineering
Purvik Rana
 
Agile Methodology - Software Engineering
Agile Methodology - Software EngineeringAgile Methodology - Software Engineering
Agile Methodology - Software Engineering
Purvik Rana
 
Software Engineering - Basics
Software Engineering - BasicsSoftware Engineering - Basics
Software Engineering - Basics
Purvik Rana
 
OOPs Concepts - Android Programming
OOPs Concepts - Android ProgrammingOOPs Concepts - Android Programming
OOPs Concepts - Android Programming
Purvik Rana
 
Sql queries - Basics
Sql queries - BasicsSql queries - Basics
Sql queries - Basics
Purvik Rana
 
Apple bonjour
Apple bonjourApple bonjour
Apple bonjour
Purvik Rana
 
File system in iOS
File system in iOSFile system in iOS
File system in iOS
Purvik Rana
 

More from Purvik Rana (8)

Software Quality Assurance - Software Engineering
Software Quality Assurance - Software EngineeringSoftware Quality Assurance - Software Engineering
Software Quality Assurance - Software Engineering
 
Software Designing - Software Engineering
Software Designing - Software EngineeringSoftware Designing - Software Engineering
Software Designing - Software Engineering
 
Agile Methodology - Software Engineering
Agile Methodology - Software EngineeringAgile Methodology - Software Engineering
Agile Methodology - Software Engineering
 
Software Engineering - Basics
Software Engineering - BasicsSoftware Engineering - Basics
Software Engineering - Basics
 
OOPs Concepts - Android Programming
OOPs Concepts - Android ProgrammingOOPs Concepts - Android Programming
OOPs Concepts - Android Programming
 
Sql queries - Basics
Sql queries - BasicsSql queries - Basics
Sql queries - Basics
 
Apple bonjour
Apple bonjourApple bonjour
Apple bonjour
 
File system in iOS
File system in iOSFile system in iOS
File system in iOS
 

Recently uploaded

Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
IGCSE Biology Chapter 14- Reproduction in Plants.pdf
IGCSE Biology Chapter 14- Reproduction in Plants.pdfIGCSE Biology Chapter 14- Reproduction in Plants.pdf
IGCSE Biology Chapter 14- Reproduction in Plants.pdf
Amin Marwan
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
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
 
ZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptxZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptx
dot55audits
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
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
 
B. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdfB. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdf
BoudhayanBhattachari
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
Nguyen Thanh Tu Collection
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
MysoreMuleSoftMeetup
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
สมใจ จันสุกสี
 
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
 
Constructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective CommunicationConstructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective Communication
Chevonnese Chevers Whyte, MBA, B.Sc.
 
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
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
MJDuyan
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 

Recently uploaded (20)

Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
IGCSE Biology Chapter 14- Reproduction in Plants.pdf
IGCSE Biology Chapter 14- Reproduction in Plants.pdfIGCSE Biology Chapter 14- Reproduction in Plants.pdf
IGCSE Biology Chapter 14- Reproduction in Plants.pdf
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
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
 
ZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptxZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptx
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
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
 
B. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdfB. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
 
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
 
Constructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective CommunicationConstructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective Communication
 
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
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 

Android Workshop_1

  • 1. ANDROIDBeginners Workshop Nitin R Patel Purvik N Rana
  • 2. Outline  Era of Mobile OS  Android • What it is..! • Software stack • Components • App fundamentals  Development Environments • Tools/Setups  Application Structure  Layouts and View  Activity  Fragments  Services
  • 4.  Symbian • low-end phones  Android • Sep 20th, 2008 (Astro)  Apple iOS • June 29th, 2007  BlackBerry • property of Research in Motion (RIM) found in1999  Windows • Started by Nokia to take his reputation back to forth  BADA • owns by Samsung
  • 6. What it is..!!  Free – open source OS (platform for app creation)  Linux kernel based OS  Developed by Google and later the Open Handset Alliance (OHA)  Allow to write/manage code in the Java  Core and third party app are equal  Easy and fast app development  Era of Android starts since 5 November 2007
  • 7. OHA  Open Handset Alliance  Group of technology and mobile companies  First free provided mobile platform is – Android  Providing richer experience (with open standards)  main Goal  Handset manufactures are free to pay licencing fees to load Android
  • 9. Version Codename API Distribution 4.0.3 - 4.0.4 Ice Cream Sandwich 15 3.7% 4.2.x Jelly Bean 17 15.2% 4.3 18 4.5% 4.4 KitKat 19 39.2% 5.0 Lollipop 21 15.9% 5.1 22 5.1%
  • 10. Native Android Applications  Home Screen  Music Player, Picture Gallery  SMS, E-mail  Camera Apps  Full PIM (Calendar, Contacts)  Web Browsers  Play Store  Sensors  Google Maps  Google Talk  Google Mail Client  YouTube  Data Stores  Much more . . .
  • 12. • Contain all the Low level drivers for various hardware components of Android • Relaying on Linux Kernel for core system services like • Memory and process management • Network stack • Driver model • Security • Provide Abstraction between hardware and rest of the software stack Linux Kernel
  • 13. • Set of Core libraries – enable developers to write Android Apps using Java Programming • DVM – Dalvik Virtual Machine Android Runtime
  • 14. Dalvik Virtual Machine  Provides environment to let us execute Android application  Each Android application runs in its own process • Have it’s own instance of the Dalvik VM  Dalvik has been written such that a device can run multiple VMs efficiently.  Register-based virtual machine • Executing the Dalvik Executable (.dex) format • .dex format is optimized for minimal memory footprint.  Compilation • Relying on the Linux Kernel for: Threading & other Low-level memory management
  • 15.  Exposed to developers through the Android application framework  Including a set of C/C++ libraries used by components of the Android system  Code for main features • SQLite library- data storage • WebKit library – functions for web browsing and much more.. Libraries
  • 16.  Expose various capabilities of Android – developers use them in their Apps  Enabling and simplifying the reuse of components • Developers have full access to the same framework APIs used by the core applications • Users are allowed to replace components Application Framework
  • 18.  Apps that download and install from Android Market  Android provides a set of core applications: • Email Client • SMS Program • Calendar • Maps • Browser • Contacts etc… Applications
  • 19. Android Components  Activities • Single UI that handle the user interaction, app contains one or more activities  Services • handle background processing for applications, doesn‟t have UI  Broadcast Receivers • handle communication between Android OS and applications  Content Providers • handle data and database management issues  Views • UI elements like Buttons, Textviews and many more…
  • 20. Android Application Fundamental  Individual app lives in its own world • Each application has its own process • Identify with unique Linux user ID • File alteration only permitted – ID and apps (through permission)  Applications in between can – process elements of each other
  • 22. System requirements  OS • Xp (32) , Vista (32 - 64), 7 (32 - 64) • Mac OS (10.5.8 or later) • Linux  Eclipse IDE (3.6.2 or later)  Android SDK  ADT Plug In  JDK 6 (or later)
  • 23. Continue . .  Remember to get download of right version of java  Unpack ZIP of SDK at appropriate location  Install additional version of Android as well as other packages  Configure Android Development Environment on Eclipse • Add New Software to Eclipse • ADT Plug In configuration
  • 25.
  • 32. First Hello World Example (Demo)
  • 34.  Codes & Resources resides in Different Folders  Can be added as needed • src : all source codes • gen : java files generated by ADT • assets : store raw assests files • bin : output directory • res : resources of our application • res/drawable : image/image-descriptor files • res/layouts : layouts of application • res/menus : application menus • res/values : other resources of application like • Strings, Styles, Colors and so on… (xml based)
  • 36.  Benefits • Good to keep code away from all other things • Easy to maintain – update – manage • Support different devices and localization • Resource selection dynamically at runtime  System resources defined under System.R
  • 38. Colors.xml  Efficient to group all colors in one separate file like strings the same way…
  • 39. Androidmenifest.xml  Application descriptor file  Properties like.. • Activities • Content Providers • Services • Intent Receivers • Permissions • Version Number • And much more . . . <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.svit.helloworld" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="21" /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".MainActivity" 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>
  • 40. Different language and hardware  Dynamic resource collection mechanism • Done with dynamic directory structure • Specific language, location, hardware • Alternatives described with – mark  Like. • res/layout/main.xml • res/layout-land/main.xml • res/values-fi/strings.xml • res/values-en/strings/xml
  • 41. Screen orientation support  Portrait and Landscape mode can be done easily by resources • Portrait – automatically • Landscape – specified in layout-land • Phone switches layout automatically by when orientation changes
  • 42. BREAK
  • 44.  Android Application UI is built using Views and Viewgroups  Different “Widgets” like Button, Textview, which are the UI objects are the subclass of the class “View”  “Layouts‟‟ are the subclass of Viewgroup  Different types of Layouts are available in this class
  • 45.  Various Layouts • Arrange the views in Single Row or Single Column Linear Layout • Group views into rows and column • <TableRow> - design a Row in the Table Table Layout • Enables you to set child position relative to each other Relative Layout • A blank space on the screen which can later be filled with a single object Frame Layout
  • 46. Defining Layouts with xml  Most common way is to use XML for declaring Layout  Each element of XML is ether a View or a Viewgroup  The Name of the XML element is like the java class that represents like <TextView> element creates a Textview in the UI  Android attach the view hierarchy tree to the screen  Activity call the setContentView() method and pass the reference to the root node object  Then draw() method of the view is called to draw the widget on screen
  • 47.  Linear Layout Example
  • 52. Common Input controls  Input controls are the interactive components of the application‟s User Interface  Android provides wide variety of controls like Buttons, Text fields, seekbars, checkboxes, spinners, pickers and so on….  Use drag and drop the controls from palette to set controls to layout or edit in XML file directory
  • 53. Handling UI Events  Many ways to intercept the events from a user‟s interaction depends on the SDK version  The approach is to capture the events from the specific view object that the user interacts with  Use different EventListeners with code or in XML • onClick, onLongClick, onFocusChange, …….
  • 56. basic  App Component (UI) – user interact to do something  One app – multiple activities • Main activity – launch time presented activity • Other – specified to particular tasks  Each activity can start another activity  Subclass of Activity class  callBack methods – system calls different states of app activity  Activities are set in the stacks – root activity (begin the Task of Application)
  • 57.  Three main states: running, paused, stopped • Pasued/stoppped : system can drop it from memory • UI, data sources and EventHandlers are bind in onCreate() • After onResume() : activity visible to user • onPause() : save critical data at app data store
  • 58.  android:name - specify class name of the Activity  Other attributes – specify additional information (label, icon, theme..)  Intent filter – make your activity available to system or other applications
  • 60. basics  Most important and unique concepts  Like „message‟to someone  Can be used to • Broadcast/Transfer data between application and app components • Start Activities and Services • Broadcast that event/action has occurred
  • 61.  Intent Object  like bundle of information  Contains • Component : explicit name of component class to use for intent • Action : action to be perform • Data : URI of data to be acted on • Category : string that indicate kind of a component that should handle the intent • Type : indicate Type of intent data • Extras : key-value pairs of information • Flags : instruct how to launch activity and how to treat it
  • 63. Intent object data  ACTION_VIEW content://contacts/people/1  ACTOIN_DIAL content://contacts/people/1  ACTION_VIEW tel:123  ACTION_DIAL tel:123  ACTION_EDIT content://contacts/people/1
  • 64. Intent object category  Any no of category can be included for intent to categorized
  • 65. Intent object extras  Bundle of additional information  Provide extended information to the component
  • 66. Intent resolution  Two groups • Explicit : used for application-internal messages(b/w activities) • Delivered to an instance of designated target class • startActivity(intent) • Starts new Activity (Data can be passed with intent) • Parent does not notify when child activity completes • startActivityForResult(intent, REQUEST_CODE) • same but parent get notify when child activity completes by OnActivityCompletes() • Implicit : used to activate components in other applications • Resolved by intent filters by object‟s (Action – Data - Category) • System must find best component to handle intent
  • 67. Intent filter  Explicit – always deliver to target class  Activities, Services and Broadcast receivers can have one or more intent filters  Filter describes the capability of a component  Defined in the manifest file
  • 68. Passing data between activities  Intent can have addtional data  extras  Key/value pair  Send data: • intent.putExtra(“info”,value);  Get data: • Bundle extra = getIntent().getExtras(); • int var = extra.getInt(“info”);
  • 69. Receiving result from an activity
  • 70.  Custom Intents • Customize name in the manifest to receive intent  Broadcast Intents • No activity needed • Listen broadcast intents • Register in manifest file as Receiver • Intent-filter used to match with listened intent actions
  • 74. Fragment Basics  Fragment represents a behaviour or a portion of user interface in an Activity  To build a multi-Pane UI, multiple fragments are combined in a single activity  Fragment must be embedded in an activity  Fragment has its own lifecycle  It supports more dynamic and flexible UI designs on large screens
  • 75.  Example of Typical fragment: • For Tablet: - list in left & content on right • For Handset: - List & content on different Activity
  • 77. basic  Components runs in background (without UI)  not a separate process or thread  Can be stand alone process or part of an application  Started, stopped, controlled by other application cpmponents  Started services have higher priority than inactive or invisible activities  Supports • local services (not accessible outside of application) • remote services (accessible outside of application)
  • 78. Service creation  Create class that extends Service class  Override needed methods • onCreate() : Launched on main application thread • onStartCommand(Intent, int, int) : Create and run new thread • onBind() : bind Activities to Service • onDestroy() : do all clean up (stop threads,..)
  • 79. Service lifcycle  Context.startService() • onCreate() : create a Service • onStart() : start it • onStartCommand() • Context.stopService()/stopSelf() : Stops it  Client.bindService() • Create if it is not already running • Doesn‟t call onStartCommand() • onBind() : client will receive Ibinder object from Service itself • Remain running as long as connection is established • Allows client to call back to Service
  • 80.
  • 81.
  • 82.
  • 83. Day 1 ends here