This demonstration illustrates how to construct a basic browser application within HarmonyOS. It utilizes the @ohos.systemparameter interface alongside the native Web component to enable core functionalities such as rendering web content and managing the navigation history stack. Application Usage E...
This example demonstrates how to implement basic game controls using H5, leveraging the button component in ArkUI to showcase the ability to inject and execute JavaScript in a WebView, as well as communication between native applications and H5 pages. The H5 game page used in this example is provid...
Project anatomy A ArkTS application is organized as a multi-level tree of configuration and source files: AppScope/app.json5 – global settings for the whole application. entry/ – the primary module; when built it becomes an installable HAP package. entry/src/main/ets/ – ArkTS source code. entry/src/...
Actor Model Overview ArkTS utilizes the Acter model for concurrent execution. In this architecture, computation is divided into independent actors. Each actor encapsulates its own state and behavior, communicating exclusively through asynchronous message passing. This isolation eliminates shared mem...
Day One Initialize a new NPM project (follow the prompts): npm init Install TypeScript, TSLint, and Node.js type definitions: npm install -s typescript tslint @types/node Create a file named tsconfig.json in the root directory and add the following configuraton: { "compilerOptions": { &quo...
Using the GPIO Interface to Register Interrupt Handlers for USER Button Response (Input) Set the internal pull-up/down state with IoSetPull (if no external pull-up resistor is present, it must be enabled to reliably detect falling edges). Register the interrupt handler using GpioRegisterIsrFunc. Ref...
Overview The Button component serves as a fundamental interactive element in HarmonyOS applications, enabling users to trigger actions and submit data. This guide covers the essential features and implementation patterns for working with Button components in ArkUI. Core Functions The Button componen...
Navigation Overview Introduction to Navigation Navigation serves as the root view container for routing navigation and typically acts as the root container for page components (@Entry). It supports three display modes: stack, split, and auto. The Navigation component handles intra-module and cross-m...
ArkUI provides several methods for building responsive user interfaces. This guide demonstrates three primary approaches using the classic "Hello World" example as a base. Using Grid and GridItem Components The Grid and GridItem components offer a straightforward way to create responsive g...
HTTP Data Requests Encapsulate the @ohos.net.http module to manage network requests efficiently. import http from '@ohos.net.http'; interface NetworkOptions { endpoint?: string; httpMethod?: HttpMethod; queryParameters?: Record<string, string>; payload?: string | Object | ArrayBuffer; headers?...