How Do You Enable Camera2 Api on Any Android Device?
If you want to install the Google Camera port on your Android device, enabling the Camera2 API is essential. This API upgrade can significantly enhance your camera’s performance, allowing you to capture stunning photos and videos effortlessly.
But what if your phone doesn’t support the Camera2 API by default? Don’t worry, we’ve got you covered. This guide will walk you through various methods to enable the Camera2 API, ensuring your phone can take full advantage of advanced camera features.
Before we dive in, let’s clarify some key terms and prerequisites.
Understanding Camera2 API
Older Android devices come with basic camera APIs that may not deliver the best results. To address this, Google introduced the Camera2 API with Android 5.0 Lollipop. This API offers a range of features designed to improve camera performance, including better HDR+ capabilities and enhanced low-light photography.
For more details, you can visit the official page.
Prerequisites
Before you start, ensure you have the following:
- Root access on your device
- Developer settings enabled with USB debugging
- Necessary ADB drivers installed on your PC or laptop
- The correct version of TWRP custom recovery for your phone
Note: While there are various ways to root your phone, we recommend using Magisk for a stable setup.
Methods to Enable Camera2 API
Some smartphones, like those from Realme running Android 11 or higher, have Camera HAL3 settings that allow the use of third-party camera apps. For other devices, follow these methods:
Method 1: Using Terminal Emulator App (Root Required)
- Open the Terminal Emulator app.
- Grant root access by typing
su
and pressing Enter. - Enter the command
setprop persist.camera.HAL3.enabled 1
and press Enter. - Enter the command
setprop vendor.persist.camera.HAL3.enabled 1
and press Enter. - Reboot your phone.
Method 2: Using X-plore File Manager (Root Required)
- Install the X-plore File Manager app.
- Navigate to the system/build.prop file.
- Edit the file and add
persist.camera.HAL3.enabled=1
at the bottom. - Reboot your phone.
Method 3: Via Magisk Modules Library (Root Required)
- Download the
Module-Camera2API-Enabler.zip
from the Magisk module library. - Install the ZIP file using the Magisk Manager.
- Restart your device to enable the Camera2 API module.
Method 4: Flashing ZIP File through TWRP (Root or No Root)
- Download the necessary Camera2API ZIP file.
- Boot your phone into TWRP custom recovery.
- Locate and flash the ZIP file.
- Reboot your device.
Enabling Camera2 API Without Root Access
Though rare, it is possible to enable Camera2 API without root access. Here’s how:
Requirements
- Unlocked bootloader
- USB debugging enabled
- A PC or laptop (Windows 7, 8, 10, or 11)
- A USB cable
- TWRP file for your smartphone
- ADB Driver.zip and minimal_adb_fastboot.zip
Step-by-Step Guide
Step 1: Setup
- Install the ADB drivers on your PC.
- Extract the
minimal_adb_fastboot.zip
. - Rename the TWRP file to
recovery.img
and move it to the minimal fastboot folder. - Connect your phone to your PC using the USB cable.
Step 2: Command Prompt
- Open the
cmd-here.exe
in the minimal fastboot folder. - Enter
adb devices
to check the connection. - Enter
adb reboot bootloader
to access boot mode. - Enter
fastboot boot recovery.img
to open TWRP mode.
Step 3: TWRP Mode
- Once in TWRP, swipe to allow modifications.
- On your PC, enter
adb devices
again to ensure the device is connected. - Enter
adb shell
. - To enable Camera2 API, enter
setprop persist.camera.HAL3.enable 1
. - Exit the shell with
exit
. - Reboot your device with
adb reboot
.
Restoring Camera2 API to Default
To revert the Camera2 API changes, follow the steps above but use setprop persist.camera.HAL3.enable 0
in place of setprop persist.camera.HAL3.enable 1
.
Conclusion
Enabling the Camera2 API can significantly enhance your Android device’s camera performance. While the process often requires root access and TWRP, it’s a manageable task that brings noticeable improvements. Once completed, you’ll be ready to install the Google Camera app and enjoy superior photo quality.