SlideShare une entreprise Scribd logo
1  sur  19
Android –
Sensor Manager
Yong Heui Cho @ Mokwon University
Some of slides are referred to:
[1] Nitin Ramchandani, Android OS, slideshare.
2
Smart Device M2M
10. Arduino+Android -
BT+IoTN
11. Arduino - Pressure Sensor
12. Android – Sensor Message
13. BT+IoTN Project - Concept
3
Application
Application Structure
Activity
Context
OS
Resources
Service
lifecycle
4
Activity Lifecycle
5
Lifecycle Comparison
Run Terminate
onCreate() onDestroy()
onStart() onStop()
onResume() onPause()
onRestart() -
onRestoreInstanceState() onSaveInstanceState()
6
Summary of Lifecycle
7
Android vs. Windows
type Android Windows
CPU optimal fast
battery small power supply
memory
mobile DRAM
small
DRAM
large
message handler
message (Message)
or action (String)
message (int)
termination app lifecycle permanent
function call call & proceed
call & wait
or call & proceed
8
MVC Components
9
Android Msg Handler
• Message: containing a description and arbitrary
data object
• Runnable: a command that can be executed
• Handler: allows you to send and process Message
and Runnable
• Looper: used to run a message loop for a thread
10
Concept of Multithread
11
Android Rules
• Do not block the UI thread (or main
thread).
• Do not access the Android UI toolkit
from outside the UI thread.
12
Event Listener
• Interface to process specific events
13
PhoneStateListner
• Monitors changes in specific telephony
states on the device, including service state,
signal strength, message waiting indicator
(voicemail).
Activity
Context
PhoneStateListener
OS
TelephonyManager
listen()
14
Broadcast Receiver
• An Intent-based publish-
subscribe mechanism.
• Great for listening system
events such as SMS messages.
□ Courtesy to Everything of Android, slideshare.
15
BR vs. Listener
type BroadcastReceiver Listener
goal class for Intents
class or interface
for Intents &
others
message
mostly global
messages
mostly specific
messages
period
discontinuous
reception
frequent (or
continuous) reception
construction
static (manifest) or
dynamic
dynamic only
16
Android & Sensors
17
Sensor Manager
• SensorManager
Context.getSystemService(SENSOR_SERVICE
)
• Sensor
SensorManager.getDefaultSensor(Sensor.TYPE
_XXX)
• SensorManager.registerListener(SEL, Sensor, int
samplingPeriodUs)
• SensorManager.unregisterListener(SEL)
18
SensorEventListener
19
Type of Sensors

Contenu connexe

Similaire à Android - Sensor Manager

Android (Speech Recognizer)
Android (Speech Recognizer)Android (Speech Recognizer)
Android (Speech Recognizer)Nilanshi Nigam
 
5945632 (1).ppt
5945632 (1).ppt5945632 (1).ppt
5945632 (1).pptRekha Negi
 
Mobile Android and Network
Mobile Android and NetworkMobile Android and Network
Mobile Android and NetworkPadma Sankar
 
Android seminar-presentation
Android seminar-presentationAndroid seminar-presentation
Android seminar-presentationconnectshilpa
 
Android - Workshop By Secure-Net Technologies
Android - Workshop By Secure-Net TechnologiesAndroid - Workshop By Secure-Net Technologies
Android - Workshop By Secure-Net TechnologiesNamita Mahajan
 
Dori waldman android _course_2
Dori waldman android _course_2Dori waldman android _course_2
Dori waldman android _course_2Dori Waldman
 
Android Programming made easy
Android Programming made easyAndroid Programming made easy
Android Programming made easyLars Vogel
 
Android Introduction
Android IntroductionAndroid Introduction
Android Introductionmehfooz7007
 
Android ak
Android akAndroid ak
Android ak88130359
 
ACADGILD:: ANDROID LESSON-How to analyze & manage memory on android like ...
ACADGILD:: ANDROID LESSON-How to analyze & manage memory on android like ...ACADGILD:: ANDROID LESSON-How to analyze & manage memory on android like ...
ACADGILD:: ANDROID LESSON-How to analyze & manage memory on android like ...Padma shree. T
 
Android overview
Android overviewAndroid overview
Android overviewHas Taiar
 
Dori waldman android _course
Dori waldman android _courseDori waldman android _course
Dori waldman android _courseDori Waldman
 
