GithubHelp home page GithubHelp logo

hms-core / hms-search-demo Goto Github PK

View Code? Open in Web Editor NEW
13.0 14.0 7.0 11.07 MB

HMS search kit demo provides an example of integrating HUAWEI Search Kit with an app.This topic uses the search home page and search content details page as examples to describe how to use Search Kit functions and display data returned by interfaces.

Home Page: https://developer.huawei.com/consumer/en/hms/huawei-searchkit

License: Apache License 2.0

Java 100.00%
hms searchkit huawei android search spell-check custom-search java

hms-search-demo's Introduction

HMS Search Kit Demo

English | δΈ­ζ–‡

Table of Contents

Introduction

HMS Search Kit sample code encapsulates APIs of the HUAWEI Search Kit. It provides a sample programs for your reference or usage.

Installation

Before using HMS Search Kit sample code, check whether the BD_SearchKitCodeLab environment has been installed. Decompress the HMS Search Kit sample code package.

Refresh the project and ensure that is successfully.

Supported Environments

searchkit 5.0.4.305 or a later version is recommended. The Android SDK is available only on a mobile device running Android API-Level 24 (Android 7.0 Marshmallow) or higher. Android studio.

Configuration

  1. Register and sign in to HUAWEI Developers.
  2. Create a project and then create an app in the project, enter the project package name.
  3. Go to Project Settings > Manage APIs, find the Search Kit API, and enable it.
  4. Go to Project Settings > General information, click Set next to Data storage location under Project information, and select a data storage location in the displayed dialog box.
  5. Download the agconnect-services.json file and place it to the app's root directory of the project.
  6. Add the Maven repository address maven {url 'https://developer.huawei.com/repo/'} and plug-in class path 'com.huawei.agconnect:agcp:1.3.1.300' to the project-level build.gradle file.
  7. Add apply plugin: 'com.huawei.agconnect' to the last line of the app-level build.gradle file.
  8. Configure the dependency com.huawei.hms:searchkit:5.0.4.305 in the app-level buildle.gradle file.
  9. Synchronize the project.

Sample Code

  1. Web search. Code location: searchindex/SearchActivity.java

  2. Image search. Code location: searchindex/SearchActivity.java

  3. Video search. Code location: searchindex/SearchActivity.java

  4. News search. Code location: searchindex/SearchActivity.java

  5. Custom search. Code location: searchindex/SearchActivity.java

  6. Suggest. Code location: searchindex/SearchActivity.java

  7. Spell check. Code location: searchindex/SearchActivity.java

Result

web search

image search

video search

news search

custom search

License

HMS Search Kit sample is licensed under the Apache License, version 2.0.

hms-search-demo's People

Contributors

mike-mei avatar wangyuxiang1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.