SlideShare a Scribd company logo
Android –
Message
Yong Heui Cho @ Mokwon University
Some of slides are referred to:
[1] Nitin Ramchandani, Android OS, slideshare.
2
Application
Application Structure
Activity
Context
OS
Resources
Service
lifecycle
3
Application Lifecycle
I. In Android, every application runs in their
own process.
II. Processes are started or stopped as needed
to run application components.
III. A process may be killed to reclaim resources.
□ Courtesy to Nitin Ramchandani, Android OS, slideshare.
4
Activity Lifecycle (I)
5
• onCreate(Bundle): This is called when the activity first
starts up.
•onStart( ): This indicates the activity is about to be
displayed to the user.
• onResume( ): This is called when your activity can start
interacting with the user. This is a good place to start
animations and music.
• onPause( ): This runs when the activity is about to go
into the background, usually because another activity has
been launched in front of it. This is where you should save
your program’s persistent state, such as a database record
being edited.
Activity Lifecycle (II)
□ Courtesy to Nitin Ramchandani, Android OS, slideshare.
6
• onStop( ): This is called when your activity is no longer
visible to the user and it won’t be needed for a while. If
memory is tight, onStop( ) may never be called (the system
may simply terminate your process).
• onRestart( ): If this method is called, it indicates your
activity is being redisplayed to the user from a stopped state.
• onDestroy( ): This is called right before your activity is
destroyed. If memory is tight, onDestroy( ) may never be
called (the system may simply terminate your process).
Activity Lifecycle (III)
□ Courtesy to Nitin Ramchandani, Android OS, slideshare.
7
•onSaveInstanceState(Bundle): Android will call this
method to allow the activity to save per-instance state,
such as a cursor position within a text field. Usually you
won’t need to override it because the default
implementation saves the state for all your user interface
controls automatically.
• onRestoreInstanceState(Bundle): This is called when
the activity is being reinitialized from a state previously
saved by the onSaveInstanceState( ) method. The default
implementation restores the state of your user interface.
Save & Restore
□ Courtesy to Nitin Ramchandani, Android OS, slideshare.
8
Lifecycle Comparison
Run Terminate
onCreate() onDestroy()
onStart() onStop()
onResume() onPause()
onRestart() -
onRestoreInstanceState() onSaveInstanceState()
9
Summary of Lifecycle
10
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
11
MVC Components
12
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
13
Concept of Multithread
14
Android Rules
• Do not block the UI thread (or main
thread).
• Do not access the Android UI toolkit
from outside the UI thread.
15
Context
• Interface to global information about an
application environment
• Uses of context
– Creating new objects
– Accessing standard common resources
– Accessing components implicitly
Activity
Context
OS
16
Access of Context
• this
– Activity extends Context
• View.getContext()
– Context for View (usually Activity Context)
• Activity.getApplicationContext()
– Permanent Application Context
• ContextWrapper.getBaseContext()
– Access to another Context

More Related Content

Similar to Android - Message

Dori waldman android _course_2
Dori waldman android _course_2Dori waldman android _course_2
Dori waldman android _course_2
Dori Waldman
 
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
 
Unit I- ANDROID OVERVIEW.ppt
Unit I- ANDROID OVERVIEW.pptUnit I- ANDROID OVERVIEW.ppt
Unit I- ANDROID OVERVIEW.ppt
dineshkumar periyasamy
 
Android development Training Programme Day 2
Android development Training Programme Day 2Android development Training Programme Day 2
Android development Training Programme Day 2
DHIRAJ PRAVIN
 
Android - Sensor Manager
Android - Sensor ManagerAndroid - Sensor Manager
Android - Sensor Manager
Yong Heui Cho
 
[충격] 당신의 안드로이드 앱이 느린 이유가 있다??!
[충격] 당신의 안드로이드 앱이 느린 이유가 있다??![충격] 당신의 안드로이드 앱이 느린 이유가 있다??!
[충격] 당신의 안드로이드 앱이 느린 이유가 있다??!
Wooseop Kim
 
11.11.2020 - Unit 5-3 ACTIVITY, MENU AND SQLITE DATABASE.pptx
11.11.2020 - Unit 5-3  ACTIVITY, MENU AND SQLITE DATABASE.pptx11.11.2020 - Unit 5-3  ACTIVITY, MENU AND SQLITE DATABASE.pptx
11.11.2020 - Unit 5-3 ACTIVITY, MENU AND SQLITE DATABASE.pptx
MugiiiReee
 
Process Management in Android
Process Management in AndroidProcess Management in Android
Process Management in Android
Shrey Verma
 
