Android camera2 API - Part 5 Setting up background thread handler

Publié le: 30 août 2015
sur la chaîne: Mobile Application Tutorials
7,754
61

Please note that I don't respond to questions on the youtube channel but for those that require help I provide paid consultancy services here https://www.codementor.io/mobapptuts

Part 5 of the camera2 API tutorial series which concentrates on creating the background thread handler for the android camera2 api sessions & callbacks as well as closing resources when the application is closed.

For more info checkout -

Part 1 Look & Feel -    • How to use android camera 2 API's - P...  
Part 2 Surface preview sizes -    • How to use android camera2 API's - Pa...  
Part 3 Surface preview session -    • Android camera2 API - Part 3 How to o...  
Part 4 Starting camera preview -    • Android camera2 API - Part 4 Starting...  

The first part of this tutorial focuses on closing the resources when the application is closed. Care needs to be taken that the CaptureSession & CameraDevice are closed.
Then two activity members are created for the Handler & HandlerThread.
Then two methods are required for creation & closing of the handler.
Once the handler has been created it is made available to the openCamera & createSession methods so that their callbacks will execute on the background thread handler. Removing unnecessary processing on the UI thread.

API's covered:
HandlerThread
HandlerThread.quitSafely
HandlerThread.join
Handler
CameraManager.openCamera
CameraCaptureSession.close
CameraCaptureSession.setRepeatingRequest
CameraDevice.close

Android studio (1.3.1) is the editor of choice (IDE) for this tutorial series.

This tutorial series is the start of what I expect to be many so I encourage comments and feedback to improve the quality and viewing experience.


Sur cette page du site, vous pouvez voir la vidéo en ligne Android camera2 API - Part 5 Setting up background thread handler durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Mobile Application Tutorials 30 août 2015, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 7,754 fois et il a aimé 61 téléspectateurs. Bon visionnage!