# DEVELOPMENT GUIDANCE

## 1 Development Process
* >  Step 1
Download open SDK [DOWNLOAD RESOURCES][1].

[1]: en-us/resources/DOWNLOAD-RESOURCES

* >  Step 2
Build an Android Application use AndroidStudio.

* > Step 3
Integrated the Robot Application into your application via open SDK.

* > Step 4
Turn on robot developer debug mode.

* > Step 5
Install your application in robot system.

## 2 The content of open SDK
<!-- | micrecord-sdk-release.aar|Microphone array raw data access| -->

| name | description |
| :-----| :---- |
| mini-outer-sdk.jar |the main jar package of OpenSDK |
| phonecall-sdk-release.aar | phone call skill related|
|protobuf-java-3.4.0.jar | jar package of protobuffer processing|
| eventbus-3.1.1.jar | jar package of event processing|



## 3 How to build an application ?

### 3.1   Create an application project

Open AndroidStudio, Create an Android Application project，and add the following content into AndroidManifest.xml:

Add Permission：

```javascript
1 <uses-permission android:name="com.ubtrobot.master.permission.MASTER"/>

2 <uses-permission android:name="com.ubtrobot.master.permission.MASTER_SYSTEM_SERVICE"/>
```



### 3.2  Integrate Open SDK

To integrate your application with RobotApplication under OpenSDK, please overwrite following functions in RobotApplication:

```javascript 
1 public class DemoApp extends RobotApplication
2    @Override
3    public void onCreate(){
4    super.onCreate();
5    }
6
7    /**
8    * if new application has conflicts with operating apps,
9      the new application will be failed to start
10    *@param ubtSkillinfo//Infomation of operating app
11    */
12    @Override
13    protected void onStartFailed(RobotApplication.UbtSkillInfo ubtSkillInfo){
14
15    }
16
17    /**
18    *if a high-priority apps has started,
19      the operating apps will be interrupted and ended within 5s,
20      please declare releasing resources in the function 
21    */
22    @Override
23    protected void onInterrupted(){
24
25    }
26 }
```



## 4 How to debug ?

We open adb debug mode for developers, default open.

To reduce the official apps cause conflicts during the debug, it is suggested to remove speechservice app on the robot



If the robot can’t be searched by the computer via USB, please try to turn on the USB mode in the way below: (suitable for Alpha Mini English Version)”



![debug](../pic/debug.png)



## 5 How to run your application?

It is highly recommended：

By [Vysor][1]:

1. Download and install [Vysor][1] on your PC，switch on AlphaMini robot and connect to the PC via a USB cable.

2. Open [Vysor][1], choose the device and click "view" and run your application in the popped window

[1]:https://www.vysor.io/

By ADB Command:

1. Switch on AlphaMini robot and connect to the PC via a USB cable

2. Start Activty or Service via adb command



## 6 How to release you application? 

If you need to release your application and integrate into factory setting, please contact UBTECH sales team (Email to: overseas@ubtrobot.com).