Lecture 2(b) Android Internals A Quick Overview
Lecture 2(b) Android Internals A Quick OverviewLecture 2(b) Android Internals A Quick Overview
Lecture 2(b) Android Internals A Quick OverviewAhsanul Karim
 
Introduction to Android Programming
Introduction to  Android ProgrammingIntroduction to  Android Programming
Introduction to Android ProgrammingPyingkodi Maran
 
Internet of Things - Esper
Internet of Things - EsperInternet of Things - Esper
Internet of Things - EsperTarun Vashisth
 

Similaire à Android - Sensor Manager (20)

Android (Speech Recognizer)
Android (Speech Recognizer)Android (Speech Recognizer)
Android (Speech Recognizer)
 
TSEGA (2).pptx
TSEGA (2).pptxTSEGA (2).pptx
TSEGA (2).pptx
 
5945632 (1).ppt
5945632 (1).ppt5945632 (1).ppt
5945632 (1).ppt
 
Mobile Android and Network
Mobile Android and NetworkMobile Android and Network
Mobile Android and Network
 
Android seminar-presentation
Android seminar-presentationAndroid seminar-presentation
Android seminar-presentation
 
Android - Workshop By Secure-Net Technologies
Android - Workshop By Secure-Net TechnologiesAndroid - Workshop By Secure-Net Technologies
Android - Workshop By Secure-Net Technologies
 
Dori waldman android _course_2
Dori waldman android _course_2Dori waldman android _course_2
Dori waldman android _course_2
 
Android Programming made easy
Android Programming made easyAndroid Programming made easy
Android Programming made easy
 
Android
AndroidAndroid
Android
 
Android Introduction
Android IntroductionAndroid Introduction
Android Introduction
 
Android ak
Android akAndroid ak
Android ak
 
ACADGILD:: ANDROID LESSON-How to analyze & manage memory on android like ...
ACADGILD:: ANDROID LESSON-How to analyze & manage memory on android like ...ACADGILD:: ANDROID LESSON-How to analyze & manage memory on android like ...
ACADGILD:: ANDROID LESSON-How to analyze & manage memory on android like ...
 
Android overview
Android overviewAndroid overview
Android overview
 
Unit I- ANDROID OVERVIEW.ppt
Unit I- ANDROID OVERVIEW.pptUnit I- ANDROID OVERVIEW.ppt
Unit I- ANDROID OVERVIEW.ppt
 
Android classes-in-mumbai
Android classes-in-mumbaiAndroid classes-in-mumbai
Android classes-in-mumbai
 
Dori waldman android _course
Dori waldman android _courseDori waldman android _course
Dori waldman android _course
 
Lecture 2(b) Android Internals A Quick Overview
Lecture 2(b) Android Internals A Quick OverviewLecture 2(b) Android Internals A Quick Overview
Lecture 2(b) Android Internals A Quick Overview
 
Introduction to Android Programming
Introduction to  Android ProgrammingIntroduction to  Android Programming
Introduction to Android Programming
 
Android
AndroidAndroid
Android
 
Internet of Things - Esper
Internet of Things - EsperInternet of Things - Esper
Internet of Things - Esper
 

Plus de Yong Heui Cho

Android - Sensor Manager
Android - Sensor ManagerAndroid - Sensor Manager
Android - Sensor ManagerYong Heui Cho
 
Android - Broadcast Receiver
Android - Broadcast ReceiverAndroid - Broadcast Receiver
Android - Broadcast ReceiverYong Heui Cho
 
TestBCD2018-2(answer)
TestBCD2018-2(answer)TestBCD2018-2(answer)
TestBCD2018-2(answer)Yong Heui Cho
 
TestSDS2018-2(answer)
TestSDS2018-2(answer)TestSDS2018-2(answer)
TestSDS2018-2(answer)Yong Heui Cho
 
TestEC2018-2(answer)
TestEC2018-2(answer)TestEC2018-2(answer)
TestEC2018-2(answer)Yong Heui Cho
 
TestEC2018-1(answer)
TestEC2018-1(answer)TestEC2018-1(answer)
TestEC2018-1(answer)Yong Heui Cho
 
TestBCD2018-1(answer)
TestBCD2018-1(answer)TestBCD2018-1(answer)
TestBCD2018-1(answer)Yong Heui Cho
 
TestSDS2018-1(answer)
TestSDS2018-1(answer)TestSDS2018-1(answer)
TestSDS2018-1(answer)Yong Heui Cho
 
