Compiling and Running the Sample (Copied from the AppToolkit docs)

Locked
Arthur
Site Admin
Posts: 30
Joined: Sun Mar 31, 2019 4:23 am

Compiling and Running the Sample (Copied from the AppToolkit docs)

Post by Arthur » Wed Apr 03, 2019 7:14 pm

This page shows you how to authenticate, connect, and run an Android app made with the Jibo App Toolkit. For documentation on how to create your own app, see Hello World.

Clone the sample code
  1. Clone the library: git clone git@github.com:jiborobot/apptoolkit-android-library.git
  2. 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.
Add Client ID
You need to add your ClientID to the app in order to run it on your robot.
  1. Right-click local.properties in the left sidebar, then select New > Resource Bundle from the menu.
  2. Type app as the Resource bundle name, then click OK.
  3. Add the following two lines to the file:

    Code: Select all

    app.id = id-here
    app.secret = secret-here
    
  4. Replace id-here in the code with your client ID.
  5. Replace secret-here in the code with your passcode.
  6. Click the Sync Gradle button (or Try Again in the alert bar.)
Note: Don't be alarmed if you don't see the file in the sidebar. This is normal.

Run the app
  1. Click the Play button on the toolbar.
    • If you have any issue installing apks, go to Preferences > Build, Execution, Deployment and deselect Instant Run.
  2. 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.
Sign in
  1. Click SIGN IN.
  2. Type your Jibo App email address and password, then click Sign in.
  3. When asked if you want to allow the app to connect to your robot, click Yes.
Connect
  1. Click the name of the robot you want to connect to.
  2. 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.)
Run on a robot
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:
  1. Tap the Say button to hear Jibo say something.
  2. Select a LookAt position and tap the Look button to see Jibo turn in a new direction.
  3. 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.
  4. Tap the Display button to see Jibo display text on his screen.
  5. 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.
You can track the commands in the log section at the bottom of the app screen. Scroll down for more logs.

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.

Disconnect
  1. Tap the Disconnect button to disconnect from the robot. Jibo returns to his normal state.
Log out
  1. Tap the back button in the emulator to return to the previous screen.
  2. Tap the LOG OUT button to remove access to remotely control the robot that is currently authenticated.hur5
  3. Click the Stop button on the Android Studio toolbar to close the emulator.
  4. 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.
Known Issues
  • 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.

Locked