Google camera port or the Gcam is something that has more or less taken over the stock camera on most smartphones. Yes, these are not the official replacements for the stock camera applications provided by the OEMs. However, the development of the Google Camera Port or the Gcam provides better image processing capabilities as compared to the stock camera application. In this post, we will share a guide on how to enable Camera2 API persistently on Xiaomi Mi A2 Lite and keep the bootloader locked. This means that this procedure does not require access to your device’s system partition or have an unlocked bootloader.
Gcam is available for most smartphones and with passing time, new features are also being added like the Night Sight mode, HDR+, etc. These features allow us to take advantage of the Google Pixel camera, which is the best smartphone camera, period. Besides, it also gives us an idea of how the image processing capabilities can change the quality of the image taken from a smartphone. Xiaomi is known for providing powerful specs at a fairly low price as compared to others, however, the quality of the camera is still debatable. Moreover, Xiaomi devices were or at present, not known for their camera performance. But, you can take advantage of the Gcam or the Google camera port and install then on your Xiaomi device and improve the image-taking experience. So, without any further ado, let us get straight into the article itself;
What is Camera2 API?
Now, if you are a fan of Gcam or the Google Camera Port then, you need to enable the Camera2 API on your device. Almost all the OEMs have the Camera2 API enabled on their smartphones. However, even though the Xiaomi phones run on stock Android, the Xiaomi Mi A2 Lite does not support the Camera2 API. And, in order to install and run the Gcam or the Google camera port on the Xiaomi Mi A2 Lite smartphone, you need to enable the Camera2 API.
Moreover, it is pretty easy to enable the Camera2 API on the Xiaomi device if you have a rooted device but, in this post, we will guide you how to enable Camera2 API on the Xiaomi Mi A2 Lite device without needing an unlocked bootloader. But, keep in mind that you need to have temporary root access to your device in order to enable the Camera2 API on the Xiaomi Mi A2 Lite. For those, who did not understand what is temporary access to root, please follow this guide and you will be able to enable the Camera2 API pretty easily.
Advantages and Disadvantages of this method
- This mod does not touch your system partition which means, you can install OTAs without doing anything
- This mod does not require a modified boot partition and you can keep your bootloader locked
- The Camera2 API will still be enabled after OTAs
- Note that it still needs a temporary root access
- If you are not careful with the temporarily unlock procedure, all your data will be lost
- Patched Boot Image V10.0.12.0 – July
- ADB and Fastboot tools for Windows
- Magisk Manager APK
- Gcam for the Xiaomi Mi A2 Lite
Steps to Enable Camera2 API Persistently on Xiaomi Mi A2 Lite
- Firstly, download and install the ADB and Fastboot tools from the above download section on your PC.
- Now, download the Patched Boot image file from the download section above and extract it.
- You need to enable the Developer Options on your Xiaomi Mi A2 device. To do this, go to Settings>>System>>About Phone>>tap 7 times on the Build Number till you see a toast message “You are now a developer”.
- Connect your device to the PC and give your PC the permission to ADB.
- Now, turn OFF your device.
- Reboot the device by pressing the Power + Volume Down button combination.
- You need to copy the contents of the Patched Boot image to the folder where you have extracted the ADB and Fastboot tools.
- Open a command prompt and run the below command;
fastboot oem unlock
fastboot boot patched_boot_file_name.img
(make sure to change the “patched_boot_file_name.img” with the actual name of the patched boot image file)
- Download the Magisk Manager APK from the download section above. You just need to directly install the application on your Xiaomi Mi A2 Lite device.
- Now, on the command prompt, enter the below commands to enable the Camera2 API;
setprop persist.camera.HAL3.enabled 1
setprop persist.camera.eis.enabled 1
- Once you have entered the above-mentioned commands one by one, then just turn OFF your device.
- Now, you need to Reboot your device by pressing the Power + Volume Down buttons together. Keep pressing the button while your device is rebooting.
- Now, again on the command prompt, run the below commands (keep pressing the Volume down button);
fastboot oem unlock
- Then release the Volume down button while the phone reboots.
- Download the Gcam from the above download link.
- Open the Gcam application. Now, to fix the front camera issue in the Gcam, you need to enable “camera.enable_hwhdr” from the Developer Settings.
That’s it! you have enabled the Camera2 API on your Xiaomi Mi A2 Lite smartphone. If your device gets detected in the ADB but not in Fastboot then, reboot in Fastboot mode, open device manager and search for the android device and hit update drivers.
Below are the recommended settings that you can use the Google camera port or Gcam port;
Go to Settings>>Advanced:
- Interface Style: Pixel 3
- Config: Auto
- Back Camera: Pixel 3 XL
- Front Camera: Nexus 6P
- Libs: Stock by Eszdman v3
Quick Specs Review of the Xiaomi Mi A2 Lite
The Xiaomi Mi A2 Lite smartphone is powered by the Qualcomm Snapdragon 625 2.0 GHz processor which is paired with 3/4 GB of RAM. It runs on the latest Android 9 Pie and has Adreno 506 GPU. The device comes with 32/64GB of internal storage. Moreover, the device also offers to expand the storage capacity to 256GB via a microSD card. In the front, the device has a Full HD+ LCD 5.84-inch display with a notch. It packs a resolution of 1080×2280 and with 432 PPI.
The device sport a dual-camera set-up at the back with 12MP (f/12.2)+ 5MP (depth sensor) shooters. And, in the front, you get a single 5MP camera with an f/2.0 aperture. Some of the features of the camera of Xiaomi Mi A2 Lite are AI Portrait mode, Depth Mode, Beautify 4.0, and face recognition as well. Moreover, the device has a back-mounted fingerprint sensor. The Xiaomi Mi A2 Lite packs a battery capacity of 4000mAh.
So, there you have it from my side in this post. Hope you guys were successful in enabling the Camera2 API on the Xiaomi Mi A2 Lite smartphone. Let us know in the comments below if you faced any difficulties or issues while following any of the above-mentioend steps. Until the next post…Cheers!