English | 中文
- Introduction
- [Preparing the Environments](#Preparing the Environments)
- [Getting Started](#Getting Started)
- [Sample Code](#Sample Code)
- Question or issues
- License
This demo demonstrates an example of using the SDK to store pictures, videos, audio, or other user-generated files. For details about the SDK, please refer to https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agc-get-started.
- A computer with Android Studio installed for app development
- A device or emulator in Android Studio running Android 4.2 or a later version
Before running the quickstart app, you need to:
-
Activate cloud storage service: The cloud storage service is not activated by default. You need to manually activate the cloud storage service in AGC.
-
New storage instance: After opening the cloud storage service, AGC will automatically create a default storage instance. If you want to store application system data and user data separately, you can create a new storage instance yourself.
-
Integrated SDK: If you need to use cloud storage-related functions in the application client, you must integrate the cloud storage client SDK.
-
Initialize the cloud storage: Before the application client uses the cloud storage, you need to initialize the cloud storage and specify the storage instance used by the client.
-
File management: The application client can call the API of the cloud storage SDK to perform operations such as uploading files, downloading files, deleting files, and modifying file metadata.
For more development details, please refer to the following link: Development Guide: https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-Guides/agc-get-started
API References: https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/cloudstroage
Sample code: /app/src/main/java/com/huawei/agc/quickstart/storage/MainActivity.java
Kotlin Sample code: /kotlin-app/src/main/java/com/huawei/agconnect/kotlindemo/MainActivityKotlin.kt
If you have questions about how to use AppGallery Connect Demos, try the following options:
- Stack Overflow is the best place for any programming questions. Be sure to tag your question with appgallery.
- Huawei Developer Forum AppGallery Module is great for general questions, or seeking recommendations and opinions.
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.
quickstart is licensed under the [Apache License, version 2.0] (http://www.apache.org/licenses/LICENSE-2.0).