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:
| Module | Support Status |
|---|---|
| Basics - App-level Events | Partially supported |
| Basics - Performance | Partially supported |
| Basics - Debugging | Partially supported |
| Forwarding | Partially supported |
| Data Cache | Partially supported |
| Rendering | Partially supported |
| Media - Audio | Partially supported |
| Media - Image | Partially supported |
| Media - Recording | Not supported |
| Media - Camera | Not supported |
| Media - Video Decoder | Not supported |
| Media - Real-time Voice | Supported |
| File | Partially supported |
| Open Interface - Cards & Coupons | Not supported |
| Device - Bluetooth | Partially supported |
| Device - Gamepad | Not supported |
| Device - Network | Not supported |
| Device - Screen | Partially supported |
| Device - Accelerometer / Compass / Device Orientation / Gyroscope | Not supported |
| Device - Memory | Not supported |
| AI | Not supported |
| Worker | Partially supported |
| Game Match Replay | Not supported |
| Game Services | Partially supported |
| Third-party Platform | Not supported |
| Ads | Not supported |
| Tools | Not supported |
