Professional Documents
Culture Documents
Trill SDK - One Way Developer Guide
Trill SDK - One Way Developer Guide
Developer Guideline
Overview
Trillbit proprietary technology uses advanced ultrasonic data communication
protocol to send data over sound waves. Our SDK transforms any device with
a speaker into a transmitter and any device with a microphone into a receiver.
Sound waves create a secure nearby proxy for data transmission, our
technology is eliminating the need for complex, expensive, and
power-consuming wireless technologies.
Setup
dependencies {
compile 'com.trillbit.datasdk:trill-data-sdk@aar'
}
Page 2
To instruct Gradle where to find the local aar file, add flatDir section to the
repositories block. (You’ll need to add a repositories block if one does not
already exist).
repositories {
flatDir {
dirs 'libs'
}
}
Requirements
Minimum SDK Version: Android 4.1 (API level 16)
Recommended target SDK version: Android 9.0 (API level 28)
Gradle Plugin version : 2.2.0 ( or later)
Gradle wrapper version: 2.14.1 (or later)
Android Studio: 2.2
Page 3
Please refer to A ppendix for the list of permissions, Activities, and receivers
that trill-sdk uses.
For more details on Manifest merging and Manifest file conflict resolution,
refer to this Android developer documentation.
Setup
Add ABI filter
Trillbit SDK uses native code (.so) files and ships with native code shared
object library files for following ABI’s:
● armeabi
● armeabi-v7a
● arm64-v8a
● x86
● x86_64
● mips
As you might not need to support all ABI’s in your app, please add an ABI filter
in your app modules build.gradle file.
To add an ABI filter, open the build.gradle file for your app module and add
ndk abiFilters in android-> defaultConfig section.
Eg: If you need to support only armeabi-v7a and x86 architectures, add
abiFilters only for these two ABI’s as shown below:
android {
defaultConfig {
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
}
Page 4
If you are not sure about which ABI’s to support, please add default ABI
support for x86 and arm-v7a arch as shown below.
Page 5
Trill SDK setup function should be called after Permissions block
@Override
protected void o
nResume() {
s uper.onResume();
String [] neededPermissions = {
Manifest.permission.RECORD_AUDIO,
Manifest.permission.MODIFY_AUDIO_SETTINGS,
Manifest.permission.INTERNET,
Manifest.permission.ACCESS_NETWORK_STATE
};
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[]
permissions, @ NonNull i nt[] grantResults) {
s uper.onRequestPermissionsResult(requestCode, permissions, grantResults);
setup();
}
Page 6
● start()
Start listening to User authentication on POS Device. The method returns nothing.
● stop()
Stop listening to User authentication on POS Device. The method returns nothing.
SDK Type: T
rillSDK.SDKType.SENDER / TrillSDK.SDKType.RECEIVER
The method Initializes the Trill SDK Library, Also attaching SDK callback to Trill SDK
library.
SDK Type: T
rillSDK.SDKType.SENDER / TrillSDK.SDKType.RECEIVER
Page 7
● isWiredHeadsetConnected():
The method returns interger value. The headphones could be wired or
wireless both.
Response could be:
AudioDeviceInfo.TYPE_WIRED_HEADSET
AudioDeviceInfo.TYPE_WIRED_HEADPHONES
AudioDeviceInfo.TYPE_BLUETOOTH_A2DP
AudioDeviceInfo.TYPE_BLUETOOTH_SCO
Callbacks
● onSDKReady(int status)
The callback is triggered as soon as SDK is Initialized.
● onDataReceived(String Payload)
Callback reporting user verified. The status received here will always be
STATUS_SUCCESS with UserID of 19 characters.
Page 8
APK Split
To optimize your apps final APK size, we strongly recommend you to use APK
split functionality provided by the gradle build system.
If you are supporting multiple ABIs in your app, then you can split your app
APK per ABI and effectively reduce the APK size.
Please refer Android developer documentation for more details about ABI
APK splits here :
https://developer.android.com/studio/build/configure-apk-splits.html#conf
igure-abi-split
Appendix
Manifest file permissions
Following permissions are used by trill-sdk.
In case of any issue with automatic manifest merging, please add above
permissions in your application’s Manifest file.
Troubleshooting
Dex Error : Enable Multidexing
Page 9
If adding third-party sdk libraries to your project causes dex error. Enable
multidex support for your app. Refer following link to enable multidex support
in the app.
https://developer.android.com/tools/building/multidex.html
Page 10
Error Responses
Error Code Error Message Description
402 SDK Type Sender doesn't supports called Trying to call start() or stop() method
method, check documents from sender type sdk.
403 SDK Type Receiver doesn't supports called Trying to call start() or stop() method
method, check documents from sender type sdk.
501 Unable to authenticate sdk For the first time sdk need to authorise
with trillbit server. The error comes
when sdk is unable to verify, Especially in
case of no internet.
514 Wired or Wireless handset is connected The error is trigger from multiple
methods. The error states User device is
connected to BLE or wired handset or
speaker.
515 Unable to start recording. The error is triggered from receiver flow
when reorder is trying to start but due to
unavailability of resources the process is
in halt.
516 Unable to start processing audio The error is triggered from receiver flow
when processing thread is trying to start
but due to unavailability of resources the
process is in halt.
Page 11
517 Recorder Specific Error (All Recorder error The error is triggered from the recorder
for debugging purpose ) for both sender and receiver. Error
message will have the exact recorder
error. The error callback is for debugging
purpose
Info Response
Response for Message Description
Receiver Unable to verify user In case when, the receiver side is unable to
decode the payload.
Sender Unable to verify, Trying Again In Case when, the sender side is unable to
verify the current transaction.
Sender Unable to verify, Session Timeout In Case when, the sender side is unable to
verify within the whole session.
Sender Last Transaction Time [ time in Triggers after sender is verified, the message
milliseconds ] Completed in [ no of returns no of attempts, Last Transaction time
attempt ] attempt. Complete
Transaction Time : [ time in and Complete Transaction time
milliseconds ]
Page 12