目录

Codelabs

To facilitate developers to develop key functions or scenarios, this page summarizes the current Codelabs resources, as shown in the following table:

Application Framework

[h2]Ability Kit

Name

Overview

Device Type

UIAbility Page Redirection

Based on the stage model, learn how to implement page redirection within a UIAbility.

Phone

UIAbility and Custom Component Lifecycle

This codelab introduces UIAbility and the custom component lifecycle during application running.

Phone

[h2]ArkData

Name

Overview

Device Type

RDB Store

This codelab introduces how to add, delete, modify, and query data in a relational database (RDB) store.

Phone

Data and Files - Preferences

Learn to access and operate local application data based on preferences.

Phone

Setting the App Font Size

Learn to access and operate local application data based on preferences.

Phone

App First Launch

Based on the custom dialog box, Preferences, and page router, learn to emulate the first launch of an app.

Phone

Distributed Contacts

With Contacts as an example, learn to create a distributed key-value (KV) store and how to add, delete, modify, query, and synchronize data.

Phone

Distributed Mail

Based on distributed data objects and distributed files, learn to implement distributed mail applications.

Phone

[h2]ArkTS

Name

Overview

Device Type

ArkTS Basics

Based on the rendering control syntax and component basics, learn how to build a ranking page that can be refreshed.

Phone

ArkTS Development Cases

Based on the ArkTS syntax, learn how to implement some basic algorithms.

Phone

[h2]ArkUI

Name

Overview

Device Type

Commodity List

Based on ArkTS, learn how to use the List component to implement lazy loading, pull-to-refresh, and scroll bounce.

Phone

Setting List

Based on ArkTS, learn how to use the List component and router to implement a setting list.

Phone

Swiper

Based on ArkTS and Swiper container, learn how to implement top navigation, ad carousel, and more.

Phone

WaterFlow Container

This codelab introduces how to use the WaterFlow container. As shown in the figure, the child components with different heights are arranged in a waterfall layout.

Phone

To-Do List

Based on the ArkTS declarative syntax and basic ArkTS components, learn how to implement a simple to-do list.

Phone

Flexible Layout

Based on the Flex container features, learn how to implement flexible layout.

Phone

Electronic Album

Learn how to implement an electronic album based on ArkTS. Use pinch and drag gestures to zoom in/out an image, and drag an image to view details.

Phone

Animation Example

Learn how to add animation to component properties based on ArkTS to improve user experience.

Phone

Cascading List

Based on ArkTS language, learn how to implement cascading between navigation and content.

Phone

Usage of the Basic Component Slider

Learn to implement the animation effect of adjusting the size and rotational speed of the windmill using the Slider component.

Phone

Simple Calculator

Based on basic components and containers, learn how to implement a calculator.

Phone

Using the Transition Animation

Based on ArkTS and transition animation APIs, learn how to implement a series of page transition animations.

Phone

Custom Pull-to-Refresh Animation

This codelab introduces the animation attributes of a component. With property animations, you can animate changes to certain component properties.

Phone

Window Management

Learn how to implement a verification code login case based on window management.

Phone

Using DevEco Studio for Efficient Development

Learn to use DevEco Studio to efficiently develop a login app.

Phone

How to Invoke Libraries

Learn to invoke and use the community library and local library based on the ArkTS.

Phone

Xiliubeipo Village

Learn how to implement an app that introduces Xiliubeipo Village based on ArkUI.

Phone

Custom Prize Wheel

Based on the Canvas component, learn how to customize the prize wheel.

Phone

Common Components and Layouts

This codelab introduces how to implement four types of dialog boxes, including the alert dialog box, custom dialog box, date picker dialog box, and text picker dialog box.

Phone

Common ArkUI Container Alignment Modes

This codelab introduces how to set the alignment modes of child components in the Flex, Column, Row, and Stack containers. You will learn to use alignItems, justifyContent, alignContent, alignSelf, and align to set alignment modes in different containers.

Phone

[h2]ArkWeb

Name

Overview

Device Type

Interaction between ArkTS and H5

The interaction between H5 and ArkTS is realized based on Web components and JSBridge bridging.

Phone

Web Cookie Operations

This codelab uses ArkTS to implement a simple login-free process and introduces basic cookie operations.

