Skip to content

FileTransfer Interfaces Usage

zhaowanli2 edited this page Jan 4, 2019 · 1 revision

(Suppose A and B are already friends)

1. Create the instance of FileTransfer Manager

1.1 Use Manager.initializeInstance(Carrier carrier, ManagerHandler handler) to initialize the Manager

  • The interface ManagerHandler has a method: onConnectRequest, if A wants to connect to B, and this method will be invoked at B side. If B agrees the connect-request from A, B can Use FileTransfer.acceptConnect();

1.2 Use Manager.getInstance() to get the instance of FileTransfer Manager

2. Create the instance of FileTransfer

  • If A wants to transfer file to B, first needs to create an object of FileTransfer using FileTransfer-Manager, like: FileTransferManager.newFileTransfer(userIdOfB, fileTransferInfo, transferHandler);

2.1