Skip to content

HarmonyOS Adaptation Guide ​

Architecture Overview:

The minigame runtime environment on the HarmonyOS platform is similar to Android, i.e. the JavaScript code of the logic layer runs in v8.

In addition, the minigame's runtime mechanism, update mechanism, etc. remain consistent, but there are differences in the support level of some features.

Adaptation Approach:

Currently, the main difference between the minigame on the HarmonyOS platform and other platforms lies in the features of native capabilities.

You can use sud.getDeviceInfo().platform === 'ohos' to determine whether it is the HarmonyOS platform, and your business logic needs to make the necessary compatibility handling for HarmonyOS.

Note: If you simulate HarmonyOS in the developer tools, you need to check sud.getDeviceInfo().system=='HarmonyOS' (in the tools, platform is devtools).

Debugging Approach:

  • Debug on a real device

Support Status:

For the specific support status of each API, you can jump to the corresponding [API documentation] to view it.

The following lists the features that are not yet supported. Developers need to handle compatibility for any used but unsupported features.

APIs:

ModuleSupport Status
Basics - App-level EventsPartially supported
Basics - PerformancePartially supported
Basics - DebuggingPartially supported
ForwardingPartially supported
Data CachePartially supported
RenderingPartially supported
Media - AudioPartially supported
Media - ImagePartially supported
Media - RecordingNot supported
Media - CameraNot supported
Media - Video DecoderNot supported
Media - Real-time VoiceSupported
FilePartially supported
Open Interface - Cards & CouponsNot supported
Device - BluetoothPartially supported
Device - GamepadNot supported
Device - NetworkNot supported
Device - ScreenPartially supported
Device - Accelerometer / Compass / Device Orientation / GyroscopeNot supported
Device - MemoryNot supported
AINot supported
WorkerPartially supported
Game Match ReplayNot supported
Game ServicesPartially supported
Third-party PlatformNot supported
AdsNot supported
ToolsNot supported