SlideShare a Scribd company logo
Android Service
Topics
• What is a Service?
• Service lifecycles
• Permissions
• Local services
• Remote services
What is a Service?
When a Service Used?
• Applications will need to run processes for a
long time without any intervention from the
user, or very rare interventions.
• These background processes need to keep
running even when the phone is being used for
other activities / tasks.
Two Types of Services
• Local service
> Not accessible from other applications
> Runs in the same process of the application that
starts it
• Remote service
> Accessible from other applications as well
> Exposes to other applications through AIDL (Android
Services Definition Language)
Service and Notification
• Service is a long lived component and does not
implement any user interface of its own.
> Typically a user interacts with a service through an
activity that has a UI.
• The service “notifies” the user in case of any
need for user intervention.
> Through the notification (such as status bar
notification), the service can give a user interface for
binding to the service or viewing the status of the
service or any other similar interaction with the
service.
What Facilities Service Provide?
• A facility for the application to tell the system
about something it wants to be doing in the
background (even when the user is not directly
interacting with the application).
> This corresponds to calls to Context.startService(),
which ask the system to schedule work for the
service, to be run until the service or someone else
explicitly stop it.
• A facility for an application to expose some of
its functionality to other applications.
> This corresponds to calls to Context.bindService(),
which allows a long-standing connection to be made
to the service in order to interact with it.
Binding to a Service
• Once a service has begun and is running in the
background, activities can “bind” to the service.
> In fact, if we want to bind to a service that has not
started, calling to bind could initiate the service.
Service Lifecycle
Starting a Service
• If someone calls Context.startService() then the
system will retrieve the service (creating it and
calling its onCreate() method if needed) and
then call its onStartCommand(Intent, int, int)
method with the arguments supplied by the
client.
• The service will at this point continue running
until Context.stopService() or stopSelf() is
called.
Modes of Operations
• For started services, there are two additional
major modes of operation they can decide to
run in, depending on the value they return from
onStartCommand():
> START_STICKY is used for services that are explicitly
started and stopped as needed,
> START_NOT_STICKY or START_REDELIVER_INTENT
are used for services that should only remain running
while processing any commands sent to them.
Getting a Connection to a Service
• Clients can also use Context.bindService() to
obtain a persistent connection to a service.
> This likewise creates the service if it is not already
running (calling onCreate() while doing so), but does
not call onStartCommand().
• The client will receive the IBinder object that
the service returns from its onBind(Intent)
method, allowing the client to then make calls
back to the service.
Permissions
Permissions
• Global access to a service can be enforced
when it is declared in its manifest's <service>
tag.
• By doing so, other applications will need to
declare a corresponding <uses-permission>
element in their own manifest to be able to
start, stop, or bind to the service.
• In addition, a service can protect individual IPC
calls into it with permissions, by calling the
checkCallingPermission(String) method before
executing the implementation of that call.
Local Service Sample
Local Service
• One of the most common uses of a Service is as
a secondary component running alongside
other parts of an application, in the same
process as the rest of the components.
> All components of an .apk run in the same process
unless explicitly stated otherwise, so this is a typical
situation.
• When used in this way, by assuming the
components are in the same process, you can
greatly simplify the interaction between them
> Clients of the service can simply cast the IBinder
they receive from it to a concrete class published by
the service.
Remote Messenger Service
Remote Messenger Service
• If you need to be able to write a Service that
can perform complicated communication with
clients in remote processes (beyond simply the
use of Context.startService to send commands
to it), then you can use the Messenger class
instead of writing full AIDL files.
Thank you

More Related Content

Viewers also liked

Todo trabajo es temporal
Todo trabajo es temporalTodo trabajo es temporal
Todo trabajo es temporal
Android UNAM
 
Android de la A a la Z Actividades ulises gonzalez
Android de la A a la Z   Actividades ulises gonzalezAndroid de la A a la Z   Actividades ulises gonzalez
Android de la A a la Z Actividades ulises gonzalez
Android UNAM
 
