APP Builder – Example [Hello World]
Welcome to ASUS Zenbo App application development!
This example teaches you how to build your first Zenbo app with App Builder. You’ll learn how to create a project with App Builder and run it within Zenbo simulator. Before deploy onto Zenbo devcies, you need to export a project as a zba file. You'll also learn some fundamentals of Zenbo design, including how to build a simple user interface, multimedia player, move Zenbo body and handle conversational dialouge.
Scenario:
Zenbo starts playing music and flashing his wheels' LED. He moves forward 50 centimeters, then turns a full circle and looks up.
Zenbo: ‘Hello, my name is Zenbo’.
Zenbo invites someone to some his performances.
Zenbo: ‘Would you like to see my performances?’
Zenbo show an option on screen for user choosing.
Someone: ‘Music’ (or ‘Movie’)
Zenbo start playing music or movie by chosen.
Programing:
How to build a Zenbo ZBA APP:
Analysis Flow & Blocks:
No. |
Action |
API |
Note |
1 |
Start a program |
|
|
2 |
Zenbo play music |
[Play Media at Non-Blocking] Media source: Select which music you want to play from your PC Volume: 80% Duration: 30 secs |
|
3 |
Zenbo flashes wheels’ LED |
[Wheel LED at Non-Blocking] Side: Both Type: Breathing Led number: All Color: Red (select color from palette) Brigtness: 80% Duration: 30 secs |
|
4 |
Zenbo moves forward 50 centimeters |
[Body Movement] Type: Blocking Speed: 1 (Level) Direction: Forward Distance: 30 cm |
|
5 |
Zenbo turn a full circle |
[Body Rotation] Type: Blocking Speed: 1 (Level) Angle: 360 ̊ |
|
6 |
Zenbo looks up |
[Neck Movement] Type: Blocking Speed: 1 (Level) Vertical: 30 ̊ Horizontal: 0 ̊ |
|
7 |
Zenbo say hello |
[Speak] Speak: Hello, my name is Zenbo. Speed: Medium |
|
8 |
Zenbo invites someone listen music or watch movie |
[ListView UI] TTS:
Title:
IntentID:
Event1:
Event2:
|
|
9 |
Music event receiver |
[When receive] Event’s ID: music |
|
10 |
Play music |
[Play media at non-blocking] Media source: by chose Volume: 80% Duration: 30 secs |
|
11 |
Dancing with music playback at same time |
[Recursive Moves] Action: by chose Duration: 30 secs |
|
12 |
Movie event receiver |
[When receive] Event’s ID: video |
|
13 |
Play video |
[Play media at blocking] [Media source]: by chose Volume: 80% Duration: 30 secs |
- Register APP:
Register APP at developer site
- Please register APP on ASUS developer site https://zenbo.asus.com/developer/
Prepare APP info
- Using Tool
Please choose option ‘Zenbo App Builder’.
- App Name
This example App name is ‘ZBAHelloWorld’
- Package Name:
Because package name is unique, please create a new package name for your App. Please be informed there is a prefix ‘com.asus.robot.appbuilder’ adding on before you App name. The application naming format is like as ‘xxx.xxx’.
This example package name is ‘com.asus.robot.appbuild.zba.helloworld’
- Version
Please fill out your App version.
- Platform
Default is ‘Zenbo’
- Are you plan to use Zenbo DDE system
If App is planning using Zenbo dialogue system, please choose ‘yes’.
- App ID:
An App ID is generated automatically after APP registered.
- Config dialogue:
- Developer can configure App dialogue using ASUS Zenbo DDE. (https://stage-developer.asus.com/documents/The-DDE-Tutorial/Welcome)
Project and APP Info
Please create a project for a new App and fill out App ID on DDE editor, and then start editing App dialogue.
All App info will be automatically filled out once App ID filled in.
Editing dialogue
- Plan
- Launch App
ID: launchhelloworld
Event:
- Type: CSR
- Intent ID: launchhelloworld_en
- List performances
ID: listperformance
Input Context: performance
-
- Type: CSR
- Intent ID: listperformance_en
Belief:
- required: required
- ID: media (by user defined)
- Classes: performance
- Intent
- Launch App
ID: launchhelloworld_en
Sentences:
- Launch hello world
- Open hello world
- Run hello world
- List performances
ID: listperformance_en
performance:media [Class]:[Belief]
- Concept
- Define performance
Class: performance
- ID:
Key: music
Value: 音樂、music
- ID:
Key: video
Value 影片、video
- Build a ZBA APP:
New a project and select its default language
Interlocking blocks:
According to scenario analysis to interlock APP
Run APP on Zenbo simulator:
Run APP on Zenbo:
Connecting to Zenbo by IP (Refer to below screenshot)
- Find Zenbo IP address from Zenbo’s about status at Android Settings.
- Fill out Zenbo IP on Connection dialog.
- APP will transfer to Zenbo after connection build up.
APP .zba file
Save project
Fill out APP information on the form before saving your project, and the relevant information should be from APP registered data at developer site.
- Example download
ZBA sample code:
https://www.asuswebstorage.com/navigate/s/CA5CDA8CAA804090AD3114335EE9C71F4
DDE sample:
https://www.asuswebstorage.com/navigate/s/B828C582099E4FA09BB292BC3FED9D314