NUWA Robot SDK Japanese Tutorial

ver 1.0

NUWA SDK

What is NUWA Robot SDK?

"NUWA Robot SDK" is an application development kit for robots made by NUWA Robotics. It is based on Android P, and it is possible to create apps using Android Studio.

Development environment and related materials

The NUWA Robot SDK supports the following development environments:

The latest information is available on the official website.

In addition to the Android Archive (aar) that includes the NUWA Robot API, sample code, tutorials, etc. are provided.

Role of this document

This document explains how to use the NUWA Robot SDK easily. For an overview of the NUWA Robot SDK, see the NUWA Robot SDK Manual, and for API details, see the NUWA Robot SDK Javadoc.

About the development equipment of this document

Kebbi's apps can be developed on both Windows and Mac. This document is developed on Mac.

Preparation of development environment

Android Studio is required for development. Please prepare the latest version of Android Studio.

Android Studio

Put Kebbi in developer mode

First, set Kebbi to developer mode by following the steps below.

Open the Kebbi settings screen and select "About Kebbi" at the bottom.

setting

If you hit "About Kebbi" in the menu 10 times in a row, the settings for developers will be added.

setting_end

Press "HOME SETTING" to move to the Android setting screen.

android_setting

From this screen, look for "build settings" in "device information" and hit "build number" repeatedly. "Developer options" is added to "Advanced" of "System".

Turn on the developer options to enable USB debugging. You can now connect your computer to Kebbi.

debug_on

Kebbi and PC connection

Connect Kebbi with a USB cable.

Create an Android app

Now let's create a simple app for Kebbi.

Start Android Studio and create a project.

Select Start a new Android Studio project to create a new project.

NewProject1

Select the project type.

Select "Empty Activity".

NewProject2

Decide on a project name

This time, I named it "Hello Kebbi".

NewProject3

Library settings

Set the library to use the NUWA Robot API.

Copy AAR file

First, select "Project" from the menu on the upper left.

aar1

Then copy the latest .aar file of the NUWA SDK to the libs folder inside the app folder.

aar2

If the copy is successful, it will look like this.

aar3

Add the following description to the very end of "build.gradle" in the app folder.

aar4

Finally, add the following to the end of the dependencies of "build.gradle".

aar5

API initialization

Now let's create a program.

Look for MainActivity.java in the src folder inside the app folder.

main1

Add the following line to AppCompatActivity. (The import for using the NuwaRobot API is automatically added. The same applies below.)

main2

Describe the initial processing for using the API in onCreate. Also, prepare a function to handle the event. Rewrite onCreate as follows.

main3

Event listener

Next, let's define a listener for events that originate from Kebbi.

Please do not copy and paste the following in the "void register NuwaRobotListener" created earlier.

Then, input assistance will appear like this, so select it.

event1

Because there is an error in the closing parenthesis

event2

Fix it like this.

event3

After fixing it, try adding the following programs as well.

Finally, the registerNuwaRobotListener looks like this: If you are having trouble with input assistance, try copying the following sources.

The program is now ready!

Hello! Kebbi!

Thank you for waiting! Let Kebbi speak. From the event listeners you added earlier, find onWikiServiceStart and modify it as follows. This event is an event that will be called after the API has been initialized.

Finally, let's log one more thing to the event listener.

onTTSComplete is an event that is called when Kebbi's utterance is over. This is useful if you want Kebbi to speak and move continuously. This is the first time, so let's check the log.

Let's run the program!

Now let's run the program. If Kebbi is connected to your computer, Kebbi should be displayed in the upper left corner of the model name. Press the play button and the program will run!

run1

How is it? Did Kebbi talk to you? By the way, let's check the log as well. It is convenient to enter "KEBBI" in the log search because unnecessary logs will not be displayed.

run2

Exit the app

To close the app, press the stop button in Android Studio. Even if you press the button on Kebbi's head, it looks like it's finished, but the app is actually working.

end1

The run app will be automatically added to Kebbi's menu. From the next time onwards, you can also start the app from here.

end2

Just like any other app, you can specify the program name or change the icon to a nice one, and you will have your own original app!

Tutorial completed!

Thank you for your support, this completes the tutorial. I hope you understand the basic flow of creating a Kebbi app. However, there are still many things I would like to try, right?

First of all

[NUWA Robot SDK Manual] NUWA Developer

Let's read. This document is a complete introduction to how to use the API to create Kebby apps. Also, sample programs etc. are published on the official website, so please refer to them.

For example ...

There are some simple example for your reference.

[NUWA SDK Example Github] Sample Code

You will be able to do such things!