售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Android Sensor Programming By Example
Android Sensor Programming By Example
Credits
About the Author
About the Reviewers
www.PacktPub.com
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Sensor Fundamentals
What are sensors?
Types of sensors
Types of sensor values
Motion, position, and environmental sensors
Motion sensors
Position sensors
Environmental sensors
Sensors' coordinate system
Android Sensor Stack
Components of the sensor framework
SensorManager
SensorEventListener
Sensor
SensorEvent
Sensor's sampling period, power, and battery consumption
The reporting modes of sensors
Dealing with specific sensor configuration
Checking the availability of the sensor at runtime
Declaring the sensor as mandatory feature
Sensor availability based on the Android API level
Best practice for accessing sensors
Summary
2. Playing with Sensors
Understanding the sensor framework callbacks
Seeing the big picture
Time for action - using sensors in the foreground activity
What just happened?
Time for action – listing the available sensors on a device
What just happened?
Time for action – knowing individual sensors' capabilities
What just happened?
Time for action – getting the sensor values and updating the user interface
What just happened?
Time for action – processing the sensor values in the background service
The phone handling algorithm
What just happened?
Summary
3. The Environmental Sensors – The Weather Utility App
The weather utility app's requirements
Understanding environmental sensors
Time for action – using the temperature sensor
What just happened?
Getting air pressure from the phone's pressure sensor
Time for action – calculating the altitude using the pressure sensor
What just happened?
Getting relative humidity from the phone's humidity sensor
Time for action - calculating the dew point and absolute humidity
What just happened?
Time for action – comparing the temperature, humidity, and pressure values from web services to phone sensors
Third-party web service – open weather map
Using Google Play Services Location API and AsyncTask
What just happened?
Summary
4. The Light and Proximity Sensors
Understanding the light and proximity sensors
The automatic torch light and screen brightness app requirements
Time for action – turning the torch light on and off using the proximity sensor
What just happened?
Time for action – adjusting the screen brightness using the light sensor
What just happened?
Wake locks, wakeup sensors, and the FIFO queue
Wakeup and non-wakeup sensors
The sensor's hardware FIFO queue
Summary
5. The Motion, Position, and Fingerprint Sensors
Understanding motion-based sensors
The accelerometer sensor
The gyroscope sensor
The gravity sensor
The linear acceleration sensor
The significant motion sensor
Understanding position-based sensors
The magnetometer sensor
The orientation sensor
The fingerprint sensor
Time for action – shake detection using the accelerometer sensor
Time for action – the compass using orientation sensor and orientation APIs
Time for action – using the fingerprint sensor
What just happened?
Summary
6. The Step Counter and Detector Sensors – The Pedometer App
The pedometer app's requirements
Understanding the step counter and step detector sensors
The step counter sensor
The step detector sensor
Time for action – using the step counter sensor in activity
Time for action – maintaining step history with the step detector sensor
What just happened?
Understanding the walking, jogging, and running signatures using the accelerometer sensor's data
The walking signature using the accelerometer sensor
The jogging or fast walking signature using the accelerometer sensor
The running signature using the accelerometer sensor
The type of step detection algorithm
Making it battery- and CPU-efficient using sensor fusion
Scope for improvement
Time for action – type of step (walking, jogging, and running) detection using the accelerometer sensor
What just happened?
Summary
7. The Google Fit Platform and APIs – The Fitness Tracker App
The Google Fit platform
Google Fitness Store
REST APIs
Android Fitness APIs
Sensors API
Recording API
History API
Sessions API
Bluetooth Low Energy API
Config API
Platform basics
Data sources
Data types
Data point
Data set
Authorization and permission scopes
Registration with the Google developer console
Authorization from a user in the application
Fitness scopes
Installing and running time permissions
Fitness tracker app using fitness APIs
Fitness tracker application requirements and architecture
Time for action – working with live fitness data using the Sensors API
What just happened?
Time for action – recording fitness data in background using Recording API
What just happened?
Time for action – getting history fitness data using the History API
What just happened?
Asynchronous versus synchronous results callback
Summary
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