[Huawei Developers] Freemind R:
Introduction

App Linking or deep linking is a technology which enable businesses to provide ease of access for their potential services.

Deep links are links which re-direct users directly to a specific app or application feature instead of a website or store.

They are used to re-direct users straight to in-app locations, saving the users time and energy.

Deep linking does this by specifying a custom URL scheme (iOS Universal Links) or an intent URL (on Android devices) that opens your app if it’s already installed. Deep links can also be set to direct users to specific events or pages.

Huawei App Linking leverage developers/users to create cross platform links which can work as defined and can be distributed via multiple channels to users.

When the user taps the link, it will be re-directed to the specified in-app content.

Huawei App Linking has multiple functions:

1. Support for deferred deep links

2. Link display in card form

3. Data statistics

Huawei App Linking supports the link creation in multiple ways:

1. Creating a link in AppGallery Connect

2. Creating a link by calling APIs on the client

3. Manually constructing a link

Use Case

There could be multiple use cases for this capability, however I will throw some light on a use case which is most commonly adapted by the applications with complex UX and high transmission between different in-app pages.

In this scenario one application shares the link between counter applications to re-direct to in-app content of a third application.

We will have an application which shares the app link at one end to another (It can be a simple chat platform capability). At the receiver end, user can click on the link and directly navigate to the specific in-app content.

Working

Following are the steps to develop this scenario

1. Development of news application which will be deployed locally.

2. Development of share application which will be deployed locally.

3. Integration of Huawei App Linking Api’s to receive the link and re-direct to the in-app content of news app.

4. Enabling the App linking service in AppGallery Connect.

5. Creating deep link through AppGallery Connect.

Development Overview

1. Must have a Huawei Developer Account

2. Must have Android Studio 3.0 or later

3. Must have a Huawei phone with HMS Core 4.0.2.300 or later

4. EMUI 3.0 or later

Software Requirements

1. Java SDK 1.7 or later

2. Android 5.0 or later

Preparation

1. Create an app or project in Android Studio.

2. Create an app and project in the Huawei AppGallery Connect.

3. Provide the SHA Key and App Package name of the project for which you want the App Linking to be done (Example: News application)

4. Download the agconnect-services.json file and paste to the app folder of your android studio.

Integration

Add below to build.gradle (project)file, under buildscript/repositories and allprojects/repositories.

Maven {url 'http://developer.huawei.com/repo/'}

Add below to build.gradle (app) file, under dependencies to use the App Linking SDK.

dependencies{
// Import the SDK.
implementation 'com.huawei.agconnect:agconnect-applinking:1.4.1.300'
}

News Application

News application is developed with multiple content and complex UX to show the capability of the Huawei App Linking.

I will highlight some of the important code blocks for this application.

Main Activity

This activity is the entry point for the application which will have the navigation tab to handle the multiple news categories.

Also, it receives the App Link, read it and re-direct it to the corresponding content.

Creating a link in AppGallery Connect to directly open the Science tab for the News Application through a link

1. Login to AppGallery Connect.

2. Choose My Projects > NewsWorld(App Linking).

3. Choose > Growing > App Linking>Enable now

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