NearShareSender Class

  • java.lang.Object
    • NativeBase
      • com.microsoft.connecteddevices.remotesystems.commanding.nearshare.NearShareSender

public class NearShareSender

This class is responsible for sending URIs and/or files from one device to another through the nearby sharing feature.

Constructor Summary

Constructor Description
NearShareSender()

Creates and initializes a new instance of this class.

Method Summary

Modifier and Type Method and Description
boolean isNearShareSupported(RemoteSystemConnectionRequest remoteSystemConnectionRequest)

Reports whether all conditions are satisfied for the app to begin sharing with the intended remote device or app (for example, Windows devices must be on the Windows 10 April 2018 Update or later).

AsyncOperationWithProgress<NearShareStatus, NearShareProgress> sendFileAsync(RemoteSystemConnectionRequest remoteSystemConnectionRequest, NearShareFileProvider file)

Sends a single file to a remote device or app.

AsyncOperationWithProgress<NearShareStatus, NearShareProgress> sendFilesAsync(RemoteSystemConnectionRequest remoteSystemConnectionRequest, NearShareFileProvider[] files)

Sends multiple files to a remote device or app.

AsyncOperation<NearShareStatus> sendUriAsync(RemoteSystemConnectionRequest remoteSystemConnectionRequest, String uri)

Sends a single URI to a remote device or app.

Constructor Details

NearShareSender

public NearShareSender()

Creates and initializes a new instance of this class.

Method Details

isNearShareSupported

public boolean isNearShareSupported(RemoteSystemConnectionRequest remoteSystemConnectionRequest)

Reports whether all conditions are satisfied for the app to begin sharing with the intended remote device or app (for example, Windows devices must be on the Windows 10 April 2018 Update or later).

Parameters:

remoteSystemConnectionRequest - A **RemoteSystemConnectionRequest** indicating the device or app that this app is intending to share with.

Returns:

**true** if the conditions are met to initiate nearby sharing, **false** if not.

sendFileAsync

public AsyncOperationWithProgress sendFileAsync(RemoteSystemConnectionRequest remoteSystemConnectionRequest, NearShareFileProvider file)

Sends a single file to a remote device or app.

Parameters:

remoteSystemConnectionRequest - A **RemoteSystemConnectionRequest** indicating the device or app to connect to.
file - A **NearShareFileProvider** instance representing the file to send.

Returns:

An asynchronous operation with a **NearShareStatus** value.

sendFilesAsync

public AsyncOperationWithProgress sendFilesAsync(RemoteSystemConnectionRequest remoteSystemConnectionRequest, NearShareFileProvider[] files)

Sends multiple files to a remote device or app.

Parameters:

remoteSystemConnectionRequest - A **RemoteSystemConnectionRequest** indicating the device or app to connect to.
files - A **NearShareFileProvider** array representing the list of files to send.

Returns:

An asynchronous operation with a **NearShareStatus** value.

sendUriAsync

public AsyncOperation sendUriAsync(RemoteSystemConnectionRequest remoteSystemConnectionRequest, String uri)

Sends a single URI to a remote device or app.

Parameters:

remoteSystemConnectionRequest - A **RemoteSystemConnectionRequest** indicating the device or app to connect to.
uri - The URI string to send.

Returns:

An asynchronous operation with a **NearShareStatus** value.

Applies to