👨🏼‍💻Store your files with Drive kit in Unity

Alihan98ersoy
Huawei Developers
Published in
3 min readJul 7, 2022

--

Drive Kit

📖 Introduction 📖

In this article, I’ll be explaining what is drive kit and how can we use it in unity with an example on our drive kit demo scene.

🚧 Getting Started 🚧

First, we need to create a project on AGC which is explained here. After that, we need to import the plugin into our Unity project. You can find released versions here. I’ll be using the current latest version which is v2.2.32 for my Unity 2019 version. As a final step before coding, we need to connect our game with the HMS Kit Managers.

🚗What is Huawei Drive kit?🚗

Drive Kit (the short form of Huawei Drive Kit) allows developers to create apps that use Drive. Drive Kit gives us cloud storage capabilities for our apps, enabling users to store files that are created while using our apps, including photos, videos, and documents.

Some of the main function of the Drive kit:

  • Obtaining User Information
  • Managing and Searching for Files
  • Storing App Data
  • Performing Batch Operations

You can find more information in the official documentation link.

🎬Action🎬

First of all, I want you to build the game using the drive kit demo scene in the project.

building the scene

Then, Create a testFile.txt in your phone. This is default, you can use different pathfile as you wish:)

file path

Did you use cloud before? If not you should open the huawei cloud and make some configurations.

Huawei cloud app

Now everything’s is ready. Let me introduce the demo scene…

Demo scene

Click Get About to obtain user information.

Click Create Directory to create a folder with the name (time now as default) on your drive.

Click Create File to create a text file with your testFile in your device on your drive.

Click Create Comments to create comments on your text file which was just created on your drive.

Click List Comments to list comments on your txt file which was just created on your drive.

HMSDriveKitManager
final result

💡 Conclusion 💡

In this article, I try to explain how you can test the demo scene we prepared for the drive kit. I hope this article was helpful to you.

Don’t hesitate to ask questions

👇 References 👇

--

--