Skip to content

Commit f3e679a

Browse files
committed
docs: add bilingual README (EN/ZH) for all demo projects
- Add standardized README.md (English) and README_zh-cn.md (Chinese) for all demo projects - Rename inconsistent Readme.md/Readme_zh-cn.md to standard README.md/README_zh-cn.md - Add language switch links at the top of each README - Update top-level README.md and README_zh-cn.md index with links to all projects - Remove deprecated music_player2/README-en.md (content moved to README.md) - Generate bilingual READMEs based on original content where available Affected projects: bandx, breakout, calculator, hourglass, music_player, music_player2, pet, relation_calculator, snake_game, utils, x_track Signed-off-by: v-tangmeng <v-tangmeng@xiaomi.com>
1 parent 42fd047 commit f3e679a

File tree

26 files changed

+1994
-633
lines changed

26 files changed

+1994
-633
lines changed

README.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
1-
# Demo
1+
# Demo
22

33
\[ English | [简体中文](README_zh-cn.md) \]
44

5-
## Overview
5+
## Overview
66

7-
This repository implements examples of openvela native application code. Developers can quickly get started with development based on our documentation and examples.
7+
This repository implements examples of openvela native application code. Developers can quickly get started with development based on our documentation and examples.
88

9-
## Usage Instructions
9+
## Demo List
1010

11-
- [Bicycle Computer](../../../docs/blob/dev/en/demo/X_Track.md)
12-
- [Breakout Game](breakout/Readme.md)
13-
- [Calculator](calculator/Readme.md)
14-
- [Hourglass](hourglass/Readme.md)
15-
- [Music Player](../../../docs/blob/dev/en/demo/Music_Player_Example.md)
16-
- [Music Player 2](music_player2/README-en.md)
17-
- [Relation Calculator](relation_calculator/Readme.md)
18-
- [Smart Band](../../../docs/blob/dev/en/demo/Smart_Band_Example.md)
19-
- [Snake Game](snake_game/Readme.md)
20-
- [Virtual Pet](pet/README.md)
21-
- [Whackmole](Whackmole/README.md)
22-
- [Wooden Fish](wooden_fish/README.md)
11+
| Demo | Description |
12+
|------|-------------|
13+
| [BandX](bandx/README.md) | Smart band UI demo |
14+
| [Breakout](breakout/README.md) | Brick breaker game |
15+
| [Calculator](calculator/README.md) | Calculator with expression evaluation |
16+
| [Hourglass](hourglass/README.md) | Digital hourglass timer |
17+
| [MiMo](mimo/README.md) | Xiaomi MiMo AI model provider |
18+
| [Music Player](music_player/README.md) | Music player application |
19+
| [Music Player 2](music_player2/README.md) | Enhanced music player with splash screen |
20+
| [Virtual Pet](pet/README.md) | Interactive virtual pet |
21+
| [Relation Calculator](relation_calculator/README.md) | Chinese family relation calculator |
22+
| [Snake Game](snake_game/README.md) | Classic snake game |
23+
| [Utils](utils/README.md) | Shared demo utility library |
24+
| [Whack-a-Mole](Whackmole/README.md) | Whack-a-mole game |
25+
| [Wooden Fish](wooden_fish/README.md) | Digital wooden fish |
26+
| [X-TRACK](x_track/README.md) | Bicycle computer / GPS tracker |

README_zh-cn.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,23 @@
44

55
## 简介
66

7-
该仓库实现了 openvela native应用代码示例,开发者可以根据我们的文档和示例,快速上手开发
7+
该仓库实现了 openvela native 应用代码示例,开发者可以根据文档和示例快速上手开发
88

9-
## 使用说明
9+
## 演示列表
1010

