Find the Normal Mode images using Huawei Camera Engine in Android (Kotlin)

Murali Akula
4 min readDec 16, 2021

--

Introduction

In this article, we can learn about the Normal Mode type images captured by Huawei Camera Engine. This mode supports the general capabilities which are included but not limited to Flash, color modes, face/smile detection, filter and master AI.

What is Camera Engine?

Huawei Camera Engine provides a set of advanced programming APIs for you to integrate powerful image processing capabilities of Huawei phone cameras into your apps. Camera features such as wide aperture, Portrait mode, HDR, background blur and Super Night mode can help your users to shoot stunning images and vivid videos anytime and anywhere.

Requirements

1. Any operating system (MacOS, Linux and Windows).

2. Must have a laptop or desktop with Android Studio V3.0.1, Jdk 1.8, SDK platform 26 and Gradle 4.6 and later installed.

3. Minimum API Level 28 is required.

4. Required EMUI 10.0 and later version devices.

5. A Huawei phone with processor not lower than 980.

How to integrate HMS Dependencies

1. First register as Huawei developer and complete identity verification in Huawei developers website, refer to register a Huawei ID.

2. Create a project in android studio, refer Creating an Android Studio Project.

3. Generate a SHA-256 certificate fingerprint.

4. To generate SHA-256 certificate fingerprint. On right-upper corner of android project click Gradle, choose Project Name > Tasks > android, and then click signingReport, as follows.

Note: Project Name depends on the user created name.

5. Create an App in AppGallery Connect.

6. Download the agconnect-services.json file from App information, copy and paste in android Project under app directory, as follows.

7. Enter SHA-256 certificate fingerprint and click Save, as follows.

Note: Above steps from Step 1 to 7 is common for all Huawei Kits.

8. Add the below maven URL in build.gradle(Project) file under the repositories of buildscript, dependencies and allprojects, refer Add Configuration.

9. Add the below plugin and dependencies in build.gradle(Module) file.

10. Now Sync the gradle.

11. Add the required permission to the AndroidManifest.xml file.

Let us move to development

I have created a project on Android studio with empty activity let’s start coding.

In the MainActivity.kt we can find the business logic.

Create AutoFitTextureView.kt class to find auto texture view.

Create PermissionHelper.kt class to find permissions.

In the activity_main.xml we can create the UI screen.

In the item.xml we can create the UI screen.

Demo

Tips and Tricks

1. Make sure you are already registered as Huawei developer.

2. Set minSDK version to 28 or later, otherwise you will get AndriodManifest merge issue.

3. Make sure you have added the agconnect-services.json file to app folder.

4. Make sure you have added SHA-256 fingerprint without fail.

5. Make sure all the dependencies are added properly.

Conclusion

In this article, we have learnt about the Normal Mode type images captured by Huawei Camera Engine. This mode supports the general capabilities which are included but not limited to Flash, color modes, face/smile detection, filter and master AI.

I hope you have read this article. If you found it is helpful, please provide likes and comments.

Reference

Camera Engine

--

--

No responses yet