Android Best Practices - Thoughts from the Trenches
Android Best Practices - Thoughts from the TrenchesAndroid Best Practices - Thoughts from the Trenches
Android Best Practices - Thoughts from the Trenches
Anuradha Weeraman
 
Android life cycle
Android life cycleAndroid life cycle
Android life cycle
瑋琮 林
 
Threads handlers and async task, widgets - day8
Threads   handlers and async task, widgets - day8Threads   handlers and async task, widgets - day8
Threads handlers and async task, widgets - day8
Utkarsh Mankad
 
MD-IV-CH-ppt.ppt
MD-IV-CH-ppt.pptMD-IV-CH-ppt.ppt
MD-IV-CH-ppt.ppt
bharatt7
 
04 activities and activity life cycle
04 activities and activity life cycle04 activities and activity life cycle
04 activities and activity life cycle
Sokngim Sa
 
Android activity
Android activityAndroid activity
Android activity
Krazy Koder
 
Android activity
Android activityAndroid activity
Android activity
Krazy Koder
 
Lecture 3 getting active through activities
Lecture 3 getting active through activities Lecture 3 getting active through activities
Lecture 3 getting active through activities
Ahsanul Karim
 
Android Jumpstart Jfokus
Android Jumpstart JfokusAndroid Jumpstart Jfokus
Android Jumpstart Jfokus
Lars Vogel
 
Android rest client applications-services approach @Droidcon Bucharest 2012
Android rest client applications-services approach @Droidcon Bucharest 2012Android rest client applications-services approach @Droidcon Bucharest 2012
Android rest client applications-services approach @Droidcon Bucharest 2012
Droidcon Eastern Europe
 
Android101
Android101Android101
Android101
David Marques
 
Android Activities.pdf
Android Activities.pdfAndroid Activities.pdf
Android Activities.pdf
ssusere71a07
 

Similar to Android - Message (20)

Dori waldman android _course_2
Dori waldman android _course_2Dori waldman android _course_2
Dori waldman android _course_2
 
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 ...
 
Unit I- ANDROID OVERVIEW.ppt
Unit I- ANDROID OVERVIEW.pptUnit I- ANDROID OVERVIEW.ppt
Unit I- ANDROID OVERVIEW.ppt
 
Android development Training Programme Day 2
Android development Training Programme Day 2Android development Training Programme Day 2
Android development Training Programme Day 2
 
Android - Sensor Manager
Android - Sensor ManagerAndroid - Sensor Manager
Android - Sensor Manager
 
[충격] 당신의 안드로이드 앱이 느린 이유가 있다??!
[충격] 당신의 안드로이드 앱이 느린 이유가 있다??![충격] 당신의 안드로이드 앱이 느린 이유가 있다??!
[충격] 당신의 안드로이드 앱이 느린 이유가 있다??!
 
11.11.2020 - Unit 5-3 ACTIVITY, MENU AND SQLITE DATABASE.pptx
11.11.2020 - Unit 5-3  ACTIVITY, MENU AND SQLITE DATABASE.pptx11.11.2020 - Unit 5-3  ACTIVITY, MENU AND SQLITE DATABASE.pptx
11.11.2020 - Unit 5-3 ACTIVITY, MENU AND SQLITE DATABASE.pptx
 
Process Management in Android
Process Management in AndroidProcess Management in Android
Process Management in Android
 
Android Best Practices - Thoughts from the Trenches
Android Best Practices - Thoughts from the TrenchesAndroid Best Practices - Thoughts from the Trenches
Android Best Practices - Thoughts from the Trenches
 
Android life cycle
Android life cycleAndroid life cycle
Android life cycle
 
Threads handlers and async task, widgets - day8
Threads   handlers and async task, widgets - day8Threads   handlers and async task, widgets - day8
Threads handlers and async task, widgets - day8
 
MD-IV-CH-ppt.ppt
MD-IV-CH-ppt.pptMD-IV-CH-ppt.ppt
MD-IV-CH-ppt.ppt
 
04 activities and activity life cycle
04 activities and activity life cycle04 activities and activity life cycle
04 activities and activity life cycle
 
Android activity
Android activityAndroid activity
Android activity
 
Android activity
Android activityAndroid activity
Android activity
 
Lecture 3 getting active through activities
Lecture 3 getting active through activities Lecture 3 getting active through activities
Lecture 3 getting active through activities
 
Android Jumpstart Jfokus
Android Jumpstart JfokusAndroid Jumpstart Jfokus
Android Jumpstart Jfokus
 
