Make search super easy with Huawei Site Kit Search Activity in Flutter

In this article, we will be integration Site kit Autocomplete API and Search Activity which Huawei provides Search activity for developer to quickly implementation Search functionality easily and in your application. Huawei Site Kit provides core capabilities to develop an app quickly to build with which users can explore world around them seamlessly. You can check my previous article for more about it.

Introduction

In this article, we will be integration Site kit Autocomplete API and Search Activity which Huawei provides Search activity for developer to quickly implementation Search functionality easily and in your application. Huawei Site Kit provides core capabilities to develop an app quickly to build with which users can explore world around them seamlessly. You can check my previous article for more about it.

Development Overview

You need to install Flutter and Dart plugin in IDE and I assume that you have prior knowledge about the Flutter and Dart.

Hardware Requirements

A computer (desktop or laptop) running Windows 10.

  • A Huawei phone (with the USB cable), which is used for debugging.

Software Requirements

  • Java JDK 1.7 or later.
  • Android studio software or Visual Studio or Code installed.
  • HMS Core (APK) 4.X or later.

Integration process

Step 1. Create flutter project.

Step 2. Add the App level gradle dependencies.

Choose inside project Android > app > build.gradle.

Add root level gradle dependencies

Step 3: Add the below permissions in Android Manifest file.

Step 4: Add Site Kit Plugin path in pubspec.yaml file under dependencies.

Step 5: Create a project in AppGallery Connect.

Declare and instantiate service object

How to start Search Activity?

How do call Autocomplete API?

Autocomplete API gives list of nearby places on the current location and also you can set query param to get desired result.

Result

Tricks and Tips

  • Make sure you have downloaded latest plugin.
  • Make sure that updated plugin path in yaml.
  • Make sure that plugin unzipped in parent directory of project.
  • Makes sure that agconnect-services.json file added.
  • Make sure dependencies are added build file.
  • Run flutter pug get after adding dependencies.
  • Generating SHA-256 certificate fingerprint in android studio and configure in Ag-connect.

Conclusion

In this article, we have learnt how to integrate Huawei Site kit Search Activity and Autocomplete feature in MyFoodz Order flutter application. It makes developer to quickly implement Huawei Site kit’s Search Activity and Autocomplete API in your application. Similar way you can use Huawei Site kit as per user requirement in your application.

Thank you so much for reading, I hope this article helps you to understand the Huawei Site kit’s Search Activity and Autocomplete API features in flutter.

Reference

Site Kit Search Activity

Site Kit Plugin

Checkout in forum

Android developer