Android specifics
In this section, we'll look at some Android-specific tasks: one is rendering an overlay on top of the camera view and the second is reading media files on Android.
The overlay is helpful for general information and debugging, and looks nice too! Think of it like the heads up display on a consumer camera.
The reading media files section is something we don't use in this chapter (we read media files using Python). However, if you decide to write an Android app that processes videos on the device itself, this section should get you started.
Threaded overlay
Now that we have the camera preview working, we want to render some additional information on top of it. We'll be drawing three things; first, a red circle to indicate whether recording is active, second, the current gyroscope values (angular velocity and estimated theta) just for information, and third, a safety rectangle. When stabilizing, we'll probably be cropping the image a bit. The rectangle will guide your video recording...