Android de la A a la Z XML Ulises Gonzalez
Android de la A a la Z  XML Ulises GonzalezAndroid de la A a la Z  XML Ulises Gonzalez
Android de la A a la Z XML Ulises Gonzalez
Android UNAM
 
Curso Taller Android Procesado Imagen
Curso Taller Android Procesado ImagenCurso Taller Android Procesado Imagen
Curso Taller Android Procesado Imagen
Emilio Aviles Avila
 
operaciones aritméticas usando
operaciones aritméticas  usando operaciones aritméticas  usando
operaciones aritméticas usando
Sarahi Garcia Ruiz
 
Android: Interfaz de Usuario
Android: Interfaz de UsuarioAndroid: Interfaz de Usuario
Android: Interfaz de Usuario
Enrique López Mañas
 
ESTRUCTURA DE UN PROYECTO EN ANDROID STUDIO 2.2
ESTRUCTURA DE UN PROYECTO EN ANDROID STUDIO 2.2ESTRUCTURA DE UN PROYECTO EN ANDROID STUDIO 2.2
ESTRUCTURA DE UN PROYECTO EN ANDROID STUDIO 2.2
Jacinto Cabrera Rodríguez
 
Desarrollo android - 6 - multimedia
Desarrollo android - 6 - multimediaDesarrollo android - 6 - multimedia
Desarrollo android - 6 - multimedia
Emilio Aviles Avila
 
Hola mundo
Hola mundoHola mundo
Hola mundo
maldonadoyari
 
Intro. a Android Instituto Bosc de la Coma en Olot
Intro. a Android Instituto Bosc de la Coma en OlotIntro. a Android Instituto Bosc de la Coma en Olot
Intro. a Android Instituto Bosc de la Coma en Olot
hojalataverde
 
BDJ Team_Oct2015_pg_BADT
BDJ Team_Oct2015_pg_BADTBDJ Team_Oct2015_pg_BADT
BDJ Team_Oct2015_pg_BADT
Julie Bissett
 
Er. Anand Resume
Er. Anand ResumeEr. Anand Resume
Er. Anand Resume
Anand Sharma
 
Interfaces increibles en Android
Interfaces increibles en AndroidInterfaces increibles en Android
Interfaces increibles en Android
jezabelink
 
Game store app(2)
Game store app(2)Game store app(2)
Game store app(2)
Jenifer Monroy
 
Desarrollo en Android: Conceptos Básicos
Desarrollo en Android: Conceptos BásicosDesarrollo en Android: Conceptos Básicos
Desarrollo en Android: Conceptos Básicos
Gabriel Huecas
 
Sincronización de BD SQLite con MySQL en Android
Sincronización de BD SQLite con MySQL en AndroidSincronización de BD SQLite con MySQL en Android
Sincronización de BD SQLite con MySQL en Android
Meison Chirinos
 
Iniciación a Android
Iniciación a AndroidIniciación a Android
Iniciación a Android
aleatechnology
 
Education and Management of Diabetics
Education and Management of DiabeticsEducation and Management of Diabetics
Education and Management of Diabetics
Dalia A. Hamdy
 
Diseño de interfaces móviles (UX y la arquitectura de software)
Diseño de interfaces móviles (UX y la arquitectura de software)Diseño de interfaces móviles (UX y la arquitectura de software)
Diseño de interfaces móviles (UX y la arquitectura de software)
jezabelink
 
Bases de Datos en Android y Desarrollo de Aplicaciones Móviles Multiplataforma
Bases de Datos en Android y Desarrollo de Aplicaciones Móviles MultiplataformaBases de Datos en Android y Desarrollo de Aplicaciones Móviles Multiplataforma
Bases de Datos en Android y Desarrollo de Aplicaciones Móviles Multiplataforma
Universidad Autonoma de Chihuahua
 

Viewers also liked (20)

Todo trabajo es temporal
Todo trabajo es temporalTodo trabajo es temporal
Todo trabajo es temporal
 
