SlideShare a Scribd company logo
1 of 46
Welcome !
Android Motivation
Senthil ACS
senthil.acs@gmail.com
Why Motivation?
Motivation drives your growth
Specifically “Self Motivation”
Beneficiaries – You and your organization
Today’s Motivation – Android
What is Android?
It is not an Operating System….
An open source software stack build on top of Linux
Language – Java
Provides an infrastructure for advanced applications.
Helps developers use that infrastructure for apps
Android Development
Third party app development
Our agenda
Ability to monetize apps
http://developer.android.com
Native Platform development
Mobile Phone makers (HTC, Samsung, Motorola)
Genuine geeks
Cannot monetize
http://source.android.com
Android SDK
Started – Cupcake (1.5)
Current – Jelly Bean(4.1)
Your requirements
Windows/Linux/Mac
Eclipse Helios onwards (http://www.eclipse.org)
Eclipse Android Development Plugin (ADT)
Android SDK (Android JARS + Emulators)
Question – Difference between Simulator and
Emulator???
Simulator and Emulator
Simulator
A system designed only to test your software
Flight Simulator
Space Simulator
Obviously you cannot fly 
Emulator
Test your target architecture on another computer
Copy the real hardware and software into another
computer
Android Emulator
What will you learn today?
SDK Setup
Hello World Application
Adding more concepts to the application
Practical correlation of Android concepts
Writing a Location based application
Device Management
Agenda
Hello World Application
Application Components
Concepts
 Activity
 Service
 App Storage
 Broadcast Receivers
 Android Permissions
 Location and Maps
 Debugging
Device Management
Hello World App
Create a new project in Eclipse using Android SDK
You are done !!!
Lets try!!!
App Components
Source
Resources
Drawables (various screen sizes)
Layout (various screen sizes)
Strings (various languages)
Manifest
Contains all activities, services, providers, receivers,
permissions required by the application
Application Needs
UI (Activity)
Background Worker (Service)
App Storage (Shared Prefs, Internal/External Storage,
Content Providers)
Change receivers (Broadcast Receiver)
Android Activity
Anything that the application does
A UI window containing various
views (Button, TextView, Label etc) –
Similar to Java Swings
View elements may listen for user
actions
An application can have various
activities
One can start another (Opening one
window from another window) –
Using startActivity(intent)
Launcher Activity
The activity that shows up when the app is launched
Manifest changes
<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>
Activity Lifecycle
Activity Lifecycle
Lets try it out!!!
Create an app
Check the Manifest for Launcher Activity
Create a Sub Activity and launch it from the main activity
Return the sub activity result to the main activity
Add some UI elements
Activity Lifecycle example – Google provided
Services
To run in background & no UI
Types - Started Services, Bound Services
Started Services
Owned by the application
Typically started by an activity
Bound Services
Owned by the application
Shared by others – Binder
Invoking a Service
startService()
Code to start a service
Intent intent = new Intent(this, HelloService.class);
startService(intent);
onStartCommand()
bindService()
onBind()
Requires an Intent action/Service class name
Started Service
Intent Service
Offloads to a Worker Thread
Provides a Work Queue
Stops the service once work is done
Less code
Normal Service
Manually create background thread
Multi threaded work
More code
Service Lifecycle
Lets try it out!!!
Create three Services
Intent Service – One at a time
Normal Service – One at a time
Normal Service – Multi Request
Bound Service (If time permits)
Use an Activity to launch the service
Update Manifest with the service declarations
Application Storage
Shared Preferences
User’s settings
Key-Value Pairs
Internal Storage
App’s private data
Cannot be accessed by other apps
External Storage
Public data
Typically sdcard
Content Providers
Content Providers
Identified using a URI
SQLite databases
Efficient data access
Can be accessed by other apps
Example: Read Contacts
Content Providers
CRUD
Create
Read
Update
Delete
API: SQLiteOpenHelper
Read and Write database
Contains CRUD methods
Lets try it out !!!
Create a content provider step by step
SQLiteOpenHelper instance
SQLiteDatabase instance
Implement CRUD methods
Store student name and percentage
Show the saved data
Listeners & Broadcast Receivers
Hey Friend! Inform us when the results are out!!
Above statement – Registration
You – Listener
Your Friend – Broadcaster
“When the results are out” – Intent
Listeners & Broadcast Receivers
Register for event notifications
Signal Change Notification
On boot complete Notification
Battery Notification
Location Change Notification
Etc…
Communicate results from one app to other/others
Listeners & Broadcast Receivers
Registration
Permanent
Register in Manifest
Example: onBootComplete
On/Off
Register/Unregister when required
Example: Location Change Notification
Lets try it out !!!
Create an application that will show Signal changes
Let the application be launched on Boot
Register/UnRegister signal changes
Intent & Intent Filter
Intent – The intention behind doing something
Used in Services example to pass data.
Intent Filter – What are my intentions?
Used in Broadcast receivers to specify what to listen to.
Android Permissions
Declared in Manifest
Required if your app uses Android sensitive infrastructure
Read/Write contacts
Read Network State
Read/Write External Storage (App Storage)
OnBootComplete
Etc…
More Concepts
More UI Concepts
 Alert Dialogs
 Date, Time dialogs
 ANR
 Pick Contacts
 Notification/Toasts
Location, Maps Activity
 Usage of Broadcast Receivers
 Use Google APIs in Android
Device Management
 Need for Securing Mobile Devices
UI Concepts
Dialogs
Alerts the user for info or some input
ANR – Application Not Responding
Drives the developer crazy
Never run long running tasks in UI Thread
Remember – LoaderCallbacks<CursorLoader>?
Lets try out a sample showing all the above PLUS
How to launch Contacts app
Location and Maps
Google APIs (MapActivity)
Obtain Maps API Key
Require Internet Permission
Maps add Overlay Items
Location Information – GPS/Network
Lets try it out!!!
Write a MapActivity
Register for Location from GPS/Network
Place that location onto the Map as a OverlayItem
Point using a Marker – A Pin
Permission Requirements for the App
Device Management
Set Password Policy
Encrypt storage
Remote Lock/Wipe
Control Camera
What is the need?
Lost your device?
Remotely Lock your device
Install Apps such as Lookout
Try to get the location after losing
Configure alternate numbers in Lookout
Get SMS when the SIM card is changed
More chances of getting the device back
We are done!!!
Benefits of learning Android
Massive market share (50 to 60%) of global smartphone
share.
Samsung, Motorola, Sony, LG, HTC are major players
Play Store – 500000+ apps
Get a fundoo job
Monetize your application
JOB !!!
Show your marks and answer simple Questions
Learn Android + One app in PlayStore
Data Structures + Algorithms + 1 Mobile Platform
JOB !!!
Show your marks and answer simple Questions – Service
Companies - Infosys, Wipro, HCL, CTS, TCS etc…
Android – Good Product Companies – Zomato, Zynga,
SAP, Ericsson
Data Structures + Algorithms + 1 Mobile Platform –
Premium Product Companies
Google, Yahoo, Microsoft, Akamai
JOB !!!
Service Companies – 2.5 to 3.5
Product Companies – 4.0 to 5.5
Premium Product Companies – 7 to 12
What Now !!!
Pick up Android SDK and use the developer link to kick
start
Develop small apps and relish 
Find an idea, develop it and put it in playstore.
25$ to put in PlayStore
I have an account – You can use it free
Get back to me with your questions
Android Help??
Project Help??
Android References
http://developer.android.com
Questions ?
http://www.stackoverflow.com
Senthil.acs@gmail.com

More Related Content

What's hot

Achieving 100% mobile test coverage perfecto mobile
Achieving 100% mobile test coverage perfecto mobileAchieving 100% mobile test coverage perfecto mobile
Achieving 100% mobile test coverage perfecto mobilePerfecto Mobile
 
7 use cases of real device testing
7 use cases of real device testing7 use cases of real device testing
7 use cases of real device testingheadspin2
 
FYP Presentation On Android based Google Map Application
FYP Presentation On Android based Google Map ApplicationFYP Presentation On Android based Google Map Application
FYP Presentation On Android based Google Map ApplicationMuzamil Hussain
 
Publishing and delivery of mobile application ios
Publishing and delivery of mobile application   iosPublishing and delivery of mobile application   ios
Publishing and delivery of mobile application iosK Senthil Kumar
 
Webinar learn how to test any mobile app style from within eclipse using real...
Webinar learn how to test any mobile app style from within eclipse using real...Webinar learn how to test any mobile app style from within eclipse using real...
Webinar learn how to test any mobile app style from within eclipse using real...Perfecto Mobile
 
Introduction To Mobile-Automation
Introduction To Mobile-AutomationIntroduction To Mobile-Automation
Introduction To Mobile-AutomationMindfire Solutions
 
Everything You Need to Know About Testing Foldable Phones
Everything You Need to Know About Testing Foldable PhonesEverything You Need to Know About Testing Foldable Phones
Everything You Need to Know About Testing Foldable PhonesPerfecto by Perforce
 
Basic android workshop
Basic android workshopBasic android workshop
Basic android workshopThagatpam Tech
 
Maximizing your enterprise mobility and mobile testing strategy
Maximizing your enterprise mobility and mobile testing strategyMaximizing your enterprise mobility and mobile testing strategy
Maximizing your enterprise mobility and mobile testing strategyPerfecto Mobile
 
Day 3: Getting Active Through Activities
Day 3: Getting Active Through ActivitiesDay 3: Getting Active Through Activities
Day 3: Getting Active Through ActivitiesAhsanul Karim
 
Mobile applications and automation testing
Mobile applications and automation testingMobile applications and automation testing
Mobile applications and automation testingIndicThreads
 
Android Development for Beginners with Sample Project - Day 1
Android Development for Beginners with Sample Project - Day 1Android Development for Beginners with Sample Project - Day 1
Android Development for Beginners with Sample Project - Day 1Joemarie Amparo
 
Simon Bates, Manifesto Digital - Mobile Application Development: Past, Presen...
Simon Bates, Manifesto Digital - Mobile Application Development: Past, Presen...Simon Bates, Manifesto Digital - Mobile Application Development: Past, Presen...
Simon Bates, Manifesto Digital - Mobile Application Development: Past, Presen...Simon Bates
 
Android Appstore BP for HW ODM
Android Appstore BP for HW ODMAndroid Appstore BP for HW ODM
Android Appstore BP for HW ODMJouston Huang
 
TechTalk: Wind Tunnel, Personas, and Testing Real UX
TechTalk: Wind Tunnel, Personas, and Testing Real UXTechTalk: Wind Tunnel, Personas, and Testing Real UX
TechTalk: Wind Tunnel, Personas, and Testing Real UXLizzy Guido (she/her)
 
Appurify presentation at Appium meetup - Running Appium on real devices at scale
Appurify presentation at Appium meetup - Running Appium on real devices at scaleAppurify presentation at Appium meetup - Running Appium on real devices at scale
Appurify presentation at Appium meetup - Running Appium on real devices at scaleJay Srinivasan
 
Generic test plan
Generic test planGeneric test plan
Generic test planPooja Dutt
 

What's hot (20)

Achieving 100% mobile test coverage perfecto mobile
Achieving 100% mobile test coverage perfecto mobileAchieving 100% mobile test coverage perfecto mobile
Achieving 100% mobile test coverage perfecto mobile
 
7 use cases of real device testing
7 use cases of real device testing7 use cases of real device testing
7 use cases of real device testing
 
FYP Presentation On Android based Google Map Application
FYP Presentation On Android based Google Map ApplicationFYP Presentation On Android based Google Map Application
FYP Presentation On Android based Google Map Application
 
Publishing and delivery of mobile application ios
Publishing and delivery of mobile application   iosPublishing and delivery of mobile application   ios
Publishing and delivery of mobile application ios
 
Webinar learn how to test any mobile app style from within eclipse using real...
Webinar learn how to test any mobile app style from within eclipse using real...Webinar learn how to test any mobile app style from within eclipse using real...
Webinar learn how to test any mobile app style from within eclipse using real...
 
Introduction To Mobile-Automation
Introduction To Mobile-AutomationIntroduction To Mobile-Automation
Introduction To Mobile-Automation
 
Everything You Need to Know About Testing Foldable Phones
Everything You Need to Know About Testing Foldable PhonesEverything You Need to Know About Testing Foldable Phones
Everything You Need to Know About Testing Foldable Phones
 
Basic android workshop
Basic android workshopBasic android workshop
Basic android workshop
 
Maximizing your enterprise mobility and mobile testing strategy
Maximizing your enterprise mobility and mobile testing strategyMaximizing your enterprise mobility and mobile testing strategy
Maximizing your enterprise mobility and mobile testing strategy
 
Day 3: Getting Active Through Activities
Day 3: Getting Active Through ActivitiesDay 3: Getting Active Through Activities
Day 3: Getting Active Through Activities
 
Push Notification
Push NotificationPush Notification
Push Notification
 
iOS Application Testing
iOS Application TestingiOS Application Testing
iOS Application Testing
 
Mobile applications and automation testing
Mobile applications and automation testingMobile applications and automation testing
Mobile applications and automation testing
 
Android Development for Beginners with Sample Project - Day 1
Android Development for Beginners with Sample Project - Day 1Android Development for Beginners with Sample Project - Day 1
Android Development for Beginners with Sample Project - Day 1
 
Simon Bates, Manifesto Digital - Mobile Application Development: Past, Presen...
Simon Bates, Manifesto Digital - Mobile Application Development: Past, Presen...Simon Bates, Manifesto Digital - Mobile Application Development: Past, Presen...
Simon Bates, Manifesto Digital - Mobile Application Development: Past, Presen...
 
Android Appstore BP for HW ODM
Android Appstore BP for HW ODMAndroid Appstore BP for HW ODM
Android Appstore BP for HW ODM
 
TechTalk: Wind Tunnel, Personas, and Testing Real UX
TechTalk: Wind Tunnel, Personas, and Testing Real UXTechTalk: Wind Tunnel, Personas, and Testing Real UX
TechTalk: Wind Tunnel, Personas, and Testing Real UX
 
Appurify presentation at Appium meetup - Running Appium on real devices at scale
Appurify presentation at Appium meetup - Running Appium on real devices at scaleAppurify presentation at Appium meetup - Running Appium on real devices at scale
Appurify presentation at Appium meetup - Running Appium on real devices at scale
 
Generic test plan
Generic test planGeneric test plan
Generic test plan
 
Mideesh23june2015
Mideesh23june2015Mideesh23june2015
Mideesh23june2015
 

Viewers also liked

Building Automation: Residence
Building Automation: ResidenceBuilding Automation: Residence
Building Automation: ResidenceKapil Sinha
 
Факторы тревожности у детей
Факторы тревожности у детейФакторы тревожности у детей
Факторы тревожности у детейarsvenik
 
2010 08-26-smart-architecture
2010 08-26-smart-architecture2010 08-26-smart-architecture
2010 08-26-smart-architectureCHIP
 
Smart Construction by Leopardo
Smart Construction by LeopardoSmart Construction by Leopardo
Smart Construction by Leopardoleobuild
 
Choosing materials in interior design for all centuries or periods
Choosing materials in interior design for all centuries or periodsChoosing materials in interior design for all centuries or periods
Choosing materials in interior design for all centuries or periodsLumbad 1989
 
03 smart textiles - technology and application fields- scheulen - liège
03 smart textiles - technology and application fields- scheulen - liège03 smart textiles - technology and application fields- scheulen - liège
03 smart textiles - technology and application fields- scheulen - liègeSirris
 
Home and building automation systems sun slice
Home and building automation systems   sun sliceHome and building automation systems   sun slice
Home and building automation systems sun sliceDario Bonino
 
Home and building automation systems
Home and building automation systemsHome and building automation systems
Home and building automation systemsDario Bonino
 
Eco Friendly Interior Materials
Eco Friendly Interior MaterialsEco Friendly Interior Materials
Eco Friendly Interior MaterialsAPL-WI
 
Smart materials
Smart materialsSmart materials
Smart materialsJobin Joy
 
Intelligent building system
Intelligent building systemIntelligent building system
Intelligent building systemSaifullah Memon
 
Green Building Materials
Green Building MaterialsGreen Building Materials
Green Building MaterialsPulkit Shukla
 

Viewers also liked (16)

Building Automation: Residence
Building Automation: ResidenceBuilding Automation: Residence
Building Automation: Residence
 
Факторы тревожности у детей
Факторы тревожности у детейФакторы тревожности у детей
Факторы тревожности у детей
 
2010 08-26-smart-architecture
2010 08-26-smart-architecture2010 08-26-smart-architecture
2010 08-26-smart-architecture
 
Smart Construction by Leopardo
Smart Construction by LeopardoSmart Construction by Leopardo
Smart Construction by Leopardo
 
Choosing materials in interior design for all centuries or periods
Choosing materials in interior design for all centuries or periodsChoosing materials in interior design for all centuries or periods
Choosing materials in interior design for all centuries or periods
 
Smart Construction Site
Smart Construction SiteSmart Construction Site
Smart Construction Site
 
i-Building
i-Buildingi-Building
i-Building
 
Arch design development
Arch design developmentArch design development
Arch design development
 
03 smart textiles - technology and application fields- scheulen - liège
03 smart textiles - technology and application fields- scheulen - liège03 smart textiles - technology and application fields- scheulen - liège
03 smart textiles - technology and application fields- scheulen - liège
 
Home and building automation systems sun slice
Home and building automation systems   sun sliceHome and building automation systems   sun slice
Home and building automation systems sun slice
 
ACH 121 Lecture 14 (Finishes)
ACH 121 Lecture 14 (Finishes)ACH 121 Lecture 14 (Finishes)
ACH 121 Lecture 14 (Finishes)
 
Home and building automation systems
Home and building automation systemsHome and building automation systems
Home and building automation systems
 
Eco Friendly Interior Materials
Eco Friendly Interior MaterialsEco Friendly Interior Materials
Eco Friendly Interior Materials
 
Smart materials
Smart materialsSmart materials
Smart materials
 
Intelligent building system
Intelligent building systemIntelligent building system
Intelligent building system
 
Green Building Materials
Green Building MaterialsGreen Building Materials
Green Building Materials
 

Similar to Android_ver_01

Day: 1 Introduction to Mobile Application Development (in Android)
Day: 1 Introduction to Mobile Application Development (in Android)Day: 1 Introduction to Mobile Application Development (in Android)
Day: 1 Introduction to Mobile Application Development (in Android)Ahsanul Karim
 
Sogeti - Android tech track presentation - 24 february 2011
Sogeti - Android tech track presentation - 24 february 2011Sogeti - Android tech track presentation - 24 february 2011
Sogeti - Android tech track presentation - 24 february 2011Kenneth van Rumste
 
Getting started with android programming
Getting started with android programmingGetting started with android programming
Getting started with android programmingPERKYTORIALS
 
Mobile app development using PhoneGap - A comprehensive walkthrough - Touch T...
Mobile app development using PhoneGap - A comprehensive walkthrough - Touch T...Mobile app development using PhoneGap - A comprehensive walkthrough - Touch T...
Mobile app development using PhoneGap - A comprehensive walkthrough - Touch T...RIA RUI Society
 
Learnings from Mobile Application Testing
Learnings from Mobile Application TestingLearnings from Mobile Application Testing
Learnings from Mobile Application TestingThoughtworks
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android DevelopmentProf. Erwin Globio
 
Android terminologies
Android terminologiesAndroid terminologies
Android terminologiesjerry vasoya
 
PPT on Android Applications
PPT on Android ApplicationsPPT on Android Applications
PPT on Android ApplicationsAshish Agarwal
 
5 beginner android application development foundation
5 beginner android application development foundation5 beginner android application development foundation
5 beginner android application development foundationCbitss Technologies
 
Getting Started with AWS Mobile Hub
Getting Started with AWS Mobile Hub Getting Started with AWS Mobile Hub
Getting Started with AWS Mobile Hub Amazon Web Services
 
Introduction to Android Development Latest
Introduction to Android Development LatestIntroduction to Android Development Latest
Introduction to Android Development LatestProf. Erwin Globio
 
Mobile Application Development
Mobile Application DevelopmentMobile Application Development
Mobile Application Developmentsonichinmay
 
Nativa Android Applications development
Nativa Android Applications developmentNativa Android Applications development
Nativa Android Applications developmentAlfredo Morresi
 

Similar to Android_ver_01 (20)

Day: 1 Introduction to Mobile Application Development (in Android)
Day: 1 Introduction to Mobile Application Development (in Android)Day: 1 Introduction to Mobile Application Development (in Android)
Day: 1 Introduction to Mobile Application Development (in Android)
 
Sogeti - Android tech track presentation - 24 february 2011
Sogeti - Android tech track presentation - 24 february 2011Sogeti - Android tech track presentation - 24 february 2011
Sogeti - Android tech track presentation - 24 february 2011
 
Mobile Application Testing
Mobile Application TestingMobile Application Testing
Mobile Application Testing
 
Getting started with android programming
Getting started with android programmingGetting started with android programming
Getting started with android programming
 
Mobile app development using PhoneGap - A comprehensive walkthrough - Touch T...
Mobile app development using PhoneGap - A comprehensive walkthrough - Touch T...Mobile app development using PhoneGap - A comprehensive walkthrough - Touch T...
Mobile app development using PhoneGap - A comprehensive walkthrough - Touch T...
 
Android Minnebar
Android MinnebarAndroid Minnebar
Android Minnebar
 
Learnings from Mobile Application Testing
Learnings from Mobile Application TestingLearnings from Mobile Application Testing
Learnings from Mobile Application Testing
 
Unit2
Unit2Unit2
Unit2
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 
Android terminologies
Android terminologiesAndroid terminologies
Android terminologies
 
PPT on Android Applications
PPT on Android ApplicationsPPT on Android Applications
PPT on Android Applications
 
SmartVision Android App
SmartVision Android AppSmartVision Android App
SmartVision Android App
 
5 beginner android application development foundation
5 beginner android application development foundation5 beginner android application development foundation
5 beginner android application development foundation
 
Getting Started with AWS Mobile Hub
Getting Started with AWS Mobile Hub Getting Started with AWS Mobile Hub
Getting Started with AWS Mobile Hub
 
Introduction to Android Development Latest
Introduction to Android Development LatestIntroduction to Android Development Latest
Introduction to Android Development Latest
 
Mobile Application Development
Mobile Application DevelopmentMobile Application Development
Mobile Application Development
 
Nativa Android Applications development
Nativa Android Applications developmentNativa Android Applications development
Nativa Android Applications development
 
Hybrid Mobile App
Hybrid Mobile AppHybrid Mobile App
Hybrid Mobile App
 
Hybrid mobile app
Hybrid mobile appHybrid mobile app
Hybrid mobile app
 
Android
AndroidAndroid
Android
 

Android_ver_01

  • 3. Why Motivation? Motivation drives your growth Specifically “Self Motivation” Beneficiaries – You and your organization Today’s Motivation – Android
  • 4. What is Android? It is not an Operating System…. An open source software stack build on top of Linux Language – Java Provides an infrastructure for advanced applications. Helps developers use that infrastructure for apps
  • 5. Android Development Third party app development Our agenda Ability to monetize apps http://developer.android.com Native Platform development Mobile Phone makers (HTC, Samsung, Motorola) Genuine geeks Cannot monetize http://source.android.com
  • 6. Android SDK Started – Cupcake (1.5) Current – Jelly Bean(4.1) Your requirements Windows/Linux/Mac Eclipse Helios onwards (http://www.eclipse.org) Eclipse Android Development Plugin (ADT) Android SDK (Android JARS + Emulators) Question – Difference between Simulator and Emulator???
  • 7. Simulator and Emulator Simulator A system designed only to test your software Flight Simulator Space Simulator Obviously you cannot fly  Emulator Test your target architecture on another computer Copy the real hardware and software into another computer Android Emulator
  • 8. What will you learn today? SDK Setup Hello World Application Adding more concepts to the application Practical correlation of Android concepts Writing a Location based application Device Management
  • 9. Agenda Hello World Application Application Components Concepts  Activity  Service  App Storage  Broadcast Receivers  Android Permissions  Location and Maps  Debugging Device Management
  • 10. Hello World App Create a new project in Eclipse using Android SDK You are done !!!
  • 12. App Components Source Resources Drawables (various screen sizes) Layout (various screen sizes) Strings (various languages) Manifest Contains all activities, services, providers, receivers, permissions required by the application
  • 13. Application Needs UI (Activity) Background Worker (Service) App Storage (Shared Prefs, Internal/External Storage, Content Providers) Change receivers (Broadcast Receiver)
  • 14. Android Activity Anything that the application does A UI window containing various views (Button, TextView, Label etc) – Similar to Java Swings View elements may listen for user actions An application can have various activities One can start another (Opening one window from another window) – Using startActivity(intent)
  • 15. Launcher Activity The activity that shows up when the app is launched Manifest changes <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>
  • 18. Lets try it out!!! Create an app Check the Manifest for Launcher Activity Create a Sub Activity and launch it from the main activity Return the sub activity result to the main activity Add some UI elements Activity Lifecycle example – Google provided
  • 19. Services To run in background & no UI Types - Started Services, Bound Services Started Services Owned by the application Typically started by an activity Bound Services Owned by the application Shared by others – Binder
  • 20. Invoking a Service startService() Code to start a service Intent intent = new Intent(this, HelloService.class); startService(intent); onStartCommand() bindService() onBind() Requires an Intent action/Service class name
  • 21. Started Service Intent Service Offloads to a Worker Thread Provides a Work Queue Stops the service once work is done Less code Normal Service Manually create background thread Multi threaded work More code
  • 23. Lets try it out!!! Create three Services Intent Service – One at a time Normal Service – One at a time Normal Service – Multi Request Bound Service (If time permits) Use an Activity to launch the service Update Manifest with the service declarations
  • 24. Application Storage Shared Preferences User’s settings Key-Value Pairs Internal Storage App’s private data Cannot be accessed by other apps External Storage Public data Typically sdcard
  • 25. Content Providers Content Providers Identified using a URI SQLite databases Efficient data access Can be accessed by other apps Example: Read Contacts
  • 27. Lets try it out !!! Create a content provider step by step SQLiteOpenHelper instance SQLiteDatabase instance Implement CRUD methods Store student name and percentage Show the saved data
  • 28. Listeners & Broadcast Receivers Hey Friend! Inform us when the results are out!! Above statement – Registration You – Listener Your Friend – Broadcaster “When the results are out” – Intent
  • 29. Listeners & Broadcast Receivers Register for event notifications Signal Change Notification On boot complete Notification Battery Notification Location Change Notification Etc… Communicate results from one app to other/others
  • 30. Listeners & Broadcast Receivers Registration Permanent Register in Manifest Example: onBootComplete On/Off Register/Unregister when required Example: Location Change Notification
  • 31. Lets try it out !!! Create an application that will show Signal changes Let the application be launched on Boot Register/UnRegister signal changes
  • 32. Intent & Intent Filter Intent – The intention behind doing something Used in Services example to pass data. Intent Filter – What are my intentions? Used in Broadcast receivers to specify what to listen to.
  • 33. Android Permissions Declared in Manifest Required if your app uses Android sensitive infrastructure Read/Write contacts Read Network State Read/Write External Storage (App Storage) OnBootComplete Etc…
  • 34. More Concepts More UI Concepts  Alert Dialogs  Date, Time dialogs  ANR  Pick Contacts  Notification/Toasts Location, Maps Activity  Usage of Broadcast Receivers  Use Google APIs in Android Device Management  Need for Securing Mobile Devices
  • 35. UI Concepts Dialogs Alerts the user for info or some input ANR – Application Not Responding Drives the developer crazy Never run long running tasks in UI Thread Remember – LoaderCallbacks<CursorLoader>? Lets try out a sample showing all the above PLUS How to launch Contacts app
  • 36. Location and Maps Google APIs (MapActivity) Obtain Maps API Key Require Internet Permission Maps add Overlay Items Location Information – GPS/Network
  • 37. Lets try it out!!! Write a MapActivity Register for Location from GPS/Network Place that location onto the Map as a OverlayItem Point using a Marker – A Pin Permission Requirements for the App
  • 38. Device Management Set Password Policy Encrypt storage Remote Lock/Wipe Control Camera What is the need?
  • 39. Lost your device? Remotely Lock your device Install Apps such as Lookout Try to get the location after losing Configure alternate numbers in Lookout Get SMS when the SIM card is changed More chances of getting the device back
  • 41. Benefits of learning Android Massive market share (50 to 60%) of global smartphone share. Samsung, Motorola, Sony, LG, HTC are major players Play Store – 500000+ apps Get a fundoo job Monetize your application
  • 42. JOB !!! Show your marks and answer simple Questions Learn Android + One app in PlayStore Data Structures + Algorithms + 1 Mobile Platform
  • 43. JOB !!! Show your marks and answer simple Questions – Service Companies - Infosys, Wipro, HCL, CTS, TCS etc… Android – Good Product Companies – Zomato, Zynga, SAP, Ericsson Data Structures + Algorithms + 1 Mobile Platform – Premium Product Companies Google, Yahoo, Microsoft, Akamai
  • 44. JOB !!! Service Companies – 2.5 to 3.5 Product Companies – 4.0 to 5.5 Premium Product Companies – 7 to 12
  • 45. What Now !!! Pick up Android SDK and use the developer link to kick start Develop small apps and relish  Find an idea, develop it and put it in playstore. 25$ to put in PlayStore I have an account – You can use it free Get back to me with your questions Android Help?? Project Help??