Main File Descriptions

uBox.dll

Main entry file of the SDK and monitoring functionality.

JuBox.jar

An extension that adds functionalities like screenshot, network data statistics, etc.

Create App

If you've created an application for your project, just go to Step2 and use the Appkey of your application to integrate with uBox following the instructions.

The Appkey, which is the unique key of an application, can be used in both Crasheye and uBox.

If you need to create a new app for your project, click Create New App and follow the steps to integrate.

SDK Integrate

1. Download and decompress the SDK file uBox-sdk.zip

2. Import matching uBox unitypackage to your project.

Unity Version uBox SDK
4.6.* - 5.0.* uBox4.6_to_5.0.unitypackage
5.1.* - 5.2.* uBox5.1_to_5.2.unitypackage
5.3.* uBox5.3.unitypackage
5.4.* uBox5.4.unitypackage
5.5.* uBox5.5.unitypackage
5.6.* - 2017.3.* uBox5.6_to_2017.3.unitypackage
2017.4.* - 2018.2.* uBox2017.4_to_2018.2.unitypackage
≥ 2018.3.* uBox2018.3.unitypackage

ps. Because of the changes of Unity API on 2018.1 – 2018.2 version, deep performance data cannot be captured.

3. If Java language is used in your project, then JuBoxInterface class from JuBox.jar should be imported into class Main Activity.(demo.rar)
ps. JuBox.jar is required to be packaged, or it might appear some exceptions on Android devices, such as screenshot and basic perf monitoring. Use jubox_empty.jar to replace the jubox.jar when packaging a release version APK, avoiding to consume cpu resource.
For more details, please refer to demoActivity.javaand JuBoxActivity.java

4.Draw three buttons in your Unity project and call the following APIs to activate and deactivate monitoring.
Activate Basic Performance Monitoring: ( the API is android-exclusive, and is available when the Scripting Backend is set as mono)
Call the APIuBoxInterface.StartLiteBoxfromuBox.dll
ps. this API cannot be called together with APIuBoxInterface.StartRecord

Activate Deep Performance Monitoring:Call the API uBoxInterface.StartRecord from uBox.dll
Deactivate Monitoring: Call the API uBoxInterface.StopRecordAndUpload from uBox.dll.

/** Activate Monitoring **/
uBoxInterface.StartRecord(AppKey, version, startProfiler, startCapture, startNetwork, startRecource)
/** Deactivate Monitoring **/ uBoxInterface.StopRecordAndUpload(compress, internet)
/** Activate Basic Performance Monitoring **/ uBoxInterface.StartLiteBox(AppKey, version, accountStr, startResource, startMemory, startWwise,startStack)

Parameters Meaning
AppKey The unique key of your app. Register your app on our official website to obtain Appkey (String)
version Current version of your app. (String)
accountStr Email address of your uBox account (String, to filter reports by account, cannot be null). If you don’t have an email account, you can pass any string but null.
startResource Enable to monitor resource. To observe if there is resource leak, and if the resource size meets the standard.
startMemory Enable to monitor memory. (Boolean, true to enable)
startWwise Enable to monitor wwise, only effective to sound effects using wwise. (Boolean, true to enable)/**** Don’t enable this functionality if wwise plugin is no used. ****/
startStack Enable to monitor stacks. Capture stacks per 1000 frames automatically. (Boolean, true to enable)
compress Enable to compress the report file (Invalid)
internet enable to upload to outer server (Boolean, true to enable)

ps. The functionalites are costly. To get basic performance data only, e.g. FPS, please set these parameters FALSE: startResource, startMemory, startWwise, startStack.

/** Activate Monitoring **/
uBoxInterface.StartRecord(AppKey, version, startProfiler, startCapture, startNetwork, startRecource, accountStr)

Parameters Meaning
AppKey The unique key of your app. Register your app on our official website to obtain AppKey. (String)
version Current version of your app. (String)
startProfiler Enable to monitor profiler that covers CPU, memory, rendering, stack trace of function calls, etc. (Boolean, true to enable)
startCapture Enable to monitor screenshot. (Boolean, true to enable)
startNetwork Enable to monitor network data. (Boolean, true to enable)
startResource Enable to monitor resources and assets that covers resource leak and checks if the asset size meets requirement, etc. (Boolean, true to enable)
accountStr Email address of your uBox account (String, to filter reports by account, cannot be null). If you don’t have an email account, you can pass any string but null.

5. Configure AndroidManifest.xml
Configure permission settings etc. in AndroidManifest.xml, as demonstrated in the following code sample:

<application ......>
    <!-- android:name="com.kingsoft.ubox.JuBoxActivity" Required --> 
    <android:name="com.kingsoft.ubox.JuBoxActivity">
</application>
<!-- SDK minimum version is 14, Required --> <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23" />
<!-- Permission settings, Required --> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_PHONE_STATE"/> <uses-permission android:name="android.permission.READ_LOGS" />

If there is no AndroidManifest.xml in your project, you can use the AndroidManifest.xml in demo file.

6.(Optional) Call the API uBoxInterface.SetUploadIP from the SDK if you are using uBoxtool from the official website. The API is intended to transfer testing data to the PC that runs uBoxtool and upload them to server.
Use uBoxInterface.SetUploadIP (string ip, int port) in uBox.dll.
ps. the API is required to be called before activating monitoring. The data will be uploaded to server automatically.uBoxInterface.StartRecord

7. Check the "Development Build" checkbox in Build Settings dialog.

Upload Data

1. After the integration is completed correctly, try to run some tests on the phone. Activate monitoring when you start to test and deactivate when you finish the test. When you deactivate monitoring, the data will be uploaded to server automatically so you can see performance analysis reports in admin panel.

2. Go to admin panel, click uBox of your app to see report list.

3. Click one of the reports to view details.

uboxtool Walkthrough

Description: uBox is intended to solve the upload failure and long uploading time problem that are caused by unstable network and too much data. You can transfer testing data from phone to PC to compress and upload them to uBox server by using uBoxtool.

1. Call the API SetUploadIP from the SDK as instructed earlier in the document, then create two input fields where you can enter IP address and port in the game.

2. Download uBoxtool from uBox official website.

3. Start uBoxtool on your computer.

4. Enter the computer’s IP and port in the two input fields in your game on the phone (you can see the IP and port in uBoxtool window).

5. Click Start button in uBoxtool, activate monitoring in the game then you can start testing.

6. Stop monitoring after you finishes testing, then the testing data will be transferred to PC, compressed and uploaded to server automatically (make sure the phone and PC are on the same LAN.).