Get started
Step 1: register your account
Please access iHealth developer website.
Press button "Create an account" and Jump into Register page, fill in the form and register your iHealth developer account.
Step 2: Create your application
If you already have registered your application, Please jump to Step 3.
If you don't registered your application, Please press the "Enterprise Development" on left side of the page and go to "App Management". Please press button "Add New app" and fill in your information of your app, as shown below.
We will active the license for your application within 1-3 business days after receiving your email. If your app not been approved for long time, Please contact your iHealth account manager.
Step 3: Download the SDK and license file
After your app been approved, you can download the SDK solution.
Download .pem file at App Management if your solution need.
Step 4: Add license in your application
As shown below, add your license file to your root assets folder.
Step 5: Add SDK library and SO file
As shown below, add your SDK jar file and SO file to your project.
For the library project, add the following:
android {
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
}
info
Need ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission in Android API 23+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
Step 6: Check application permission
To use Bluetooth Low Energy, you must declare several permissions.
Step 7: Init SDK
public class BaseApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
iHealthDevicesManager.getInstance().init(this, Log.VERBOSE, Log.VERBOSE);
}
}
Step 8: Authentication license
Please call the following method, if the license is invalid, it will return false. When the license needs to be updated, the first call will return false, the SDK will sync with the server, and the next call will return true.
public void auth() {
try {
InputStream is = mContext.getAssets().open("xxx.pem");
int size = is.available();
byte[] buffer = new byte[size];
is.read(buffer);
is.close();
boolean isPass = iHealthDevicesManager.getInstance().sdkAuthWithLicense(buffer);
} catch (IOException e) {
e.printStackTrace();
}
}