Phone

[h2]Core File Kit

Name

Overview

Device Type

File Manager

Learn how to implements file management, including reading/saving app files, user image files, and user TXT files.

Phone

[h2]UI Design Kit

Name

Overview

Device Type

Icon processing

This codelab walks you through the process of calling icon processing APIs provided by UI Design Kit with great ease to develop icons that can seamlessly integrate with the HarmonyOS ecosystem, delivering a consistent and premium user experience across all devices.

Phone, Tablet, PC/2in1

Application Services

[h2]Account Kit

Name

Overview

Device Type

One-Tap Sign-In with HUAWEI ID

Account Kit, which is built on the OAuth 2.0 and OpenID Connect protocols, enables an app to easily obtain HUAWEI ID users' identifiers and mobile numbers through one-tap sign-in, facilitating the establishment of a user system within the app.

Phone, Tablet, PC/2in1, TV

Account Kit (Atomic Services)

Account Kit empowers your atomic service with a simple, swift, and secure sign-in mechanism, enabling users to seamlessly sign in using their HUAWEI IDs. Upon user authorization, Account Kit grants your atomic service access to user information, including the mobile number, fostering a deeper understanding of your atomic service's user base.

Phone, Tablet

Account Kit(Youth Mode)

In this codelab, you will implement and experience functions such as obtaining the youth mode status, subscribing to common events related to the youth mode, and enabling or disabling the youth mode.

Phone, Tablet, PC/2in1

Account Kit(Atomic Services Supporting Youth Mode)

In this codelab, you will implement and experience functions such as obtaining the youth mode status, subscribing to common events related to the youth mode, and enabling or disabling the youth mode.

Phone, Tablet

[h2]Ads Kit

Name

Overview

Device Type

Ads Kit (Banner Ads - HarmonyOS-ArkTS)

This codelab will guide you to obtain and display banner ads in your app through APIs.

Phone, Tablet

Ads Kit (Interstitial Ads - HarmonyOS-ArkTS)

This codelab will guide you to obtain and display interstitial ads in your app through APIs.

Phone, Tablet

Ads Kit (Native Ads - HarmonyOS-ArkTS)

This codelab will guide you to obtain and display native ads in your app through APIs.

Phone, Tablet

Ads Kit (OAID-HarmonyOS-ArkTS)

This codelab will guide you to obtain the Open Anonymous Device Identifier (OAID) in your app through an API.

Phone, Tablet, PC/2in1, TV

Ads Kit (Rewarded Ads - HarmonyOS-ArkTS)

This codelab will guide you to obtain and display rewarded ads in your app through APIs.

Phone, Tablet

Ads Kit (Roll Ads - HarmonyOS-ArkTS)

This codelab will guide you to obtain and display roll ads in your app through APIs.

Phone, Tablet

Ads Kit (Splash Ads - HarmonyOS-ArkTS)

This codelab will guide you to obtain and display splash ads in your app through APIs.

Phone, Tablet

[h2]AppGallery Kit

Name

Overview

Device Type

AppGallery Kit (ArkTS)

Based on the stage model, this codelab implements features such as displaying an app details page for downloading and installing the target app, querying the ad signature verification version, obtaining module installation information, adding modules for on-demand loading, and performing app attribution.

Phone, Tablet, PC/2in1

[h2]Background Tasks Kit

Name

Overview

Device Type

Download Notification

Learn to implement the download notification based on the HarmonyOS notification capability.

Phone

[h2]Call Service Kit

Name

Overview

Device Type

Social Communication - Call Service Kit (ArkTS)

This codelab guides you through how to use Call Kit to send incoming call notifications to the system when the app process is running in the background.

Phone

[h2]Cloud Foundation Kit

Name

Overview

Device Type

Cloud Foundation Kit (ArkTS)

This codelab will guide you through how to use Cloud Foundation Kit to interact with the cloud in your app.

Phone

[h2]Game Service Kit

Name

Overview

Device Type

Game Sign-In (ArkTS)

You will use Game Service Kit to quickly develop functions such as game sign-in, compliance verification, and player role information submission.

Phone, Tablet, PC/2in1, TV

Game Scene Perception (ArkTS)

This codelab introduces how your game sends data to the system and obtains device status through game scene perception.

