English | 中文
This sample code encapsulates APIs of the HUAWEI Drive Kit SDK. It provides many sample programs for your reference or usage. You will learn how to use Drive Kit SDK.
The following describes packages of Java sample code.
app: Sample code packages.
For more development details, please refer to the following link:
https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/introduction-0000001050039630
Before using HUAWEI Drive Kit SDK sample code, check whether the JAVA environment has been installed.
Clone the sample code to local.
Take the Android Studio 3.2 version as an example. The steps to run the Drive service sample code are as follows:
To use functions provided by packages in examples, you do not need to set any related parameters in build.gradle and agconnect-services.json in the app package
The following describes parameters in build.gradle and agconnect-services.json
applicationId: ID of the application registered on the HUAWEI Developer.
app_id: App ID, which is obtained from app information.
Devices to be tested: Huawei phones running EMUI 10.0 or later or non-Huawei phones running Android 10.0 or later. If multiple HMS Core services are used at the same time, the maximum value of each Kit must be used.
Java 1.8 or a later version is recommended.
Android Studio 3.2 version or a later version is recommended.
Your application should meet the following conditions: minSdkVersion 29 targetSdkVersion 33 compileSdkVersion 30 Gradle 3.5.4 and later.
Currently, the core capabilities of Drive Kit include uploading, downloading, deleting, trashing, and searching for files in Drive as well as querying and monitoring file changes.
FILES.CREAEFILE
, you need to call FILES.CREATE
. FILES.GET,FILES.SUBSCRIBE,FILES.COPY,FILES.UPDATE,FILES.UPDATECONTENT,CHANGES.SUBSCRIBE,COMMENTS.CREATE,COMMENTS.LIST
, you need to call FILES.CREATE and FILES.CREATEFILE
. CHANGES.LIST
, you need to call CHANGES.GETSTARTCURSOR
. CHANNELS.STOP
, you need to call CHANGES.SUBSCRIBE
. COMMENTS.GET
, you need to call COMMENTS.CREATE
. Replies.CREATE
, you need to call COMMENTS.CREATE
. If you want to evaluate more about HMS Core, r/HMSCore on Reddit is for you to keep up with latest news about HMS Core, and to exchange insights with other developers.
If you have questions about how to use HMS samples, try the following options:
huawei-mobile-services
.If you run into a bug in our samples, please submit an issue to the Repository. Even better you can submit a Pull Request with a fix.
DriveKit SDK sample is licensed under the Apache License, version 2.0.