SlideShare a Scribd company logo
Android Programming
Yong Heui Cho @ Mokwon University
2
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
3
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
4
Bundle vs. Parcel
• Bundle
– A mapping from String values to various Parcelable
types
• Parcelable
– Interface for classes whose instances can be written
to and restored from a Parcel
• Parcel
– Container for a message (data and object
references) that can be sent through an IBinder
5
ContactsContract
• Contract between the contacts provider
and applications
• Context.getContentResolver()
• Cursor: interface of results for database
query
Content Provider
Contacts Provider
Activity
Context
OS
getContentResolver()
ContactsContract
6
Telephony Manager
• Access to the telephony APIs is managed by the
Telephony Manager.
– Monitor phone state
– Retrieve incoming phone numbers
– Observe changes to data connections, signal
strength, and network connectivity
7
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()
8
Incoming Phone Calls
• Service
– an application component representing either an application's desire to
perform a longer-running operation while not interacting with the user or
to supply functionality for other applications to use
• IntentFilter
– Structured description of Intent values to be matched
– Context.registerReceiver(BR, IntentFilter)
– Context.unregisterReceiver(BR)
Activity
Context
OS
Service
broadcast
Intent
BroadcastReceiver
brTx
Context
registerReceiver() with IntentFilter
9
Receiving Call
• Permission
– <uses-permission
android:name="android.permission.READ_P
HONE_STATE" />
Activity
Context
OS
Service
Intent
PhoneStateListener
rxListener
Context
TelephonyManager
listen()
10
Sending SMS
• SmsManager
– SmsManager.getDefault().sendTextMessage(phoneNum, null,
msg, piSent, piDelivered);
• PendingIntent
– a description token for a foreign application to allow the foreign
application to use our application's permissions
– Action → Intent → PendingIntent(for broadcast)
Activity
Context
BroadcastReceiver
brSend
OS
SmsManager
broadcast
BroadcastReceiver
brDeliever
registerReceiver() with IntentFilter
PendingIntent
11
Receiving SMS
• Receiving process
– Broadcast → Intent → Bundle → PDU (Object[]) →
SmsMessage → String
• Bundle: a mapping (or dictionary) class from String
key to various types
• PDU: Protocol Description Unit
Activity
Context
BroadcastReceiver
brReceive
OS
SmsManager
Intent via broadcast
registerReceiver() with IntentFilter
12
Bluetooth Setup
• BluetoothAdapter (my device)
• BluetoothDevice (partner devices)
• void onActivityResult(int requestCode, int resultCode,
Intent data)
• Parcelable Intent::getParcelableExtra(String)
Activity
Context
BroadcastReceiver
brBluetooth
My OS
BluetoothAdapter
- getDefaultAdapter()
- isEnabled()
- startDiscovery()
- cancelDiscovery()
Intent via broadcast
registerReceiver() with IntentFilter
BluetoothDevice
- getName()
- getAddress()
Partner OS
Bluetooth

More Related Content

Viewers also liked

TestSDS2016-2(Answer)
TestSDS2016-2(Answer)TestSDS2016-2(Answer)
TestSDS2016-2(Answer)
Yong Heui Cho
 
TestECD2017-1(answer)
TestECD2017-1(answer)TestECD2017-1(answer)
TestECD2017-1(answer)
Yong Heui Cho
 
ICT+UD IoT App 융합작품 개발문서(스마트디바이스구조)
ICT+UD IoT App 융합작품 개발문서(스마트디바이스구조)ICT+UD IoT App 융합작품 개발문서(스마트디바이스구조)
ICT+UD IoT App 융합작품 개발문서(스마트디바이스구조)
Yong Heui Cho
 
Android - Broadcast Receiver
Android - Broadcast ReceiverAndroid - Broadcast Receiver
Android - Broadcast Receiver
Yong Heui Cho
 
Introduction to RTOS
Introduction to RTOSIntroduction to RTOS
Introduction to RTOS
Yong Heui Cho
 
TestSDIC2017-1(answer)
TestSDIC2017-1(answer)TestSDIC2017-1(answer)
TestSDIC2017-1(answer)
Yong Heui Cho
 
Basic Android OS
Basic Android OSBasic Android OS
Basic Android OS
Yong Heui Cho
 
Introduction to IoT
Introduction to IoTIntroduction to IoT
Introduction to IoT
Yong Heui Cho
 
Android - Phone Calls
Android - Phone CallsAndroid - Phone Calls
Android - Phone Calls
Yong Heui Cho
 
스마트디바이스구조(강의계획서)2017-2
스마트디바이스구조(강의계획서)2017-2스마트디바이스구조(강의계획서)2017-2
스마트디바이스구조(강의계획서)2017-2
Yong Heui Cho
 
ICT+UD 융합작품 개발문서(전자회로설계)
ICT+UD 융합작품 개발문서(전자회로설계)ICT+UD 융합작품 개발문서(전자회로설계)
ICT+UD 융합작품 개발문서(전자회로설계)
Yong Heui Cho
 
Introduction to Smart Devices
Introduction to Smart DevicesIntroduction to Smart Devices
Introduction to Smart Devices
Yong Heui Cho
 
