Should I import android.graphics.camera or android.hardware.camera?

I am running an Android camera app for shooting. When I ctrl-shift-O to get import for the Camera class, there are two options: android.graphics.camera and android.hardware.camera. Which one should be used and what are the main differences?

+7
java android camera
source share
3 answers

android.graphics.camera seems to have only image processing functions for 3D transformations, whereas android.hardware.camera is much more comprehensive and has actual support for camera functions.

You definitely want to use android.hardware.camera . Full usage information here .

+16
source share

Not too sure about android.graphics.camera, but andrioid.hardware.camera is what you are looking for.

"The Camera class is used to configure image capture, preview / pause, snapshots and retrieve frames for encoding for video. This class is a client of the Camera service that manages the actual camera hardware."

After further research ...

"The Camera class in the android.graphic package is very different, it is used to calculate 3D transformations, which can then be applied to the animation."

+5
source share

graphics.Camera is just a "virtual camera" in 3D scenes. Its position determines how the scene will look from a certain angle.

+2
source share

All Articles