Git Product home page Git Product logo

locationkit's Introduction

location

Table of Contents

Introduction

HUAWEI Location Kit sample code encapsulates APIs of the HUAWEI Location Kit. It provides many sample programs for your reference or usage.

Installation

Before using HuaweiLocationKit sample code, check whether the Android Studio environment has been installed. 
Decompress the HuaweiLocationKit sample code package.
Download  location.zip.
Decompress the location.zip.
Open location with Android studio.

Supported Environments

Android Studio
Java

Sample Code

To use the HUAWEI Location Kit service API, you need to download and install the HMS Core service component on your device, and integrate related SDKs into your project.
The following describes methods in this demo.

SendMessage:    request location update.


1). Assigning App Permissions
You need to apply for the permissions in the Manifest file.
Code :/location/app/src/AndroidManifest.xml

2). Creating a Location Service Client.
Create a FusedLocationProviderClient instance in the OnCreate() method of the activity and use the instance to call location-related APIs.
Code :/location/app/src/main/java/com/hms/locationki/fusedlocation/RequestLocationUpdatesWithCallbackActivity.java

3). Checking the Device Location Settings.
you are advised to check whether the device settings meet the location requirements before continuously obtaining location information.
Code :/location/app/src/main/com/hms/locationki/fusedlocation/RequestLocationUpdatesWithCallbackActivity.kt

4). Continuously Obtaining the Location Information.
To enable your app to continuously obtain the device location, you can use the requestLocationUpdates() API provided by the HUAWEI Location Kit service. 
Code :/location/app/src/main/java/com/hms/locationki/fusedlocation/RequestLocationUpdatesWithCallbackActivity.java

License

HUAWEI Location kit sample is licensed under the [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0).

locationkit's People

Contributors

lwj474010422 avatar 1312662151 avatar liaoxiaojia avatar xwr22 avatar houweilong1 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.