Smart Device RF & Antennas
Smart Device RF & AntennasSmart Device RF & Antennas
Smart Device RF & Antennas
Yong Heui Cho
 

Viewers also liked (13)

TestSDS2016-2(Answer)
TestSDS2016-2(Answer)TestSDS2016-2(Answer)
TestSDS2016-2(Answer)
 
TestECD2017-1(answer)
TestECD2017-1(answer)TestECD2017-1(answer)
TestECD2017-1(answer)
 
ICT+UD IoT App 융합작품 개발문서(스마트디바이스구조)
ICT+UD IoT App 융합작품 개발문서(스마트디바이스구조)ICT+UD IoT App 융합작품 개발문서(스마트디바이스구조)
ICT+UD IoT App 융합작품 개발문서(스마트디바이스구조)
 
Android - Broadcast Receiver
Android - Broadcast ReceiverAndroid - Broadcast Receiver
Android - Broadcast Receiver
 
Introduction to RTOS
Introduction to RTOSIntroduction to RTOS
Introduction to RTOS
 
TestSDIC2017-1(answer)
TestSDIC2017-1(answer)TestSDIC2017-1(answer)
TestSDIC2017-1(answer)
 
Basic Android OS
Basic Android OSBasic Android OS
Basic Android OS
 
Introduction to IoT
Introduction to IoTIntroduction to IoT
Introduction to IoT
 
Android - Phone Calls
Android - Phone CallsAndroid - Phone Calls
Android - Phone Calls
 
스마트디바이스구조(강의계획서)2017-2
스마트디바이스구조(강의계획서)2017-2스마트디바이스구조(강의계획서)2017-2
스마트디바이스구조(강의계획서)2017-2
 
ICT+UD 융합작품 개발문서(전자회로설계)
ICT+UD 융합작품 개발문서(전자회로설계)ICT+UD 융합작품 개발문서(전자회로설계)
ICT+UD 융합작품 개발문서(전자회로설계)
 
Introduction to Smart Devices
Introduction to Smart DevicesIntroduction to Smart Devices
Introduction to Smart Devices
 
Smart Device RF & Antennas
Smart Device RF & AntennasSmart Device RF & Antennas
Smart Device RF & Antennas
 

Similar to Android Programming

iPhone Developer Summit West
iPhone Developer Summit WestiPhone Developer Summit West
iPhone Developer Summit West
jasonc411
 
Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5
Charlin Agramonte
 
Remoting and serialization
Remoting and serializationRemoting and serialization
Remoting and serialization
Chathurangi Shyalika
 
OpenFabrics Interfaces introduction
OpenFabrics Interfaces introductionOpenFabrics Interfaces introduction
OpenFabrics Interfaces introduction
ofiwg
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
Pratik Tambekar
 
REST API
REST APIREST API
REST API
Kanushka Gayan
 
FI-WARE OAUTH-XACML-based API Access Control - Overview (Part 1)
FI-WARE OAUTH-XACML-based API Access Control - Overview (Part 1)FI-WARE OAUTH-XACML-based API Access Control - Overview (Part 1)
FI-WARE OAUTH-XACML-based API Access Control - Overview (Part 1)
cdanger
 
Subscription based control system to automate management of events for robots
Subscription based control system to automate management of events for robotsSubscription based control system to automate management of events for robots
Subscription based control system to automate management of events for robots
dbpublications
 
Aspect UIP Logical Architecture
Aspect UIP Logical ArchitectureAspect UIP Logical Architecture
Aspect UIP Logical Architecture
Vishad Garg
 
IRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce SiteIRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce Site
IRJET Journal
 
Application Programming Interface
Application Programming InterfaceApplication Programming Interface
Application Programming Interface
Seculert
 
Orion context broker webminar 2013 05-30
Orion context broker webminar 2013 05-30Orion context broker webminar 2013 05-30
Orion context broker webminar 2013 05-30Fermin Galan
 
Portlets & jsr 168
Portlets & jsr 168Portlets & jsr 168
Portlets & jsr 168
grsrkumar
 
SignalR Overview
SignalR OverviewSignalR Overview
SignalR Overview
Michael Sukachev
 
Apache Metron: Community Driven Cyber Security
Apache Metron: Community Driven Cyber Security Apache Metron: Community Driven Cyber Security
Apache Metron: Community Driven Cyber Security
DataWorks Summit/Hadoop Summit
 
Efficient Spring Data REST Development
Efficient Spring Data REST DevelopmentEfficient Spring Data REST Development
Efficient Spring Data REST Development
Catalin Tudose
 
CHP-4.pptx
CHP-4.pptxCHP-4.pptx
CHP-4.pptx
FamiDan
 

Similar to Android Programming (20)

iPhone Developer Summit West
iPhone Developer Summit WestiPhone Developer Summit West
iPhone Developer Summit West
 
Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5
 
About HTTP and REST
About HTTP and RESTAbout HTTP and REST
About HTTP and REST
 
Remoting and serialization
Remoting and serializationRemoting and serialization
Remoting and serialization
 
