Table of Contents

SDK API

initialize

Initialize the SDK.

void initialize(Context context, DeviceListener listener) 

Parameters

If this function is not called, the SDK will not work properly.
It should be called as soon as possible after running the application.


run

Run the SDK service.

int run()

Return Code

Returns “SUCCESS” if successfully launched; returns the corresponding error code if an error occurs.

The SDK was developed for use with a single application.
It requires caution because it is not used concurrently in other applications.


getVersions

Get the SDK/Firmware versions.

int getVersions(Versions versions)

Parameters

Return Code

Returns “SUCCESS” if successfully launched; returns the corresponding error code if an error occurs.


getDeviceInfo

Get the device information.

int getDeviceInfo(Device device)

Parameters

Return Code

Returns “SUCCESS” if successfully launched; returns the corresponding error code if an error occurs.


setAutoStartApplication

Automatically launch the application when Android starts.

int setAutoStartApplication(boolean enable)

Return Code

Returns “SUCCESS” if successfully launched; returns the corresponding error code if an error occurs.


connectFtpServer

connect to the FTP server.

int connectFtpServer(FirmwareOption option)

Parameters

Return Code

Returns “SUCCESS” if successfully launched; returns the corresponding error code if an error occurs.

To use the firmware upgrade function, you need to build an FTP server.
The API acts as an FTP client.

To use the API, Android applications require the following permissions:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />


disconnectFtpServer

Disconnects to the FTP server.

int disconnectFtpServer()

Return Code

Returns “SUCCESS” if successfully launched; returns the corresponding error code if an error occurs.

To use the firmware upgrade function, you need to build an FTP server.
The API acts as an FTP client.

To use the API, Android applications require the following permissions:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />


getFtpFileList

Get a list of file names for the FTP server.

int getFtpFileList(ArrayList<String> fileList)

Parameters

Return Code

Returns “SUCCESS” if successfully launched; returns the corresponding error code if an error occurs.

To use the firmware upgrade function, you need to build an FTP server.
The API acts as an FTP client.

To use the API, Android applications require the following permissions:
<uses-permission android:name="android.permission.INTERNET"/>


getUsbFileList

Get a list of firmware file names for USB.

int getUsbFileList(ArrayList<String> fileList)

Parameters

Return Code

Returns “SUCCESS” if successfully launched; returns the corresponding error code if an error occurs.


upgradeFirmware

Copy the upgrade file to the specified firmware file.

int upgradeFirmware(FirmwareOption option)

Parameters

Return Code

Returns “SUCCESS” if successfully launched; returns the corresponding error code if an error occurs.

To use the firmware upgrade function, you need to build an FTP server.
The API acts as an FTP client.

To use the API, Android applications require the following permissions:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />


rebootDevice

Reboot the device.

int rebootDevice()

Return Code

Returns “SUCCESS” if successfully launched; returns the corresponding error code if an error occurs.

The firmware will be upgraded at device reboot.