Reputation: 7577
For some reason Android Studio doesn't find the new camera library: android.hardware.camera2
Do you have any suggestions? The code looks like this:
Upvotes: 3
Views: 4552
Reputation: 88
import android.hardware.camera2.*;
is different from
Camera camera; //this one uses android.hardware.Camera.*;
see the android.hardware.Camera and android.hardware.camera2 documentation.
This is some example classes available on camera2 to be used on the new API 21+
import android.hardware.camera2.CameraAccessException;
import android.hardware.camera2.CameraCaptureSession;
import android.hardware.camera2.CameraCharacteristics;
import android.hardware.camera2.CameraDevice;
import android.hardware.camera2.CameraManager;
import android.hardware.camera2.CameraMetadata;
import android.hardware.camera2.CaptureRequest;
import android.hardware.camera2.TotalCaptureResult;
import android.hardware.camera2.params.StreamConfigurationMap;
Upvotes: 0
Reputation: 179
There is no Camera class in new package for Camera i.e. android.hardware.camera2. To use Camera class use the deprecated package android.hardware.Camera.
Upvotes: 0