What just happened?

We just created three small applications using three different sensors. The first one detects physical shakes using the accelerometer sensor, the second one tells the earth's magnetic direction using the orientation sensor, and the third one uses the fingerprint sensor to authenticate the user. A few important points to note are that the orientation sensor has been deprecated, so in place of it we should use the getRotationMatrix()and getOrientation() APIs to get the orientation values. Fingerprint APIs were introduced in Android Marshmallow (API Level 23), which uses both runtime and install time permissions. Thus, to use the fingerprint sensor, we should include both runtime and install time permissions.

Get Android Sensor Programming By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.