Class TeamViewerSdk.Builder

java.lang.Object
com.teamviewer.sdk.screensharing.TeamViewerSdk.Builder
Enclosing class:
TeamViewerSdk

public static final class TeamViewerSdk.Builder extends Object
Builder object for the TeamViewerSdk.
  • Constructor Details

    • Builder

      public Builder(android.content.Context context)
      Creates a builder for the TeamViewerSdk.
      Parameters:
      context - The application's context.
  • Method Details

    • withToken

      public TeamViewerSdk.Builder withToken(String token)
      Sets the Sdk token which is mandatory to use the TeamViewer Sdk. You can create and manage a token in the TeamViewer Management Console.
      Parameters:
      token - The Sdk token to use.
      Returns:
      This Builder object to allow for chaining of calls to set methods.
    • withErrorCallback

      public TeamViewerSdk.Builder withErrorCallback(ErrorCallback callback)
      Sets a ErrorCallback for listening to TeamViewer Sdk errors.
      Parameters:
      callback - The ErrorCallback to use.
      Returns:
      This Builder object to allow for chaining of calls to set methods.
    • withAuthenticationCallback

      public TeamViewerSdk.Builder withAuthenticationCallback(AuthenticationCallback callback)
      Sets a AuthenticationCallback for listening to incoming connection requests.
      Parameters:
      callback - The AuthenticationCallback to use.
      Returns:
      This Builder object to allow for chaining of calls to set methods.
    • withSessionCallback

      public TeamViewerSdk.Builder withSessionCallback(SessionCallback callback)
      Sets a SessionCallback for listening to TeamViewer session events.
      Parameters:
      callback - The SessionCallback to use.
      Returns:
      This Builder object to allow for chaining of calls to set methods.
    • withOnlineStateCallback

      public TeamViewerSdk.Builder withOnlineStateCallback(OnlineStateCallback callback)
      Sets a OnlineStateCallback for listening to online state changes.
      Parameters:
      callback - The OnlineStateCallback to use.
      Returns:
      This Builder object to allow for chaining of calls to set methods.
    • withAccessControlCallback

      public TeamViewerSdk.Builder withAccessControlCallback(AccessControlCallback callback)
      Sets a AccessControlCallback for listening to access control requests.
      Parameters:
      callback - The AccessControlCallback to use.
      Returns:
      This Builder object to allow for chaining of calls to set methods.
    • withInputCallback

      public TeamViewerSdk.Builder withInputCallback(InputCallback callback)
      Sets a InputCallback for listening to input from the remote supporter.
      Parameters:
      callback - The InputCallback to use.
      Returns:
      This Builder object to allow for chaining of calls to set methods.
    • withLogger

      public TeamViewerSdk.Builder withLogger(Logger callback)
      Sets a Logger callback to which all log output from the TeamViewer Sdk is delegated to.
      Parameters:
      callback - The Logger callback to use.
      Returns:
      This Builder object to allow for chaining of calls to set methods.
    • withSettings

      public TeamViewerSdk.Builder withSettings(Settings settings)
      Sets Settings which changes the behaviour of the TeamViewer Sdk.
      Parameters:
      settings - The Settings to use.
      Returns:
      This Builder object to allow for chaining of calls to set methods.
    • withMicInitiallyMuted

      public TeamViewerSdk.Builder withMicInitiallyMuted(boolean muted)
      Sets the initial microphone state for the session. If not set exclusively, false is set by default.
      Parameters:
      muted - The initial state to use.
      Returns:
      This Builder object to allow for chaining of calls to set methods.
    • withStorageFolder

      public TeamViewerSdk.Builder withStorageFolder(String storageFolder)
      Sets the root path for file transfer Assist AR.
      Parameters:
      storageFolder - Name of the folder where delivered files will be stored.
      Returns:
      This Builder object to allow for chaining of calls to set methods. This same storageFolder must also be mentioned in FileProvider for app. Define FileProvider in app manifest with app package as authority like below :
      
       		<provider
       			android:name="androidx.core.content.FileProvider"
       			android:authorities="your.app.package.fileprovider"
       			android:exported="false"
       			android:grantUriPermissions="true">
       			<meta-data
       				android:name="android.support.FILE_PROVIDER_PATHS"
       				android:resource="@xml/fileprovider" />
       		</provider>
       
      create xml file resource with name fileprovider and mention same folder name in xml as a path
      
      		<?xml version="1.0" encoding="utf-8"?>
      		<paths>
      		<!-- External storage path -->
      			<external-files-path
      				name="shared_files"
      				path="storageFolder" />
      		</paths>
       
    • build

      public TeamViewerSdk build()
      Creates the TeamViewerSdk with the arguments supplied to this builder.
      Must be called from the main thread.
      Returns:
      The TeamViewerSdk.