Lecture 10:
Hardware, Services,
Odds and Ends
HW 9 Recap
Course Evaluation:
goo.gl/4FzL89
https://uw.iasystem.org/survey/167482
Things to think about
Questions on anything so far?
Odd and End: Demo
WebView
addJavaScriptInterface adds Java object for JS
Why would you do this?
Hardware
Accessing Hardware
Access methods and API varies
Almost all are system services
Network
Non-network hardware
Vibrator: Cause the phone to vibrate
Accelerometer
Services (android.app.Service)
Service Basics
When to use a Service?
Using a Service: 2 options
Using via startService()
Using via bindService()
Creating a Service
Service Lifecycle
Bound Service Lifecycle
Creating unbound Service
Subclassing IntentService
Creating bound Service
Ways to bind a Service
Extending Binder
Working with AIDL
Example of AIDL
HW 10: be free