Android de la A a la Z Actividades ulises gonzalez
Android de la A a la Z   Actividades ulises gonzalezAndroid de la A a la Z   Actividades ulises gonzalez
Android de la A a la Z Actividades ulises gonzalez
 
Android de la A a la Z XML Ulises Gonzalez
Android de la A a la Z  XML Ulises GonzalezAndroid de la A a la Z  XML Ulises Gonzalez
Android de la A a la Z XML Ulises Gonzalez
 
Curso Taller Android Procesado Imagen
Curso Taller Android Procesado ImagenCurso Taller Android Procesado Imagen
Curso Taller Android Procesado Imagen
 
operaciones aritméticas usando
operaciones aritméticas  usando operaciones aritméticas  usando
operaciones aritméticas usando
 
Android: Interfaz de Usuario
Android: Interfaz de UsuarioAndroid: Interfaz de Usuario
Android: Interfaz de Usuario
 
ESTRUCTURA DE UN PROYECTO EN ANDROID STUDIO 2.2
ESTRUCTURA DE UN PROYECTO EN ANDROID STUDIO 2.2ESTRUCTURA DE UN PROYECTO EN ANDROID STUDIO 2.2
ESTRUCTURA DE UN PROYECTO EN ANDROID STUDIO 2.2
 
Desarrollo android - 6 - multimedia
Desarrollo android - 6 - multimediaDesarrollo android - 6 - multimedia
Desarrollo android - 6 - multimedia
 
Hola mundo
Hola mundoHola mundo
Hola mundo
 
Intro. a Android Instituto Bosc de la Coma en Olot
Intro. a Android Instituto Bosc de la Coma en OlotIntro. a Android Instituto Bosc de la Coma en Olot
Intro. a Android Instituto Bosc de la Coma en Olot
 
BDJ Team_Oct2015_pg_BADT
BDJ Team_Oct2015_pg_BADTBDJ Team_Oct2015_pg_BADT
BDJ Team_Oct2015_pg_BADT
 
Er. Anand Resume
Er. Anand ResumeEr. Anand Resume
Er. Anand Resume
 
Interfaces increibles en Android
Interfaces increibles en AndroidInterfaces increibles en Android
Interfaces increibles en Android
 
Game store app(2)
Game store app(2)Game store app(2)
Game store app(2)
 
Desarrollo en Android: Conceptos Básicos
Desarrollo en Android: Conceptos BásicosDesarrollo en Android: Conceptos Básicos
Desarrollo en Android: Conceptos Básicos
 
Sincronización de BD SQLite con MySQL en Android
Sincronización de BD SQLite con MySQL en AndroidSincronización de BD SQLite con MySQL en Android
Sincronización de BD SQLite con MySQL en Android
 
Iniciación a Android
Iniciación a AndroidIniciación a Android
Iniciación a Android
 
Education and Management of Diabetics
Education and Management of DiabeticsEducation and Management of Diabetics
Education and Management of Diabetics
 
Diseño de interfaces móviles (UX y la arquitectura de software)
Diseño de interfaces móviles (UX y la arquitectura de software)Diseño de interfaces móviles (UX y la arquitectura de software)
Diseño de interfaces móviles (UX y la arquitectura de software)
 
Bases de Datos en Android y Desarrollo de Aplicaciones Móviles Multiplataforma
Bases de Datos en Android y Desarrollo de Aplicaciones Móviles MultiplataformaBases de Datos en Android y Desarrollo de Aplicaciones Móviles Multiplataforma
Bases de Datos en Android y Desarrollo de Aplicaciones Móviles Multiplataforma
 

Similar to Android service

Services I.pptx
Services I.pptxServices I.pptx
Services I.pptx
RiziX3
 
Aidl service
Aidl serviceAidl service
Aidl service
Anjan Debnath
 
Android service and gcm
Android service and gcmAndroid service and gcm
Android service and gcm
Ran Zeller
 
