android-Camera2Basic | Migrated : - This repo has been migrated to github

 by   googlearchive Java Version: Current License: Apache-2.0

kandi X-RAY | android-Camera2Basic Summary

kandi X-RAY | android-Camera2Basic Summary

android-Camera2Basic is a Java library.,roid-Camera2Basic has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has medium support. You can download it from GitHub.

This repo has been migrated to [][1]. Please check that repo for future updates. Thank you!.

            kandi-support Support

              android-Camera2Basic has a medium active ecosystem.
              It has 2843 star(s) with 1557 fork(s). There are 164 watchers for this library.
              It had no major release in the last 6 months.
              There are 0 open issues and 132 have been closed. On average issues are closed in 1274 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of android-Camera2Basic is current.

            kandi-Quality Quality

              android-Camera2Basic has 0 bugs and 0 code smells.

            kandi-Security Security

              android-Camera2Basic has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              android-Camera2Basic code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              android-Camera2Basic is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              android-Camera2Basic releases are not available. You will need to build from source code and install.
              Build file is available. You can build the component from source.
              android-Camera2Basic saves you 821 person hours of effort in developing the same functionality from scratch.
              It has 1885 lines of code, 86 functions and 37 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed android-Camera2Basic and discovered the below as its top functions. This is intended to give you an instant insight into android-Camera2Basic implemented functionality, and help decide if they suit your requirements.
            • Captures a still picture
            • Release the camera focus
            • Shows a toast on the UI thread
            • Set auto - flash mode on the request
            • Resume the view
            • Returns the optimal size of the supported sizes
            • Configures the required transformation to render the view
            • Sets up member variables related to camera data
            • Closes the camera
            • Stops the active background thread
            • Closes the current camera
            • Click the view
            • Takes a screenshot of an image
            • Locks the camera
            • This method is called when the camera is created
            • Construct a new instance of Camera2BasicFragment
            • Run the precapture sequence
            • Creates a new camera capture session
            • Region > measure
            • Called when view is created
            • Create image file
            • Show error dialog
            • On create view
            Get all kandi verified functions for this library.

            android-Camera2Basic Key Features

            No Key Features are available at this moment for android-Camera2Basic.

            android-Camera2Basic Examples and Code Snippets

            No Code Snippets are available at this moment for android-Camera2Basic.

            Community Discussions


            Camera2 API access synchronization
            Asked 2020-Sep-22 at 22:35

            Camera2 API allows us to specify the thread (passing the Handler instance) on which we recieve the callbacks containing CameraDevice, CameraCaptureSession, CaptureResult etc. We use the information from these callbacks to configure capture session, create capture requests and obtain capture results. However, when the user controls the camera configuration (e.g. focusing, metering) through the UI, he makes it from the main thread. Here we, developers, have two options:

            1. Use the Camera2 API calls (e.g. CameraCaptureSession.capture) "directly" from any thread (including main thread). Here we need to manage the session state and syncrhonize access to the Camera2 API.
            2. Move all Camera2 API calls to the "CameraThread". Send the message to the "CameraThread" using Handler whenever we need access to Camera2 API. So we will actually use it only from the single thread ("CameraThread").

            Please, let me clarify what I mean. Suppose that we created HandlerThread for Camera2 API callbacks.



            Answered 2020-Sep-22 at 22:35

            They're both viable. "Better" depends on a bunch of factors such as the size of the codebase, and how many different places in the code will be wanting to use the session and device.

            There's some minor overhead in sending the callback to the camera handler thread, plus more boilerplate to write, so for smaller apps, just making calls from whatever thread you're in and synchronizing appropriately works fine.

            However, as your app's complexity grows, it starts becoming attractive to keep all interaction with the camera API to a single thread; not just because you don't have to synchronize explicitly, but because it's easier to reason about ownership, the state of the system, and so on, if every interaction with the camera object happens on the same thread. Also, since some of the camera API methods can block for extended time periods, you really don't want to freeze your UI for that long anyway. So sending the calls to another thread is valuable.

            So it's a tradeoff of some extra boilerplate + minor overhead vs. inability to centralize camera code in one place for simplicity and smoothness.



            Getting relative rotation from the camera sensor to the current device orientation
            Asked 2020-Jul-31 at 07:19

            There are a couple of samples to get the relative rotation from the camera sensor to the current device orientation, e.g. for using it for correcting camera preview or for MediaRecorder.setOrientationHint(int)

            But the newest method from the latest official github camera samples works different than older methods (for deprecated camera2 API and method from archived camera2 sample)

            Here's my sample code that uses all methods and logs all results, we can see that function computeRelativeRotationCamera2New returns different result for Surface.ROTATION_90 and Surface.ROTATION_270 display rotation

            So what is the correct method to do it?



            Answered 2020-Jul-31 at 07:19

            Tested recorded videos with different methods and found out that the newest method from the latest sample is incorrect for landscape video recording, it plays videos upside down

            I decided to update old method that uses deprecated camera api to use camera2 api (works for 21+ API) and use it in my project


            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install android-Camera2Basic

            You can download it from GitHub.
            You can use android-Camera2Basic like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the android-Camera2Basic component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer For Gradle installation, please refer .


            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • HTTPS


          • CLI

            gh repo clone googlearchive/android-Camera2Basic

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular Java Libraries


            by CyC2018


            by Snailclimb


            by MisterBooo


            by spring-projects

            Try Top Libraries by googlearchive


            by googlearchiveJavaScript


            by googlearchiveJava


            by googlearchiveJavaScript


            by googlearchiveJava