Android rest client applications-services approach @Droidcon Bucharest 2012
Android rest client applications-services approach @Droidcon Bucharest 2012Android rest client applications-services approach @Droidcon Bucharest 2012
Android rest client applications-services approach @Droidcon Bucharest 2012
 
Android101
Android101Android101
Android101
 
Android Activities.pdf
Android Activities.pdfAndroid Activities.pdf
Android Activities.pdf
 

More from Yong Heui Cho

Android - Sensor Manager
Android - Sensor ManagerAndroid - Sensor Manager
Android - Sensor Manager
Yong Heui Cho
 
Android - Broadcast Receiver
Android - Broadcast ReceiverAndroid - Broadcast Receiver
Android - Broadcast Receiver
Yong Heui Cho
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
Yong Heui Cho
 
Computing Paradigm
Computing ParadigmComputing Paradigm
Computing Paradigm
Yong 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 Bias
Yong 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
 
Cloud Service Model
Cloud Service ModelCloud Service Model
Cloud Service Model
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)-rev1
Yong Heui Cho
 
Computing Paradigm - rev1
Computing Paradigm - rev1Computing Paradigm - rev1
Computing Paradigm - rev1
Yong Heui Cho
 
Cloud Deployment Model
Cloud Deployment ModelCloud Deployment Model
Cloud Deployment Model
Yong Heui Cho
 

More from 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
 

Recently uploaded

Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
Yara Milbes
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
What is Master Data Management by PiLog Group
What is Master Data Management by PiLog GroupWhat is Master Data Management by PiLog Group
What is Master Data Management by PiLog Group
aymanquadri279
 
Requirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional SafetyRequirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional Safety
Ayan Halder
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 

Recently uploaded (20)

Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
What is Master Data Management by PiLog Group
What is Master Data Management by PiLog GroupWhat is Master Data Management by PiLog Group
What is Master Data Management by PiLog Group
 
Requirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional SafetyRequirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional Safety
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 

Android - Message

  • 1. Android – Message Yong Heui Cho @ Mokwon University Some of slides are referred to: [1] Nitin Ramchandani, Android OS, slideshare.
  • 3. 3 Application Lifecycle I. In Android, every application runs in their own process. II. Processes are started or stopped as needed to run application components. III. A process may be killed to reclaim resources. □ Courtesy to Nitin Ramchandani, Android OS, slideshare.
  • 5. 5 • onCreate(Bundle): This is called when the activity first starts up. •onStart( ): This indicates the activity is about to be displayed to the user. • onResume( ): This is called when your activity can start interacting with the user. This is a good place to start animations and music. • onPause( ): This runs when the activity is about to go into the background, usually because another activity has been launched in front of it. This is where you should save your program’s persistent state, such as a database record being edited. Activity Lifecycle (II) □ Courtesy to Nitin Ramchandani, Android OS, slideshare.
  • 6. 6 • onStop( ): This is called when your activity is no longer visible to the user and it won’t be needed for a while. If memory is tight, onStop( ) may never be called (the system may simply terminate your process). • onRestart( ): If this method is called, it indicates your activity is being redisplayed to the user from a stopped state. • onDestroy( ): This is called right before your activity is destroyed. If memory is tight, onDestroy( ) may never be called (the system may simply terminate your process). Activity Lifecycle (III) □ Courtesy to Nitin Ramchandani, Android OS, slideshare.
  • 7. 7 •onSaveInstanceState(Bundle): Android will call this method to allow the activity to save per-instance state, such as a cursor position within a text field. Usually you won’t need to override it because the default implementation saves the state for all your user interface controls automatically. • onRestoreInstanceState(Bundle): This is called when the activity is being reinitialized from a state previously saved by the onSaveInstanceState( ) method. The default implementation restores the state of your user interface. Save & Restore □ Courtesy to Nitin Ramchandani, Android OS, slideshare.
  • 8. 8 Lifecycle Comparison Run Terminate onCreate() onDestroy() onStart() onStop() onResume() onPause() onRestart() - onRestoreInstanceState() onSaveInstanceState()
  • 10. 10 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
  • 12. 12 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
  • 14. 14 Android Rules • Do not block the UI thread (or main thread). • Do not access the Android UI toolkit from outside the UI thread.
  • 15. 15 Context • Interface to global information about an application environment • Uses of context – Creating new objects – Accessing standard common resources – Accessing components implicitly Activity Context OS
  • 16. 16 Access of Context • this – Activity extends Context • View.getContext() – Context for View (usually Activity Context) • Activity.getApplicationContext() – Permanent Application Context • ContextWrapper.getBaseContext() – Access to another Context