Android App Development - 08 Services
Android App Development - 08 ServicesAndroid App Development - 08 Services
Android App Development - 08 Services
Diego Grancini
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
Owain Lewis
 
Andriod Lecture 8 A.pptx
Andriod Lecture 8 A.pptxAndriod Lecture 8 A.pptx
Andriod Lecture 8 A.pptx
faiz324545
 
Basics 4
Basics   4Basics   4
Basics 4
Michael Shrove
 
Data Transfer between Activities & Databases
Data Transfer between Activities & DatabasesData Transfer between Activities & Databases
Data Transfer between Activities & Databases
Muhammad Sajid
 
Android intents, notification and broadcast recievers
Android intents, notification and broadcast recieversAndroid intents, notification and broadcast recievers
Android intents, notification and broadcast recievers
Utkarsh Mankad
 
JINI Technology
JINI TechnologyJINI Technology
JINI Technology
Rachna Singh
 
OutSystems community meetup 2018 11 service modules
OutSystems community meetup 2018 11 service modulesOutSystems community meetup 2018 11 service modules
OutSystems community meetup 2018 11 service modules
Kurt Vandevelde
 
Outsystems community meetup 2018 11 service modules
Outsystems community meetup 2018 11 service modulesOutsystems community meetup 2018 11 service modules
Outsystems community meetup 2018 11 service modules
Providit
 
Service-oriented architecture (SOA) is a method of software development that ...
Service-oriented architecture (SOA) is a method of software development that ...Service-oriented architecture (SOA) is a method of software development that ...
Service-oriented architecture (SOA) is a method of software development that ...
ssuser0d0f881
 
Displaying google maps in mobileapplication.pptx
Displaying google maps in mobileapplication.pptxDisplaying google maps in mobileapplication.pptx
Displaying google maps in mobileapplication.pptx
sanaiftikhar23
 
6. Microservices architecture.pptx
6. Microservices architecture.pptx6. Microservices architecture.pptx
6. Microservices architecture.pptx
datapro2
 
Testing microservices with rest assured
Testing microservices with rest assuredTesting microservices with rest assured
Testing microservices with rest assured
Kushan Shalindra Amarasiri - Technical QE Specialist
 
Android101
Android101Android101
Android101
David Marques
 
Grails services
Grails servicesGrails services
Grails services
NexThoughts Technologies
 
Intro to Microservices Architecture
Intro to Microservices ArchitectureIntro to Microservices Architecture
Intro to Microservices Architecture
Peter Nijem
 
Testing Microservices
Testing MicroservicesTesting Microservices
Testing Microservices
Nagarro
 

Similar to Android service (20)

Services I.pptx
Services I.pptxServices I.pptx
Services I.pptx
 
Aidl service
Aidl serviceAidl service
Aidl service
 
Android service and gcm
Android service and gcmAndroid service and gcm
Android service and gcm
 
Android App Development - 08 Services
Android App Development - 08 ServicesAndroid App Development - 08 Services
Android App Development - 08 Services
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 
Andriod Lecture 8 A.pptx
Andriod Lecture 8 A.pptxAndriod Lecture 8 A.pptx
Andriod Lecture 8 A.pptx
 
Basics 4
Basics   4Basics   4
Basics 4
 
Data Transfer between Activities & Databases
Data Transfer between Activities & DatabasesData Transfer between Activities & Databases
Data Transfer between Activities & Databases
 
Android intents, notification and broadcast recievers
Android intents, notification and broadcast recieversAndroid intents, notification and broadcast recievers
Android intents, notification and broadcast recievers
 
JINI Technology
JINI TechnologyJINI Technology
JINI Technology
 
OutSystems community meetup 2018 11 service modules
OutSystems community meetup 2018 11 service modulesOutSystems community meetup 2018 11 service modules
OutSystems community meetup 2018 11 service modules
 