BJT - Analysis of Bias
BJT - Analysis of BiasBJT - Analysis of Bias
BJT - Analysis of BiasYong Heui Cho
 
TestCloud2018-2(answer)
TestCloud2018-2(answer)TestCloud2018-2(answer)
TestCloud2018-2(answer)Yong Heui Cho
 
TestECD2018-1(answer)
TestECD2018-1(answer)TestECD2018-1(answer)
TestECD2018-1(answer)Yong Heui Cho
 
Test-SDIC2018-2(answer)
Test-SDIC2018-2(answer)Test-SDIC2018-2(answer)
Test-SDIC2018-2(answer)Yong Heui Cho
 
TestCloud2018-1(answer)
TestCloud2018-1(answer)TestCloud2018-1(answer)
TestCloud2018-1(answer)Yong Heui Cho
 
Test-SDIC2018-1(Answer)
Test-SDIC2018-1(Answer)Test-SDIC2018-1(Answer)
Test-SDIC2018-1(Answer)Yong Heui Cho
 
RF 증폭기 설계(Design of RF Amplifier)-rev1
RF 증폭기 설계(Design of RF Amplifier)-rev1RF 증폭기 설계(Design of RF Amplifier)-rev1
RF 증폭기 설계(Design of RF Amplifier)-rev1Yong Heui Cho
 
Computing Paradigm - rev1
Computing Paradigm - rev1Computing Paradigm - rev1
Computing Paradigm - rev1Yong Heui Cho
 
Cloud Deployment Model
Cloud Deployment ModelCloud Deployment Model
Cloud Deployment ModelYong Heui Cho
 

Plus de Yong Heui Cho (20)

Android - Sensor Manager
Android - Sensor ManagerAndroid - Sensor Manager
Android - Sensor Manager
 
Android - Broadcast Receiver
Android - Broadcast ReceiverAndroid - Broadcast Receiver
Android - Broadcast Receiver
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
Computing Paradigm
Computing ParadigmComputing Paradigm
Computing Paradigm
 
TestBCD2018-2(answer)
TestBCD2018-2(answer)TestBCD2018-2(answer)
TestBCD2018-2(answer)
 
TestSDS2018-2(answer)
TestSDS2018-2(answer)TestSDS2018-2(answer)
TestSDS2018-2(answer)
 
TestEC2018-2(answer)
TestEC2018-2(answer)TestEC2018-2(answer)
TestEC2018-2(answer)
 
TestEC2018-1(answer)
TestEC2018-1(answer)TestEC2018-1(answer)
TestEC2018-1(answer)
 
TestBCD2018-1(answer)
TestBCD2018-1(answer)TestBCD2018-1(answer)
TestBCD2018-1(answer)
 
TestSDS2018-1(answer)
TestSDS2018-1(answer)TestSDS2018-1(answer)
TestSDS2018-1(answer)
 
BJT - Analysis of Bias
BJT - Analysis of BiasBJT - Analysis of Bias
BJT - Analysis of Bias
 
TestCloud2018-2(answer)
TestCloud2018-2(answer)TestCloud2018-2(answer)
TestCloud2018-2(answer)
 
TestECD2018-1(answer)
TestECD2018-1(answer)TestECD2018-1(answer)
TestECD2018-1(answer)
 
Test-SDIC2018-2(answer)
Test-SDIC2018-2(answer)Test-SDIC2018-2(answer)
Test-SDIC2018-2(answer)
 
TestCloud2018-1(answer)
TestCloud2018-1(answer)TestCloud2018-1(answer)
TestCloud2018-1(answer)
 
Cloud Service Model
Cloud Service ModelCloud Service Model
Cloud Service Model
 
Test-SDIC2018-1(Answer)
Test-SDIC2018-1(Answer)Test-SDIC2018-1(Answer)
Test-SDIC2018-1(Answer)
 
RF 증폭기 설계(Design of RF Amplifier)-rev1
RF 증폭기 설계(Design of RF Amplifier)-rev1RF 증폭기 설계(Design of RF Amplifier)-rev1
RF 증폭기 설계(Design of RF Amplifier)-rev1
 
Computing Paradigm - rev1
Computing Paradigm - rev1Computing Paradigm - rev1
Computing Paradigm - rev1
 
Cloud Deployment Model
Cloud Deployment ModelCloud Deployment Model
Cloud Deployment Model
 

Dernier

The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 

Dernier (20)

The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 

Android - Sensor Manager