Phone, Tablet, PC/2in1

[h2]Health Service Kit

Name

Overview

Device Type

Health Service Kit(ArkTS)

Health Service Kit provides an open platform for Huawei ecosystem apps to access fitness and health data of users.

Phone, Tablet

[h2]IAP Kit

Name

Overview

Device Type

In-App Purchases(ArkTS)

Learn to use IAP Kit to build an app where users can buy consumables and that works with the delivery acknowledgement API for repurchase.

Phone

[h2]Location Kit

Name

Overview

Device Type

Pedometer App

Implement a pedometer app based on the pedometer sensor, location service, and background tasks.

Phone

[h2]Map Kit

Name

Overview

Device Type

Map Kit - Map Display (ArkTS)

Map Kit is a powerful service within the HarmonyOS ecosystem. It empowers developers to effortlessly create customized map experiences by offering robust capabilities such as personalized map display, map search, and route planning. You can easily integrate map-related functions into HarmonyOS apps or atomic services to enhance user experience.

Phone, Tablet, PC/2in1

[h2]PDF Kit

Name

Overview

Device Type

PDF Service (ArkTS)

Based on the PDF open service, the Codelab enables applications to access the PDF capability.

Phone, Tablet, PC/2in1

[h2]Preview Kit

Name

Overview

Device Type

Data and Files - Preview Kit (ArkTS)

Provides preview services for basic files based on Files.

Phone, Tablet, PC/2in1

[h2]Scenario Fusion Kit

Name

Overview

Device Type

Retrieval of system attributes via API calls based on Scenario Fusion Kit

This codelab illustrates scenario-specific APIs provided by Scenario Fusion Kit, which can be used to obtain system information and location information.

Phone, Tablet, PC/2in1, Wearable, TV

Scenario-specific button components built based on Scenario Fusion Kit

This codelab illustrates how to use scenario-specific APIs buttons provided by Scenario Fusion Kit, including quick mobile number verification, avatar selection, and authorization setting page display buttons.

Phone, Tablet, PC/2in1, TV

Intelligent input suggestions and filling based on Scenario Fusion Kit

This codelab illustrates how to use SmartFill to offer scenario-specific input suggestions to realize one-tap filling of complex forms for users.

Phone, Tablet, PC/2in1

[h2]Share Kit

Name

Overview

Device Type

Social Communication - Share Kit

This codelab describes how to use Share Kit to share data between apps.

Phone, Tablet, PC/2in1

[h2]Wallet Kit

Name

Overview

Device Type

Wallet Kit

Wallet Kit integrates the open capabilities of the end-to-end "chip-device-cloud" technology, providing digital passes such as car keys and transportation cards. Users can easily store these digital passes on their mobile phones for convenient use whenever needed. A user can enable a digital car key in HUAWEI Wallet to use their phone to unlock their car through Bluetooth, instead of using a physical key. A digital car key can be easily shared with others (such as family members). It will not be long before this technology is widely applied in the automotive industry of the Chinese mainland.

Phone

Media

[h2]Image Kit

Name

Overview

Device Type

Image Editing

Learn how to edit images based on image encoding and decoding, including cropping, rotation, and color gamut adjustment.

Phone

[h2]Media Kit

Name

Overview

Device Type

Video Player

Based on HarmonyOS AVPlayer, learn how to implement video playback.

Phone

Simple Video Player

This codelab uses ArkTS to implement a video player, including its main page and video playback page.

Phone

[h2]Ringtone Kit

Name

Overview

Device Type

Ringtone service(Ringtone Kit)

HarmonyOS integrates Ringtone Kit for developers to use the kit's open capabilities in building smart ringtone service scenarios.

Phone, Tablet

[h2]Scan Kit

Name

Overview

Device Type

Scan Kit

This sample code demonstrates how to integrate "scan-to-access" to redirect users to a specific in-app service page in just one step and use Scan Kit's functions of recognizing, scanning, and generating barcodes, including image-based barcode recognition, barcode scan by default UI, barcode scan by custom UI, and barcode image generation.

Phone, Tablet

System

[h2]Car Kit

Name

Overview

Device Type

Car Kit (ArkTs)

This sample code illustrates how to use APIs of the navigation information service and mobility distributed engine service.