Outsystems community meetup 2018 11 service modules
Outsystems community meetup 2018 11 service modulesOutsystems community meetup 2018 11 service modules
Outsystems community meetup 2018 11 service modules
 
Service-oriented architecture (SOA) is a method of software development that ...
Service-oriented architecture (SOA) is a method of software development that ...Service-oriented architecture (SOA) is a method of software development that ...
Service-oriented architecture (SOA) is a method of software development that ...
 
Displaying google maps in mobileapplication.pptx
Displaying google maps in mobileapplication.pptxDisplaying google maps in mobileapplication.pptx
Displaying google maps in mobileapplication.pptx
 
6. Microservices architecture.pptx
6. Microservices architecture.pptx6. Microservices architecture.pptx
6. Microservices architecture.pptx
 
Testing microservices with rest assured
Testing microservices with rest assuredTesting microservices with rest assured
Testing microservices with rest assured
 
Android101
Android101Android101
Android101
 
Grails services
Grails servicesGrails services
Grails services
 
Intro to Microservices Architecture
Intro to Microservices ArchitectureIntro to Microservices Architecture
Intro to Microservices Architecture
 
Testing Microservices
Testing MicroservicesTesting Microservices
Testing Microservices
 

More from Krazy Koder

2310 b xd
2310 b xd2310 b xd
2310 b xd
Krazy Koder
 
2310 b xd
2310 b xd2310 b xd
2310 b xd
Krazy Koder
 
2310 b xd
2310 b xd2310 b xd
2310 b xd
Krazy Koder
 
2310 b xc
2310 b xc2310 b xc
2310 b xc
Krazy Koder
 
2310 b xb
2310 b xb2310 b xb
2310 b xb
Krazy Koder
 
2310 b 17
2310 b 172310 b 17
2310 b 17
Krazy Koder
 
2310 b 16
2310 b 162310 b 16
2310 b 16
Krazy Koder
 
2310 b 16
2310 b 162310 b 16
2310 b 16
Krazy Koder
 
2310 b 15
2310 b 152310 b 15
2310 b 15
Krazy Koder
 
2310 b 15
2310 b 152310 b 15
2310 b 15
Krazy Koder
 
2310 b 14
2310 b 142310 b 14
2310 b 14
Krazy Koder
 
2310 b 13
2310 b 132310 b 13
2310 b 13
Krazy Koder
 
2310 b 12
2310 b 122310 b 12
2310 b 12
Krazy Koder
 
2310 b 11
2310 b 112310 b 11
2310 b 11
Krazy Koder
 
2310 b 10
2310 b 102310 b 10
2310 b 10
Krazy Koder
 
2310 b 09
2310 b 092310 b 09
2310 b 09
Krazy Koder
 
2310 b 08
2310 b 082310 b 08
2310 b 08
Krazy Koder
 
2310 b 08
2310 b 082310 b 08
2310 b 08
Krazy Koder
 
2310 b 08
2310 b 082310 b 08
2310 b 08
Krazy Koder
 
2310 b 07
2310 b 072310 b 07
2310 b 07
Krazy Koder
 

More from Krazy Koder (20)

2310 b xd
2310 b xd2310 b xd
2310 b xd
 
2310 b xd
2310 b xd2310 b xd
2310 b xd
 
2310 b xd
2310 b xd2310 b xd
2310 b xd
 
2310 b xc
2310 b xc2310 b xc
2310 b xc
 
2310 b xb
2310 b xb2310 b xb
2310 b xb
 
2310 b 17
2310 b 172310 b 17
2310 b 17
 
2310 b 16
2310 b 162310 b 16
2310 b 16
 
2310 b 16
2310 b 162310 b 16
2310 b 16
 
2310 b 15
2310 b 152310 b 15
2310 b 15
 
2310 b 15
2310 b 152310 b 15
2310 b 15
 
2310 b 14
2310 b 142310 b 14
2310 b 14
 
2310 b 13
2310 b 132310 b 13
2310 b 13
 
2310 b 12
2310 b 122310 b 12
2310 b 12
 
