[Huawei Developers] John Wo:
Overview

Cloud Storage Service allows you to store high volumes of data such as images, audios, and videos generated by your users securely and economically with direct device access. The service is stable, secure, efficient, and easy-to-use, and can free you from development, deployment, O&M, and capacity expansion of storage servers.

In this article, we can learn the following:

Create an app and configure its information in AppGallery Connect.

Use B4A IDE to integrate the HUAWEI HMS Cloud Storage SDK into your app and develop storage-related functions.

Build and demonstrate a demo app.

Manage files on the Cloud Storage page in AppGallery Connect.

For details, refer to

Free IDE for B4X Native Android Development | B4A

B4A includes all the features needed to quickly develop any type of Android app. B4A is used by tens of thousands of developers from all over the world, including companies such as NASA, HP, IBM and others.

www.b4x.com

Creating Wrapper Class

1. Download the following AAR package inside addition folder in your project directory.

HMSSDK AGConnect:

https://developer.huawei.com/repo/c...t-auth/1.4.1.300/agconnect-auth-1.4.1.300.aar

https://developer.huawei.com/repo/c...t-core/1.4.0.300/agconnect-core-1.4.0.300.aar

https://developer.huawei.com/repo/c...age/1.3.0.300/agconnect-storage-1.3.0.300.aar

https://developer.huawei.com/repo/c...e-core/1.4.1.300/datastore-core-1.4.1.300.aar

https://developer.huawei.com/repo/c.../1.4.1.300/datastore-annotation-1.4.1.300.jar

https://developer.huawei.com/repo/c...https/1.4.1.300/agconnect-https-1.4.1.300.aar

https://developer.huawei.com/repo/c.../1.4.1.300/agconnect-credential-1.4.1.300.aar

HMSSDK Base:

https://developer.huawei.com/repo/com/huawei/hms/base/5.0.0.301/base-5.0.0.301.aar

HMSSDK Update:

https://developer.huawei.com/repo/c...pdate/5.0.0.301/availableupdate-5.0.0.301.aar

https://developer.huawei.com/repo/com/huawei/hms/update/2.0.6.302/update-2.0.6.302.aar

HMSSDK Device:

https://developer.huawei.com/repo/com/huawei/hms/device/5.0.0.301/device-5.0.0.301.aar

HMSSDK DynamicAPI:

https://developer.huawei.com/repo/com/huawei/hms/dynamic-api/1.0.13.303/dynamic-api-1.0.13.303.aar

HMSSDK Log:

https://developer.huawei.com/repo/com/huawei/hms/log/5.0.0.301/log-5.0.0.301.aar

HMSSDK Network:

https://developer.huawei.com/repo/c...common/4.0.2.300/network-common-4.0.2.300.aar

https://developer.huawei.com/repo/com/huawei/hms/network-grs/4.0.2.300/network-grs-4.0.2.300.aar

HMSSDK Stats:

https://developer.huawei.com/repo/com/huawei/hms/stats/5.0.0.301/stats-5.0.0.301.aar

HMSSDK Tasks:

https://developer.huawei.com/repo/com/huawei/hmf/tasks/1.4.1.300/tasks-1.4.1.300.aar

HMSSDK UI:

https://developer.huawei.com/repo/com/huawei/hms/ui/5.0.0.301/ui-5.0.0.301.aar

Squareup Libraries:

https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/3.11.0/okhttp-3.11.0.jar

https://repo1.maven.org/maven2/com/squareup/okio/okio/1.14.0/okio-1.14.0.jar

Note: After download of the above AAR files, create addition folder inside Project and keep all AAR packages in it.

2. Open each of the AAR package with RAR tool and rename the class.jar and AndroidManifest.xml files. And save those jar files inside libs folder (It is recommended that the two files be renamed consistently with the AAR package names.)

1. Create Library as parent and then create bin, libs and src as subfolder in the project directory.

2. Develop java project inside the following path:

Choose Library Folder > src > b4x > hms > cloudstorage

a. Import the following two lines of code to each Java file.

import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.*;

b. Add necessary annotations to the Java files.

@Version(1.0f)
@ShortName("CloudStorageFuncs")
@DependsOn(values={
"agconnect-auth-1.4.1.300.aar",
"agconnect-core-1.4.0.300.aar",
"agconnect-storage-1.3.0.300.aar",
"availableupdate-5.0.0.301.aar",
"base-5.0.0.301.aar",
"device-5.0.0.301.aar",
"dynamic-api-1.0.13.303.aar",
"log-5.0.0.301.aar",
"network-common-4.0.2.300.aar",
"network-grs-4.0.2.300.aar",
"stats-5.0.0.301.aar",
"tasks-1.4.1.300.aar",
"ui-5.0.0.301.aar",
"update-2.0.6.302.aar",
"okhttp-3.11.0.jar",
"datastore-core-1.4.1.300.aar",
"datastore-annotation-1.4.1.300.jar",
"agconnect-https-1.4.1.300.aar",
"agconnect-credential-1.4.1.300.aar",
"okio-1.14.0.jar"
})

More details, you can visit https://forums.developer.huawei.com/forumPortal/en/topic/0203411651765670210