Package com.castlabs.sdk.claws
Class ClawsServiceBinder
java.lang.Object
android.os.Binder
com.castlabs.sdk.claws.ClawsServiceBinder
- All Implemented Interfaces:
IBinder
Binder for the ClawsService.
-
Nested Class Summary
Nested classes/interfaces inherited from interface android.os.IBinder
IBinder.DeathRecipient -
Field Summary
Fields inherited from interface android.os.IBinder
DUMP_TRANSACTION, FIRST_CALL_TRANSACTION, FLAG_ONEWAY, INTERFACE_TRANSACTION, LAST_CALL_TRANSACTION, LIKE_TRANSACTION, PING_TRANSACTION, TWEET_TRANSACTION -
Constructor Summary
ConstructorsConstructorDescriptionClawsServiceBinder(ClawsService clawsService) Creates a new ClawsServiceBinder. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(ClawsServiceListener listener) Adds a listener for CLAWS service events.voidConnects to the CLAWS server.voidDisconnects from the CLAWS server.voidemitTransferAccepted(long assetId, Device sourceDevice) Emits a transfer accepted event.voidemitTransferCanceled(long assetId, Device sourceDevice) Emits a transfer canceled event.Gets the list of connected devices.voidremoveListener(ClawsServiceListener listener) Removes a listener for CLAWS service events.voidtransfer(String assetId, long positionMs, Device targetDevice, ClawsService.TransferCallback callback) Transfers an asset to a target device.Methods inherited from class android.os.Binder
attachInterface, clearCallingIdentity, clearCallingWorkSource, dump, dumpAsync, flushPendingCommands, getCallingPid, getCallingUid, getCallingUidOrThrow, getCallingUserHandle, getCallingWorkSourceUid, getInterfaceDescriptor, isBinderAlive, joinThreadPool, linkToDeath, pingBinder, queryLocalInterface, restoreCallingIdentity, restoreCallingWorkSource, setCallingWorkSourceUid, transact, unlinkToDeath
-
Constructor Details
-
ClawsServiceBinder
Creates a new ClawsServiceBinder.- Parameters:
clawsService- The ClawsService instance.
-
-
Method Details
-
connect
Connects to the CLAWS server.- Parameters:
url- The URL of the CLAWS server.userId- The user ID.deviceName- The device name.- Throws:
Exception- If an error occurs while connecting.
-
getConnectedDevices
Gets the list of connected devices.- Returns:
- The list of connected devices.
-
transfer
public void transfer(String assetId, long positionMs, Device targetDevice, ClawsService.TransferCallback callback) Transfers an asset to a target device.- Parameters:
assetId- The ID of the asset to transfer.positionMs- The position in milliseconds to start the transfer from.targetDevice- The target device.callback- The callback to be invoked when the transfer is complete or an error occurs.
-
disconnect
public void disconnect()Disconnects from the CLAWS server. -
addListener
Adds a listener for CLAWS service events.- Parameters:
listener- The listener to add.
-
removeListener
Removes a listener for CLAWS service events.- Parameters:
listener- The listener to remove.
-
emitTransferCanceled
Emits a transfer canceled event.- Parameters:
assetId- The ID of the asset for which the transfer was canceled.sourceDevice- The source device.
-
emitTransferAccepted
Emits a transfer accepted event.- Parameters:
assetId- The ID of the asset for which the transfer was accepted.sourceDevice- The source device.
-