2310 b 11
2310 b 112310 b 11
2310 b 11
 
2310 b 10
2310 b 102310 b 10
2310 b 10
 
2310 b 09
2310 b 092310 b 09
2310 b 09
 
2310 b 08
2310 b 082310 b 08
2310 b 08
 
2310 b 08
2310 b 082310 b 08
2310 b 08
 
2310 b 08
2310 b 082310 b 08
2310 b 08
 
2310 b 07
2310 b 072310 b 07
2310 b 07
 

Recently uploaded

GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
TIPNGVN2
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 

Recently uploaded (20)

GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 

Android service

  • 2. Topics • What is a Service? • Service lifecycles • Permissions • Local services • Remote services
  • 3. What is a Service?
  • 4. When a Service Used? • Applications will need to run processes for a long time without any intervention from the user, or very rare interventions. • These background processes need to keep running even when the phone is being used for other activities / tasks.
  • 5. Two Types of Services • Local service > Not accessible from other applications > Runs in the same process of the application that starts it • Remote service > Accessible from other applications as well > Exposes to other applications through AIDL (Android Services Definition Language)
  • 6. Service and Notification • Service is a long lived component and does not implement any user interface of its own. > Typically a user interacts with a service through an activity that has a UI. • The service “notifies” the user in case of any need for user intervention. > Through the notification (such as status bar notification), the service can give a user interface for binding to the service or viewing the status of the service or any other similar interaction with the service.
  • 7. What Facilities Service Provide? • A facility for the application to tell the system about something it wants to be doing in the background (even when the user is not directly interacting with the application). > This corresponds to calls to Context.startService(), which ask the system to schedule work for the service, to be run until the service or someone else explicitly stop it. • A facility for an application to expose some of its functionality to other applications. > This corresponds to calls to Context.bindService(), which allows a long-standing connection to be made to the service in order to interact with it.
  • 8. Binding to a Service • Once a service has begun and is running in the background, activities can “bind” to the service. > In fact, if we want to bind to a service that has not started, calling to bind could initiate the service.
  • 10. Starting a Service • If someone calls Context.startService() then the system will retrieve the service (creating it and calling its onCreate() method if needed) and then call its onStartCommand(Intent, int, int) method with the arguments supplied by the client. • The service will at this point continue running until Context.stopService() or stopSelf() is called.
  • 11. Modes of Operations • For started services, there are two additional major modes of operation they can decide to run in, depending on the value they return from onStartCommand(): > START_STICKY is used for services that are explicitly started and stopped as needed, > START_NOT_STICKY or START_REDELIVER_INTENT are used for services that should only remain running while processing any commands sent to them.
  • 12. Getting a Connection to a Service • Clients can also use Context.bindService() to obtain a persistent connection to a service. > This likewise creates the service if it is not already running (calling onCreate() while doing so), but does not call onStartCommand(). • The client will receive the IBinder object that the service returns from its onBind(Intent) method, allowing the client to then make calls back to the service.
  • 14. Permissions • Global access to a service can be enforced when it is declared in its manifest's <service> tag. • By doing so, other applications will need to declare a corresponding <uses-permission> element in their own manifest to be able to start, stop, or bind to the service. • In addition, a service can protect individual IPC calls into it with permissions, by calling the checkCallingPermission(String) method before executing the implementation of that call.
  • 16. Local Service • One of the most common uses of a Service is as a secondary component running alongside other parts of an application, in the same process as the rest of the components. > All components of an .apk run in the same process unless explicitly stated otherwise, so this is a typical situation. • When used in this way, by assuming the components are in the same process, you can greatly simplify the interaction between them > Clients of the service can simply cast the IBinder they receive from it to a concrete class published by the service.
  • 18. Remote Messenger Service • If you need to be able to write a Service that can perform complicated communication with clients in remote processes (beyond simply the use of Context.startService to send commands to it), then you can use the Messenger class instead of writing full AIDL files.