Clone the sample code
- Clone the library: git clone email@example.com:jiborobot/apptoolkit-android-library.git
- Open the folder you just cloned in Android Studio. Keep the default settings in any dialogs that open. There will likely be some build errors until you add your ID in the next section.
You need to add your ClientID to the app in order to run it on your robot.
- Right-click local.properties in the left sidebar, then select New > Resource Bundle from the menu.
- Type app as the Resource bundle name, then click OK.
- Add the following two lines to the file:
Code: Select all
app.id = id-here app.secret = secret-here
- Replace id-here in the code with your client ID.
- Replace secret-here in the code with your passcode.
- Click the Sync Gradle button (or Try Again in the alert bar.)
Run the app
- Click the Play button on the toolbar.
- If you have any issue installing apks, go to Preferences > Build, Execution, Deployment and deselect Instant Run.
- Choose a device to launch the app in.
- We recommend connecting a real mobile device in Developer Mode (see Hello World for steps on how to set up your phone), as the Android Studio emulators can often be buggy.
- Please note: If you are running into strange errors, try installing anything that Android Studio recommends.
- Click SIGN IN.
- Type your Jibo App email address and password, then click Sign in.
- When asked if you want to allow the app to connect to your robot, click Yes.
- Click the name of the robot you want to connect to.
- It may take a few minutes for the next screen to appear. Click Connect in the emulator. The app should connect to Jibo. Jibo's light ring will turn magenta, and a small magenta dot will appear on the bottom-right of his screen. (Note: the magenta light ring and dot may not appear depending on your permission level.)
The test app is an example of how you can connect an app to Jibo. Commands you select in the test app will control Jibo's behavior.
Here are some examples:
- Tap the Say button to hear Jibo say something.
- Select a LookAt position and tap the Look button to see Jibo turn in a new direction.
- Tap the Video button to see a stream of what Jibo sees. Tap the back button in the emulator to return to the command screen.
- Tap the Display button to see Jibo display text on his screen.
- Tap the Photo button to have Jibo snap a picture. The picture will pop up in your app. Press back to return to the home screen.
Other commands include: Screen Gesture, Fetch Asset, Listen, Motion, Look, and Set/Get Config. Some of these commands will not produce an action on Jibo's part, but you will be able to see "Success" logs if they are working correctly.
- Tap the Disconnect button to disconnect from the robot. Jibo returns to his normal state.
- Tap the back button in the emulator to return to the previous screen.
- Tap the LOG OUT button to remove access to remotely control the robot that is currently authenticated.hur5
- Click the Stop button on the Android Studio toolbar to close the emulator.
- For additional security, you can go to the Jibo app and toggle off the Enable remote control switch that you turned on when setting up your robot.
- The Look.EntityTarget command is not implemented.
- The Speech button (for listening for "Hey Jibo" specifically) is not implemented.
- When using the Motion command, make sure to click the Cancel button before moving to another command, or the on-screen logs will fill up.
- The Display button works but displays an incorrect error on the app screen.