AidConnect Android API
class AidConnect
Used for SDK initialization and controlling log output
Public Member Functions
initialize()
java
public static boolean initialize(Application mApplication, boolean logDebug, AidConnectCallback aidConnectCallback)- Parameters
| Parameter Name | Type | Default Value | Description |
|---|---|---|---|
| mApplication | Application | - | Android Application object |
| logDebug | boolean | - | SDK log switch: true prints all log levels; false prints only error logs |
| aidConnectCallback | AidConnectCallback | - | Initialization callback |
- Return None
addChannelWithName()
java
public static Set addChannelWithName(String name, int size);Creates a communication channel based on the user-defined channel name and size, and returns a set of all channel names.
- Parameters
| Parameter Name | Type | Default Value | Description |
|---|---|---|---|
| name | String | - | User-defined name of the channel to be transmitted |
| size | int | - | Channel size (unit: MB) |
- Return
| Type | Description |
|---|---|
| Set <String> | Set of all channel names |
removeChannelWithName()
java
public static Set removeChannelWithName(String name);Removes the communication channel with the name passed by the user, and returns a set of all channel names.
- Parameters
| Parameter Name | Type | Default Value | Description |
|---|---|---|---|
| name | String | - | Name of the channel the user wants to remove |
- Return
| Type | Description |
|---|---|
| Set <String> | Set of all channel names |
aidConnectWithName()
java
public AidConnect aidConnectWithName(String name);Creates a communication channel based on the user-defined channel name and obtains the core class AidConnect for managing interactions.
- Parameters
| Parameter Name | Type | Default Value | Description |
|---|---|---|---|
| name | String | - | Name of the channel the user wants to use for transmission |
- Return
| Type | Description |
|---|---|
| AidConnect | AidConnect class object |
setBytes()
java
public boolean setBytes(byte[] bytes);Writes data to the channel.
- Parameters
| Parameter Name | Type | Default Value | Description |
|---|---|---|---|
| bytes | byte[] | - | Byte array to be written |
- Return
| Type | Description |
|---|---|
| boolean | true if written successfully; false otherwise |
getBytes()
java
public byte[] getBytes(int len);Reads data according to the input byte length.
- Parameters
| Parameter Name | Type | Default Value | Description |
|---|---|---|---|
| len | int | - | Length of bytes to read |
- Return
| Type | Description |
|---|---|
| byte[] | Byte array of the read data |
getBytes()
java
public byte[] getBytes();Reads data according to the length of the written byte data.
- Return
| Type | Description |
|---|---|
| byte[] | Byte array of the read data |
getBytes()
java
public byte[] getBytes(byte[] bytes, int len);Reads data using a pre-created byte array and the input byte length.
- Parameters
| Parameter Name | Type | Default Value | Description |
|---|---|---|---|
| bytes | byte[] | - | Pre-defined byte array with size len |
| len | int | - | Length of the byte array to read |
- Return
| Type | Description |
|---|---|
| byte[] | Byte array of the read data |
release()
java
public int release();Releases related resources.
Parameters None
Return
| Type | Description |
|---|---|
| int | 0: Release successful; Non-0: Call failed |