Beginner: Integration of Huawei AR Engine Face Service in Android App

Sunaij Iqbal
3 min readJul 18, 2023

--

Introduction

AR transforms volumes of data and analytics into images or animations that are overlaid on the real world. Today most AR applications are delivered through mobile devices, but increasingly delivery will shift to hands-free wearables such as head-mounted displays or smart glasses. Though many people are familiar with simple AR entertainment applications, such as Snapchat filters and the game Pokémon Go, AR is being applied in far more consequential ways in both consumer and business-to-business settings.

Huawei AR Engine is an engine for building augmented reality (AR) apps for Android smartphones. It integrates AR core algorithms to provide basic AR features including Body (human skeleton tracking), Face (face tracking), Hand (hand tracking), World (plane display), and Health (health check through facial recognition).

In this article, I will explain the integration of AR Engine Face service.

AR Engine supports the recognition of 64 types of facial expressions, encompassing the eyes, eyebrows, eyeballs, mouth, and tongue.

Supported Devices

Create Project in Huawei Developer Console

Before you start developing an app, configure app information in AppGallery Connect.

  1. We need to register as a developer account in AppGallery Connect
  2. Create an app by referring to Creating a Project and Creating an App in the Project
  3. Set the data storage location based on current location.
  4. Generating a Signing Certificate Fingerprint.
  5. Configuring the Signing Certificate Fingerprint.
  6. Get your agconnect-services.json file to the app root directory.

You need to add OpenGL to graphic rendering and the HUAWEI AR Engine SDK dependencies to your app level build.gradle.

To using the camera, you need to add camera permission in your AndroidManifest.xml file.

AR Engine Process

Before enter to the development we should know the general process of using the HUAWEI AR Engine SDK. The following figure shows the general process of Huawei AR Engine.

Development

CameraController.kt

FaceRenderController.kt

FaceActivity.kt

Tips and Tricks

1. Set minSdkVersion to 24 or higher.

2. Check weather device supports AR Engine service or not.

3. Once work done need to unregister the DisplayListener service.

Conclusion

This article will help you to learned the integration of AR Engine Face service. It provides this capability in order to track and obtain facial image information, comprehend facial expressions in real time, and convert the facial expressions into various expression parameters, thereby enabling the expressions of virtual characters to be controlled.

Thank you for reading and if you have enjoyed this article, I would suggest you to implement this and provide your experience.

Reference

Document

Training Video

--

--