Phone

[h2]Device Security Kit

Name

Overview

Device Type

Security - DeviceVerify (ArkTS)

Device Security Kit provides the DeviceVerify function to detect and manage the usage status of an app on a specific device.

Phone, Tablet, PC/2in1

Security - TrustedAppService (ArkTS)

Device Security Kit provides the TrustedAppService function to implement image security verification and location security verification, preventing images or location data obtained by apps from being tampered with.

Phone

Security - BusinessRiskIntelligentDetection (ArkTS)

Provides business risk intelligent detection for anti-cheating, anti-fraud, and violation check.

Phone, Tablet

SafetyDetect Service

This sample code illustrates how to obtain the system integrity check and URL check results in an app.

Phone, Tablet, PC/2in1

[h2]Enterprise Data Guard Kit

Name

Overview

Device Type

Enterprise Data Guard Kit

This codelab illustrates how to implement functions for scanning files in the media library directory and app sandbox directory through this Kit.

PC/2in1

[h2]Network Kit

Name

Overview

Device Type

HTTPS Request Process

This codelab introduces how to implement an HTTPS request based on the network module and Webview, and capture and analyze packets during the process.

Phone

News Data Loading

This codelab gives an example of ArkTS declarative development, introducing how to use the data request and onTouch event.

Phone

News Release

This codelab introduces how to develop a news release app.

Phone

[h2]Network Boost Kit

Name

Overview

Device Type

Network Boost(ArkTS)

Offers a solution that enhances network performance through acceleration, awareness, and prediction capabilities. By coordinating software, hardware, chips, devices, pipes, and cloud resources, it optimizes network resource allocation for a more reliable, smoother, and faster Internet experience.

Phone

[h2]Online Authentication Kit

Name

Overview

Device Type

Security-Online Identity Verification-IFAA(ArkTS)

This codelab describes how to use the IFAA password-free identity verification capability

provided by HarmonyOS

Phone, Tablet, PC/2in1

Security-Online Identity Verification-FIDO(ArkTS)

This codelab describes how to use the FIDO password-free identity verification capability

provided by HarmonyOS.

Phone, Tablet, PC/2in1

Security-Online Identity Verification-SOTER(ArkTS)

This codelab describes how to use the SOTER password-free identity verification capability

provided by HarmonyOS

Phone, Tablet, PC/2in1

[h2]Pen Kit

Name

Overview

Device Type

Pen Kit (ArkTS)

Pen Kit is a handwriting suite provided by Huawei. It provides a wide array of enriching features, such as brush effects, handwriting editing, point prediction, and Instant Shape. It allows developers to easily integrate the handwriting feature to the stylus pen for a premium handwriting experience and extends the use of the stylus pen in more scenarios.

This sample code shows how to integrate the capabilities provided by Pen Kit.

Phone, Tablet, PC/2in1

[h2]Remote Communication Kit

Name

Overview

Device Type

Network-RemoteCommunication(ArkTS)

Remote Communication Kit is a network request service in the HarmonyOS ecosystem which can easily integrate functions related to network.

Phone

[h2]Service Collaboration Kit

Name

Overview

Device Type

Service Collaboration Kit

Service Collaboration Kit provides the capability of multi-device collaboration based on the same account.

Phone, Tablet, PC/2in1

[h2]Wear Engine Kit

Name

Overview

Device Type

Wear Engine Kit (ArkTS)

Wear Engine is designed for developers of apps and services running on phones and wearable devices.

Phone, Tablet

[h2]NDK

Name

Overview

Device Type

Native XComponent

Learn how to implement graphics rendering based on XComponent.

Phone

Simple Native C++ Example

Based on the Native C++ template, learn how to implement the function of calling the C standard library through the NAPI.

Phone

AI

[h2]Core Vision Kit

Name

Overview

Device Type

Machine Learning - Core Vision Kit

The Core Vision Kit provides visual AI capabilities, including text recognition, face detection, face comparison, and subject segmentation.

Phone, Tablet, PC/2in1

[h2]Core Speech Kit

Name

Overview

Device Type

Machine Learning - Core Speech Kit

Integrates basic voice AI capabilities to facilitate interaction between users and devices and implement real-time voice-text conversion.

