Skip to content

weichen2046/CameraDemoForAndroidThings

Repository files navigation

CameraDemoForAndroidThings

Camera demo for android things, current support capture still picture, camera preview as well as capture still picture while preview is on-going.

Schematics

Camera demo for android things

Camera preview support

Key process of setup camera preview extract from example Android Camera2 Example.

In order to support camera preview, you should enable hardware acceleration for your Activity or Application. More information about hardware acceleration, please refer to Android Things Realse Notes and Android Hardware Acceleration.

Take still picture while preview is on-going will close the preview capture session first and renew a preview capture session after picture is taken. This is because V4L2 only supports 1 stream configuration at a time, so we can not pass more than one Surface like ImageReader.getSurface() when we call CameraDevice.createCaptureSession(...).

Capture still picutre support

Key process of capture still picture extract from example Doorbell.

Details

We have two buttons for difference purpose.

In MainActivity:

  • Button A: start TakePictureActivity
  • Button B: start CameraPreviewActivity

In TakePictureActivity:

  • Button A: trigger take still picture
  • Button B: return to MainActivity

In CameraPreviewActivity:

  • Button A: trigger take still picture while preview is on-going
  • Button B: return to MainActivity

Releases

No releases published

Packages

No packages published

Languages