Intermediate: Integration of Huawei Site Kit Text Search in Food Delivery App (Flutter) Part -1

Shiddalingeshwar M S
3 min readMay 7, 2021

In this article, we will be integration Text Search i.e. Keyword search feature of Site Kit. Huawei Site Kit provides core capabilities to developer to quickly build apps with which users can explore world around them seamlessly. Huawei Site kit provides following capabilities to developer as shown below.

Introduction

In this article, we will be integration Text Search i.e. Keyword search feature of Site Kit. Huawei Site Kit provides core capabilities to developer to quickly build apps with which users can explore world around them seamlessly. Huawei Site kit provides following capabilities to developer as shown below.

  • Keyword search: returns the place list based on the keywords entered by user.
  • Nearby place search: Searches for nearby location based on current location of the user’s device.
  • Place detail search: Search for details about the place.
  • Place search suggestion: Returns list of suggested places.
  • Autocomplete: Returns an autocomplete place and a list of suggested places based on the entered keyword.

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

Create TextSearchRequest and its body

Previous article on delivery app in flutter

Intermediate: Integration of Huawei map kit and Location kit in DeliveryApp in Flutter (Cross platform)

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

We have learnt how to integrate Huawei Site kit Text Search feature in delivery app in flutter. Where user can search for specific hotel in the search box and clicks on the result to see the list of orders. Similar way you can use Huawei Site kit as per user requirement in your application. In this part-1 I have covered Text Search that is Keyword Search you can expect more features implementation in part-2.

Thank you so much for reading, I hope this article helps you to understand the Huawei Site kit features in flutter.

Reference

Site Kit

Site Kit Plugin

GitHub Site Kit

--

--