The camera2 API enabling is quite necessary when you want to download the google camera port over your smartphone devices. In general, those ports will improve the overall camera quality and render amazing photos and videos without much hassle.
However, when you have checked the camera API function of your phone, and disappointingly find out that your phone doesn’t support those APIs.
Then the final option left for you is to get that application programming interface by flashing custom recovery or rooting your android phone.
In this post, we will cover different methods by which you can easily enable Camera2 API on your phone with no issue.
But before we get started, let’s know a bit about the following terms if you heard them for the first time.
- 1 What is Camera2 API?
- 2 Methods To Enable Camera2 API
- 3 Can I enable the Camera2 API functions without Root Permission?
- 4 Access Camera2API without Root
- 5 How to Restore Camera2 API as before?
- 6 Conclusion
What is Camera2 API?
In older android phones, you will generally obtain the camera API that might not be that great. But Google releases the Camera2 API in the Android 5.0 lollipop. It is a better program that offers a wide range of attributes that further helps in boosting the overall camera quality of the phones.
This feature grants better HDR+ results and adds up wonderful attributes to click low-light photos with the aid of advanced software.
For more information, we would recommend you check out the official page.
- In general, all of the following methods will require root access.
- Access Developer Settings to enable USB debugging.
- Necessary ADB drivers are required to be installed on the PC/Laptop
- Get the correct version of the TWRP custom recovery according to your phone.
Note: There are various methods to root your phone, but we would recommend you download magisk for stable configuration.
Methods To Enable Camera2 API
Some smartphone makers, such as Realme, provide Camera HAL3 in additional settings for utilizing 3rd party camera apps, which can be accessed after enabling the developer mode.
(Only applicable in the Realme phones that got Android 11 or above update). But that’s not the case for many smartphones. In that case, you can follow up the subsequent methods:
1. Using Terminal Emulator App (Root)
- First, access the Terminal Emulator app.
- To give root access, type
suand press Enter.
- Input the first command –
setprop persist.camera.HAL3.enabled 1and press enter.
- Insert the next command –
setprop vendor.persist.camera.HAL3.enabled 1and press enter.
- Next, reboot the phone.
2. Using X-plore application (Root)
- Download and install the X-plore File Manager to access the system/root folder.
- Then, you have to access the system/build.prop folder.
- Click on the Build.prop to edit that script.
- Add – “persist.camera.HAL3.enabled = 1″ at the bottom.
- Afterward, you have to reboot your smartphone.
3. Via Magisk Modules Library (Root)
There are numerous benefits of rooting with magisk, one of them is that you will get modules directory access.
- First of all, download Module-Camera2API-Enabeler.zip from the module library.
- Next, you have to install that respective zip in the magisk manager.
- Restart your device to activate the camera API module.
4. Flashing zip file through TWRP (Root or Not Root)
- Download the necessary Camera2API zip file.
- Boot the phone into the TWRP custom recovery.
- Navigate to the zip file location and click on it.
- Flash the Camera2API.zip file on the smartphone.
- Finally, reboot the device as usual to get results.
Can I enable the Camera2 API functions without Root Permission?
You will need root access to unlock the camera2API since most often those files can be obtained when the device has complete root permission.
But, if you want to access the API functions and have a lot of time, we recommend you follow the subsequent guide.
Access Camera2API without Root
Here, you will receive the entire process of getting those camera API files without modifying the system files. With that said, let’s get started with the primary requirements for the procedure.
Things that are needed before the process.
- Ensure that the android device has an unlocked bootloader.
- Enable USB debugging via developer mode.
- PC or laptop is recommended for running Windows 7, 8, 10, or 11.
- A USB cable to interlink the phone and computer.
- Download the TWRP file for your smartphone
- ADB Driver.zip and minimal_adb_fastboot.zip
Step 1: Create a Complete Setup
- Install the ADB driver.zip on your computer.
- Next, you will need to extract the minimal_adb_fastboot.zip file
- Rename the downloaded TWRP file to recovery.img and move it to the minimal fastboot zip folder.
- Use the cable bundle to connect the PC to the phone.
Step 2: Run the Command Prompt
- First of all, double-click on the cmd-here.exe in the minimal zip folder.
- Enter the command to see if the device is connected or not –
adb devicesand Enter.
- Next, type the command –
adb reboot bootloaderand press Enter to access the boot mode.
- Enter the next command –
fastboot boot recovery.imgand hit Enter on the keyboard to open the TWRP mode.
Step 3: Use TWRP Mode for Modification
- Once you have entered those commands, wait for a moment.
- You will notice that the TWRP custom recovery mode is activated on your phone screen.
- Swipe the key that said, “Swipe to Allow Modifications”.
- Now, come back to the computer/laptop screen.
Step 4: Enter Second-phase Commands
- Again, type
adb devicesand enter to see if the device connects or not.
- Then, you have to type the
adb shellcommand and add
- To activate Camera2API, use the command –
setprop persist. camera.HAL3.enable 1and press enter.
- Enter the command –
exitto come out from the ADB shell section.
- Finally, use
adb rebootand press enter to restart the device normally.
How to Restore Camera2 API as before?
You have to repeat the whole process from Step 4 like you have installed the Camera API in the above section.
- All you need to do is replace the
setprop persist. camera.HAL3.enable 1to
setprop persist. camera.HAL3.enable 0to switch off the camera API overwrite.
- Type the exit command –
exitand hit Enter
- Lastly, type –
adb rebootto normally restart the phone.
Note: You don’t install TWRP so you won’t face any trouble getting updates. Plus, the Camera2API will return to normal if you apply the OTA update. Moreover, you can check manual camera compatibility to confirm the changes.
Long story short, the best way to get access to the Camera2API is possible with the root permission and TWRP configuration. Once you are done with the process, you can easily install the GCam application on your android device without much hassle.
On the other hand, if you have questions regarding activating the camera2 API, share your comment in the following section.