[Huawei Developers] Freemind R:
Introduction

Augmented Reality is increasing every day in different areas like shopping, Games, Education etc. AR Engine provides a mesh with more than 4,000 vertices and 7,000 triangles to precisely outline face contours, and enhance the overall user experience.

Today I will develop a demo application and try to explain this features and what it provides in more detail.

AR Engine Services

Augmented reality (AR) is an interactive experience of a real-world environment where the objects reside in the real world are enhanced by computer-generated perceptual information, sometimes across multiple sensory modalities, including visual, auditory, haptic, somatosensory and olfactory.

It provide basic AR capabilities such as motion tracking, environment tracking, body tracking, and face tracking.

Restrictions

The current version of Huawei AR Engine supports only Huawei devices. So, you need a Huawei phone that supports Huawei AR Engine, you can see the supported devices below.

AR Engine Process

The following figure shows the general process of using the Huawei AR Engine SDK.

Flutter setup

Refer this URL to setup Flutter.

Software Requirements

1. Android Studio 3.X

2. JDK 1.8 and later

3. SDK Platform 24 and later

4. Gradle 4.6 and later

5. Ensure that the AR Engine server APK have been downloaded from AppGallery and installed on the device. To do so, search for HUAWEI AR Engine in Huawei AppGallery.

Steps to integrate service

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.

Development Process

Create Application in Android Studio.

1. Create Flutter project.

2. App level gradle dependencies. Choose inside project Android > app > build.gradle.

apply plugin: 'com.android.application'
apply plugin: 'com.huawei.agconnect'

Root level gradle dependencies

maven {url 'https://developer.huawei.com/repo/'}
classpath 'com.huawei.agconnect:agcp:1.4.1.300'

Add the below permissions in Android Manifest file.

<manifest xlmns:android...>
...
<uses-permission android:name="android.permission.CAMERA" />
<application ...
</manifest>

3. Add HMS AR Engine kit plugin download using below URL.

https://developer.huawei.com/consum...y-V1/flutter-sdk-download-0000001059096444-V1

4. On your Flutter project directory find and open your pubspec.yaml file and add library to dependencies to download the package from pub.dev. Or if you downloaded the package from the HUAWEI Developer website, specify the library path on your local device. For both ways, after running pub get command, the plugin will be ready to use.

name: arDemo
description: A new Flutter application.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1

environment:
sdk: ">=2.7.0 <3.0.0"

dependencies:
flutter:
sdk: flutter
huawei_ar:
path: ../huawei_ar/

dev_dependencies:
flutter_test:
sdk: flutter

flutter:
uses-material-design: true

5. We can check the plugins under External Libraries directory.

6. Open main.dart file to create UI and business logics.

More details, you can check https://forums.developer.huawei.com/forumPortal/en/topic/0202460753111420009