OpenFabrics Interfaces introduction
OpenFabrics Interfaces introductionOpenFabrics Interfaces introduction
OpenFabrics Interfaces introduction
 
Resume
ResumeResume
Resume
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
 
REST API
REST APIREST API
REST API
 
FI-WARE OAUTH-XACML-based API Access Control - Overview (Part 1)
FI-WARE OAUTH-XACML-based API Access Control - Overview (Part 1)FI-WARE OAUTH-XACML-based API Access Control - Overview (Part 1)
FI-WARE OAUTH-XACML-based API Access Control - Overview (Part 1)
 
Subscription based control system to automate management of events for robots
Subscription based control system to automate management of events for robotsSubscription based control system to automate management of events for robots
Subscription based control system to automate management of events for robots
 
Aspect UIP Logical Architecture
Aspect UIP Logical ArchitectureAspect UIP Logical Architecture
Aspect UIP Logical Architecture
 
IRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce SiteIRJET- Rest API for E-Commerce Site
IRJET- Rest API for E-Commerce Site
 
Application Programming Interface
Application Programming InterfaceApplication Programming Interface
Application Programming Interface
 
Orion context broker webminar 2013 05-30
Orion context broker webminar 2013 05-30Orion context broker webminar 2013 05-30
Orion context broker webminar 2013 05-30
 
Portlets & jsr 168
Portlets & jsr 168Portlets & jsr 168
Portlets & jsr 168
 
SignalR Overview
SignalR OverviewSignalR Overview
SignalR Overview
 
Apache Metron: Community Driven Cyber Security
Apache Metron: Community Driven Cyber Security Apache Metron: Community Driven Cyber Security
Apache Metron: Community Driven Cyber Security
 
Chapter 6-Remoting
Chapter 6-RemotingChapter 6-Remoting
Chapter 6-Remoting
 
Efficient Spring Data REST Development
Efficient Spring Data REST DevelopmentEfficient Spring Data REST Development
Efficient Spring Data REST Development
 
CHP-4.pptx
CHP-4.pptxCHP-4.pptx
CHP-4.pptx
 

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
 
Android - Message
Android - MessageAndroid - Message
Android - Message
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
 

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
 
Android - Message
Android - MessageAndroid - Message
Android - Message
 
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
 

Recently uploaded

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
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 

Recently uploaded (20)

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
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 

Android Programming

  • 1. Android Programming Yong Heui Cho @ Mokwon University
  • 2. 2 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
  • 3. 3 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
  • 4. 4 Bundle vs. Parcel • Bundle – A mapping from String values to various Parcelable types • Parcelable – Interface for classes whose instances can be written to and restored from a Parcel • Parcel – Container for a message (data and object references) that can be sent through an IBinder
  • 5. 5 ContactsContract • Contract between the contacts provider and applications • Context.getContentResolver() • Cursor: interface of results for database query Content Provider Contacts Provider Activity Context OS getContentResolver() ContactsContract
  • 6. 6 Telephony Manager • Access to the telephony APIs is managed by the Telephony Manager. – Monitor phone state – Retrieve incoming phone numbers – Observe changes to data connections, signal strength, and network connectivity
  • 7. 7 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()
  • 8. 8 Incoming Phone Calls • Service – an application component representing either an application's desire to perform a longer-running operation while not interacting with the user or to supply functionality for other applications to use • IntentFilter – Structured description of Intent values to be matched – Context.registerReceiver(BR, IntentFilter) – Context.unregisterReceiver(BR) Activity Context OS Service broadcast Intent BroadcastReceiver brTx Context registerReceiver() with IntentFilter
  • 9. 9 Receiving Call • Permission – <uses-permission android:name="android.permission.READ_P HONE_STATE" /> Activity Context OS Service Intent PhoneStateListener rxListener Context TelephonyManager listen()
  • 10. 10 Sending SMS • SmsManager – SmsManager.getDefault().sendTextMessage(phoneNum, null, msg, piSent, piDelivered); • PendingIntent – a description token for a foreign application to allow the foreign application to use our application's permissions – Action → Intent → PendingIntent(for broadcast) Activity Context BroadcastReceiver brSend OS SmsManager broadcast BroadcastReceiver brDeliever registerReceiver() with IntentFilter PendingIntent
  • 11. 11 Receiving SMS • Receiving process – Broadcast → Intent → Bundle → PDU (Object[]) → SmsMessage → String • Bundle: a mapping (or dictionary) class from String key to various types • PDU: Protocol Description Unit Activity Context BroadcastReceiver brReceive OS SmsManager Intent via broadcast registerReceiver() with IntentFilter
  • 12. 12 Bluetooth Setup • BluetoothAdapter (my device) • BluetoothDevice (partner devices) • void onActivityResult(int requestCode, int resultCode, Intent data) • Parcelable Intent::getParcelableExtra(String) Activity Context BroadcastReceiver brBluetooth My OS BluetoothAdapter - getDefaultAdapter() - isEnabled() - startDiscovery() - cancelDiscovery() Intent via broadcast registerReceiver() with IntentFilter BluetoothDevice - getName() - getAddress() Partner OS Bluetooth