11-
- [音乐播放器](../../../docs/blob/dev/zh-cn/demo/Music_Player_Example_zh-cn.md)
12-
- [智能手环](../../../docs/blob/dev/zh-cn/demo/Smart_Band_Example_zh-cn.md)
13-
- [自行车码表](../../../docs/blob/dev/zh-cn/demo/X_Track_zh-cn.md)
14-
- [计算器](calculator/Readme.md)
15-
- [亲戚计算器](relation_calculator/Readme.md)
16-
- [打地鼠](Whackmole/README_zh-cn.md)
17-
- [音乐播放器2](music_player2/README.md)
18-
- [打砖块](breakout/Readme.md)
19-
- [电子沙漏](hourglass/Readme.md)
20-
- [贪吃蛇](snake_game/Readme.md)
21-
- [虚拟宠物](pet/README.md)
22-
- [电子木鱼](wooden_fish/README_zh-cn.md)
11+
| 演示 | 说明 |
12+
|------|------|
13+
| [智能手环 BandX](bandx/README_zh-cn.md) | 智能手环 UI 演示 |
14+
| [打砖块 Breakout](breakout/README_zh-cn.md) | 经典打砖块游戏 |
15+
| [计算器 Calculator](calculator/README_zh-cn.md) | 支持表达式求值的计算器 |
16+
| [电子沙漏 Hourglass](hourglass/README_zh-cn.md) | 电子沙漏计时器 |
17+
| [MiMo AI](mimo/README_zh-cn.md) | 小米 MiMo AI 大模型接入组件 |
18+
| [音乐播放器](music_player/README_zh-cn.md) | 音乐播放器应用 |
19+
| [音乐播放器 2](music_player2/README_zh-cn.md) | 增强版音乐播放器(含启动页) |
20+
| [虚拟宠物](pet/README_zh-cn.md) | 交互式虚拟宠物 |
21+
| [亲戚计算器](relation_calculator/README_zh-cn.md) | 中国亲戚关系计算器 |
22+
| [贪吃蛇](snake_game/README_zh-cn.md) | 经典贪吃蛇游戏 |
23+
| [工具库 Utils](utils/README_zh-cn.md) | 共享演示工具库 |
24+
| [打地鼠](Whackmole/README_zh-cn.md) | 打地鼠游戏 |
25+
| [电子木鱼](wooden_fish/README_zh-cn.md) | 电子木鱼 |
26+
| [自行车码表 X-TRACK](x_track/README_zh-cn.md) | 自行车码表 / GPS 追踪器 |