Phone, Tablet, PC/2in1

[h2]Intents Kit

Name

Overview

Device Type

Intents Kit

Intents Kit for HarmonyOS defines standards for intents, linking functions of apps or atomic services.

It helps you intelligently distribute functions of apps or atomic services to system access points. This process is called smart distribution. The system access points include Celia Chat, Celia Search, and Celia Suggestions.The following figure shows the relationships among system access points, Intents Kit, and the HarmonyOS ecosystem.

Phone, Tablet

[h2]CANN Kit

Name

Overview

Device Type

Image Classification Based on SqueezeNet

Provides the image classification capability powered by CANN Kit for running AI models.

Phone, Tablet, PC/2in1, TV

[h2]Natural Language Kit

Name

Overview

Device Type

Machine Learning - Natural Language Kit

The Natural Language Kit provides multiple basic capabilities related to text semantic understanding for processing and analyzing text data.

Phone, Tablet, PC/2in1

[h2]Speech Kit

Name

Overview

Device Type

Machine Learning - Speech Kit

Integrates voice AI capabilities, including the TextReader capability, so that users can interact with devices and read articles aloud.

Phone, Tablet, PC/2in1

[h2]Vision Kit

Name

Overview

Device Type

Machine Learning - Vision Kit

This example shows the face liveness detection, card recognition, and document scanning capabilities.

Phone, Tablet, PC/2in1

Graphics

[h2]Graphics Accelerate Kit

Name

Overview

Device Type

Graphics Accelerate Kit - OpenGTX Example (C++)

Graphics Accelerate Kit - OpenGTX Example (C++) The low-temperature polycrystalline oxide (LTPO) function for a dynamic frame rate or refresh rate is provided based on OpenGTX APIs offered by Graphics Accelerate Kit, helping you create an ultimate game experience with superior image quality, high smoothness, and low power consumption.

Phone, Tablet

Graphics Accelerate Kit - Frame Generation Example of OpenGL ES (C++)

The frame generation capability is provided in graphics rendering scenes based on frame generation APIs offered by Graphics Accelerate Kit.

Phone, Tablet

Graphics Accelerate Kit - Frame Generation Example of Vulkan (C++)

The frame generation capability is provided in graphics rendering scenes based on APIs offered by Graphics Accelerate Kit using Vulkan.

Phone, Tablet

Graphics Accelerate Kit - ABR Example (C++)

The adaptive buffer resolution (ABR) capability is provided in graphics rendering scenes based on ABR APIs offered by Graphics Accelerate Kit.

Phone, Tablet

[h2]XEngine Kit

Name

Overview

Device Type

XEngine Kit – GPU Spatial Upscaling (Based on Vulkan)

XEngine Kit provides the GPU spatial upscaling capability (based on Vulkan), which reconstructs lower-resolution images into higher-resolution ones.

Phone, Tablet, PC/2in1, TV

XEngine Kit – GPU Spatial Upscaling (Based on GLES)

XEngine Kit provides the GPU spatial upscaling capability (based on GLES), which reconstructs lower-resolution images into higher-resolution ones.

Phone, Tablet, PC/2in1, TV

XEngine Kit – AI Spatial Upscaling (Based on GLES)

XEngine Kit provides the AI spatial upscaling capability (based on GLES). By leveraging the cooperation between GPU and NPU, it reconstructs lower-resolution images into higher-resolution ones.

Phone, Tablet, PC/2in1, TV

XEngine Kit – Adaptive VRS (Based on GLES)

XEngine Kit offers adaptive VRS capability (based on GLES), which optimizes resource allocation to reduce the rendering frequency without visual loss, allowing for higher rendering performance.

Phone, Tablet, PC/2in1, TV

XEngine Kit – Adaptive VRS (Based on Vulkan)

XEngine Kit offers adaptive VRS capability (based on Vulkan), which optimizes resource allocation to reduce the rendering frequency without visual loss, allowing for higher rendering performance.

Phone, Tablet, PC/2in1, TV

XEngine Kit – Subpass Shading (Based on Vulkan)

XEngine Kit provides the Subpass Shading capability (based on Vulkan) to lower the double data rate (DDR) bandwidth and improve the GPU performance.

Phone, Tablet, PC/2in1, TV