Overview
This document is used to guide Yolanda customers to access Yunkangbao's smart devices.
The SDK supports devices, please refer to Device Type
Docking steps
1. Business application
Sign a cooperation agreement with Yolanda business staff, our company will provide the appid
andconfiguration file
required for development
We will provide a form, as long as you fill out the form according to the requirements and send it to our staff for processing, usually the two things above will be given soon
Never use the test appid of
123456789
in the official app, it is unstable, we may block it at any time, or change the appid for test
2. Download the research SDK
Download the SDK for the corresponding platform, run the demo using the appid and configuration file applied for above, and study how the demo and documentation use the SDK.
It is strongly recommended that you study the demo before connecting to your own APP. In addition, you can take a look at FAQ, and read the questions carefully, maybe your doubts will be solved.
Suggest developers
star
Our SDK project, so that we can receive update notifications in time
3. Design body fat scale function
Design how to connect the body fat scale in the existing APP. After researching the SDK in the previous step, we can also design a body fat scale for this step to avoid many minefields.
The general steps of using body fat scale are:
- Add device
This is not configured with Android or iOS systems, Bluetooth 4.0 can support unpaired use. Our body fat scale is a custom protocol, usually only our APP or APP connected to our SDK can be used. Cannot be added to the system, use the system Bluetooth connection.
- Measurement
The measurement here actually includes Bluetooth scanning and Bluetooth connection. During the measurement process, it is best to show some measurement animations to remind the user that the measurement is being performed to avoid the boring process
- Save and display data
After receiving the locked measurement data, the data is saved locally and displayed. In order to achieve offline measurement, you can save the data locally and then upload it to the server. If there is no network at the time, you can wait for the network to upload the data to the server. The way to display data can refer to our APP, of course, if you have your own style and analysis method, you can also use your own.
4. Develop APP function
According to the designed function, connect the SDK to the APP.
Pay special attention to the location permission and location service switch of Android. iOS requires Bluetooth permission after the main 13 version.
5. Self-test function
After the development is completed, you can use our provided test case SDK test case to verify whether the weighing function can be used.
The above attachments can be downloaded by right-clicking
If possible, it is recommended to send the test version to Yolanda, we will arrange testers to assist customers in APP testing.
We will mention the results of the test and some of our views on the APP to our customers.
6. Submit online
After the test is completed, it will be submitted online. It's best to inform Yolanda when you go online successfully. In this way, Yolanda will register the online results and continue to follow up the experience.
SDK download link
The SDK file is no longer a separate download link. The following is the Demo provided by us. The Demo project has the latest SDK file.
Integration
Development Process
Before using the SDK, you need to call initialization first, the method is: QNBleApi.initSdk
Code example:
//Android sample code
String configFilePath = "file:///android_asset/test123456789.qn";
QNBleApi.getInstance(context).initSdk("test123456789", configFilePath, new QNResultCallback() {
@Override
public void onResult(int code, String msg) {
Log.d ("BaseApplication", "Initialization file" + msg);
}
});
NSString *file = [[NSBundle mainBundle] pathForResource:@"123456789" ofType:@"qn"];
[[QNBleApi sharedBleApi] initSdk:@"123456789" firstDataFile:file callback:^(NSError *error) {
}];
The initialization method is the method that any device needs to call. The following is the workflow of different device types.
If you do n’t know what kind of device you have, you can refer to How to determine the type of device