bandx/README.md

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# Smart Band
2+
3+
English | [中文](README_zh-cn.md)
4+
5+
## Introduction
6+
7+
Bandx is a smart band demo that incorporates watch dial, launcher, music, heart rate, stopwatch, sleep, sports, settings and flashlight, with a resolution of 194 x 368 pixels.
8+
9+
This article describes how to run this example on Emulator.
10+
11+
## Prerequisites
12+
13+
To download the source code, see [Quick Start](https://github.com/open-vela/docs/blob/dev/en/quickstart/openvela_ubuntu_quick_start.md).
14+
15+
## Step 1: Configure the project
16+
17+
1. Switch to the root directory of openvela repository and execute the following command to configure Bandx.
18+
19+
**Note**: The emulator configuration file (defconfig) is in the "vendor/openvela/boards/vela/configs/goldfish-armeabi-v7a-ap/" directory, and the emulator code is configured and compiled using "build.sh".
20+
21+
```Bash
22+
./build.sh vendor/openvela/boards/vela/configs/goldfish-armeabi-v7a-ap menuconfig
23+
```
24+
25+
- build.sh: A script for compilation used to configure and compile openvela code.
26+
- vendor/openvela/boards/vela/configs/goldfish-armeabi-v7a-ap: configuration path
27+
- menuconfig: Open the menuconfig page to modify the configuration of the project code.
28+
29+
2. Press the "/" key to search and modify the following configurations:
30+
31+
```Bash
32+
LV_USE_FRAGMENT = y
33+
LVX_USE_DEMO_BANDX = y
34+
BANDX_BASE_PATH = "/data"
35+
```
36+
37+
Take **LV_USE_FRAGMENT** as an example for illustration. The other configurations are modified is the same way.
38+
39+
1. Enter the configuration to be searched.
40+
2. Press "Enter" to go to the configuration page.
41+
3. Press "Enter" to open the configuration, and a \* that appears in [ ] indicates that the configuration is opened.
42+
4. Press the "/" key to continue searching for the remaining configurations, and modify them as described above.
43+
5. Press the letter Q to bring up the exit Save screen.
44+
6. Press the letter Y to save the configuration and exit the Modify Configuration page.
45+
46+
## Step 2: Compile the project
47+
48+
1. Switch to the root directory of openvela repository and execute the following commands one by one in a terminal:
49+
50+
```Bash
51+
# Clean up build artifacts
52+
./build.sh vendor/openvela/boards/vela/configs/goldfish-armeabi-v7a-ap distclean -j8
53+
54+
#Start to build
55+
./build.sh vendor/openvela/boards/vela/configs/goldfish-armeabi-v7a-ap -j8
56+
```
57+
58+
2. After successful execution, you will get the following files:
59+
60+
```plaintext
61+
./nuttx
62+
├── vela_ap.elf
63+
├── vela_ap.bin
64+
```
65+
66+
## Step 3: Launch the emulator and push resources
67+
68+
The font and image resources used in Bandx are located in 'apps/packages/demos/bandx/resources/'. To push these resources to the corresponding file paths mounted by the emulator, follow the steps below.
69+
70+
1. Switch to the root directory of openvela repository and start the emulator:
71+
72+
```bash
73+
./emulator.sh vela
74+
```
75+
76+
2. Push resources to the device by using emulator-supported ADB. Open a new terminal in the root directory of openvela repository, type "adb push" followed by the file path to transfer the resources to the appropriate location.
77+
78+
```bash
79+
# Install adb
80+
sudo apt install android-tools-adb
81+
82+
# Push resources
83+
adb push apps/packages/demos/bandx/resource/font/assets/* /data/font/
84+
adb push apps/packages/demos/bandx/resource/image/assets /data/image/
85+
```
86+
87+
**Note**: If "BANDX_BASE_PATH" is changed to a non-default value like "/tmp", the resource files must also be moved to the "/tmp/font/" and "/tmp/image/" directories. Otherwise, a "resource not found" error will occur.
88+
89+
## Step 4: Start Bandx
90+
91+
1. Enter the following command in the emulator's terminal environment "openvela-ap":
92+
93+
```Bash
94+
bandx &
95+
```
96+
97+
2. To access the Launcher screen, swipe quickly from right to left. Single-click different icons to navigate to subpages, such as the Heart Rate page. To exit the page, swipe quickly from left to right.
98+
99+
**Note**: The music page is just a UI display, with no access to audio.
100+
101+
3. Turn on "Auto-show" in settings to auto-play the entire application. Turn off "Auto-show" to end playing it.
102+
103+
## Step 5: Exit Demo
104+
105+
Shut down the emulator to exit Demo.
106+
107+
## FAQ
108+
109+
### 1. adb command not found
110+
111+
#### Reason
112+
113+
The "adb" tool is not installed.
114+
115+
#### Solution
116+
117+
Install "adb" and execute the following command:
118+
119+
``` Bash
120+
sudo apt install android-tools-adb
121+
```
122+
123+
### 2. Garbled text is shown
124+
125+
#### Reason
126+
Font resources are not loaded correctly.
127+
128+
#### Solution
129+
130+
Follow [Step 3](#step-3-launch-the-emulator-and-push-resources) to push resources.

bandx/README_zh-cn.md

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# 智能手环
2+
3+
[English](README.md) | 中文
4+
5+
## 简介
6+
7+
该应用是一款智能手环演示,包括手表表盘、启动器、音乐、心率、秒表、睡眠、运动、设置、手电筒,分辨率为 194*368。
8+
9+
本文介绍如何在模拟器上运行该示例。
10+
11+
## 前提条件
12+
13+
下载源码,请参见[快速入门](https://github.com/open-vela/docs/blob/dev/zh-cn/quickstart/openvela_ubuntu_quick_start.md)
14+
15+
## 步骤一 配置项目
16+
17+
1. 切换到 openvela 仓库的根目录,执行如下命令来配置手环 Bandx。
18+
19+
**说明**:模拟器配置文件(defconfig)在 `vendor/openvela/boards/vela/configs/goldfish-armeabi-v7a-ap/` 目录下,使用 `build.sh` 配置和编译模拟器的代码。
20+
21+
```cpp
22+
./build.sh vendor/openvela/boards/vela/configs/goldfish-armeabi-v7a-ap menuconfig
23+
```
24+
25+
- build.sh:编译脚本,用来配置和编译 openvela 代码
26+
- vendor/openvela/boards/vela/configs/goldfish-armeabi-v7a-ap:配置路径
27+
- menuconfig:打开 menuconfig 页面,修改项目代码的配置。
28+
29+
2. 按下 `/` 键逐个搜索修改如下配置项:
30+
31+
```Bash
32+
LV_USE_FRAGMENT = y
33+
LVX_USE_DEMO_BANDX = y
34+
BANDX_BASE_PATH = "/data"
35+
```
36+
37+
以 LV_USE_FRAGMENT 为例进行操作,其余配置方式相同。
38+
39+
1. 输入待搜索的配置。
40+
2. 按下`Enter`进入到配置页面。
41+
3. 按下`Enter`键打开该配置,`[ ]` 中出现 `*` 表示该配置被打开。
42+
4. 按下 `/` 键可以继续搜索剩下的配置,并按上述步骤修改其余配置。
43+
5. 按下字母`Q`键,弹出退出保存界面。
44+
6. 按下字母`Y`键保存配置,并退出修改配置页面。
45+
46+
## 步骤二 编译项目
47+
48+
1. 切换到 openvela 仓库的根目录,在终端内依次执行如下命令:
49+
50+
```Bash
51+
# 清理构建产物
52+
./build.sh vendor/openvela/boards/vela/configs/goldfish-armeabi-v7a-ap distclean -j8
53+
54+
# 开始构建
55+
./build.sh vendor/openvela/boards/vela/configs/goldfish-armeabi-v7a-ap -j8
56+
```
57+
58+
2. 成功执行后,将得到以下文件:
59+
60+
```plaintext
61+
./nuttx
62+
├── vela_ap.elf
63+
├── vela_ap.bin
64+
```
65+
66+
## 步骤三 启动模拟器并推送资源
67+
68+
Bandx 中使用的字体和图像资源位于 `apps/packages/demos/bandx/resources/` 中,要将这些资源推送到模拟器挂载的相应文件路径,可以按照以下步骤操作。
69+
70+
1. 切换到 openvela 仓库的根目录,启动模拟器:
71+
72+
```bash
73+
./emulator.sh vela
74+
```
75+
76+
2. 使用模拟器支持的 `ADB` 将资源推送到设备,在 openvela 仓库的根目录下打开一个新的终端,输入 `adb push` 后跟文件路径,即可将资源传输到相应位置。
77+
78+
```bash
79+
# 安装adb
80+
sudo apt install android-tools-adb
81+
82+
# 推送资源
83+
adb push apps/packages/demos/bandx/resource/font/assets/* /data/font/
84+
adb push apps/packages/demos/bandx/resource/image/assets /data/image/
85+
```
86+
87+
如果将 `BANDX_BASE_PATH` 更改为非默认值,如 `/tmp`,则资源文件也必须传输到 `/tmp/font/` 和 `/tmp/image/` 目录。否则将出现找不到资源的错误。
88+
89+
## 步骤四 启动 Bandx
90+
91+
1. 在模拟器的终端环境 `openvela-ap>` 中输入如下命令:
92+
93+
```Bash
94+
bandx &
95+
```
96+
97+
2. 要访问 Launcher 界面,`从右向左`快速滑动。单击不同的图标导航到子页面,如 Heart Rate 页面。要退出页面,`从左向右`快速滑动。
98+
99+
**说明**:music页面只是UI展示,没有接入音频。
100+
101+
3. 打开 settings 中的 `Auto-show`,将会自动播放整个应用;关闭 `Auto-show`,自动播放就结束。
102+
103+
## 步骤五 退出 Demo
104+
105+
关闭模拟器退出 Demo。
106+
107+
## 常见问题
108+
109+
### 1. adb 命令找不到
110+
111+
#### 原因
112+
113+
未安装 `adb` 工具。
114+
115+
#### 解决方案
116+
117+
安装 `adb`,执行以下命令:
118+
119+
``` Bash
120+
sudo apt install android-tools-adb
121+
```
122+
123+
### 2. 字体显示为乱码
124+
125+
#### 原因
126+
127+
未正确加载字体资源。
128+
129+
#### 解决方案
130+
131+
请按[步骤三](#步骤三-启动模拟器并推送资源)进行资源推送。

breakout/README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Breakout - Brick Breaker Game
2+
3+
English | [中文](README_zh-cn.md)
4+
5+
A classic breakout (brick breaker) game demo built with LVGL on OpenVela/NuttX. Control a paddle to bounce a ball and destroy bricks.
6+
7+
## Features
8+
9+
- Classic breakout gameplay
10+
- Touch/input-based paddle control
11+
- LVGL-based graphics rendering
12+
- libuv event loop integration
13+
14+
## Configuration
15+
16+
Enable in menuconfig:
17+
18+
```
19+
LVX_USE_DEMO_BREAKOUT=y
20+
LVX_BREAKOUT_DATA_ROOT="/data"
21+
LVX_BREAKOUT_STACKSIZE=65536
22+
```
23+
24+
## Project Structure
25+
26+
```
27+
breakout/
28+
├── src/
29+
│ └── breakout.h # Game logic declarations
30+
├── breakout_main.cpp # Application entry point (C++)
31+
├── Kconfig # NuttX configuration
32+
├── CMakeLists.txt # CMake build script
33+
└── Makefile # Make build script
34+
```
35+
36+
## Usage
37+
38+
```bash
39+
nsh> breakout
40+
```
41+
42+
## Build
43+
44+
```bash
45+
./build.sh <your-board-config> -j8
46+
```

0 commit comments

Comments
 (0)