com.samsung.multiscreen

## Class Search

- java.lang.Object
- - com.samsung.multiscreen.Search

-     public class Search
      extends Object

  Provides management facilities for discovering MultiScreen-enabled `Service`s.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `Search.OnBleFoundListener` Interface to listen for TV found events using BLE.
    `static interface` | `Search.OnServiceFoundListener` Interface to listen for service found events.
    `static interface` | `Search.OnServiceLostListener` Interface to listen for service lost events.
    `static interface` | `Search.OnStartListener` Interface to listen for search start events.
    `static interface` | `Search.OnStopListener` Interface to listen for search stop events.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addProvider(SearchProvider provider)` Add a `SearchProvider` to the list of available search providers that search will scan for services.
    `void` | `clearStandbyDeviceList()` Clears standby device list from the device.
    `List<Service>` | `getServices()` The list of services found during the search process.
    `boolean` | `isSearching()` Returns if any search is in progress.
    `boolean` | `isSearchingBle()` Returns if any BLE search is in progress.
    `boolean` | `isSupportBle()` Checks whether BLE is supported.
    `void` | `removeAllProviders()` Remove all search providers.
    `boolean` | `removeProvider(SearchProvider provider)` Removes the specified search provider
    `void` | `setOnBleFoundListener(Search.OnBleFoundListener onBleFoundListener)` Set the listener for service found events using BLE.
    `void` | `setOnServiceFoundListener(Search.OnServiceFoundListener onServiceFoundListener)` Set the listener for service found events.
    `void` | `setOnServiceLostListener(Search.OnServiceLostListener onServiceLostListener)` Set the listener for service lost events.
    `void` | `setOnStartListener(Search.OnStartListener onStartListener)` Set the listener for start (search) events.
    `void` | `setOnStopListener(Search.OnStopListener onStopListener)` Set the listener for stop (search) events.
    `boolean` | `start()` Start the search process.
    `boolean` | `start(Boolean showStandbyDevices)` Start the search process.
    `boolean` | `startUsingBle()` Start the ble search process.
    `boolean` | `stop()` Stop the search process.
    `boolean` | `stopUsingBle()` Stop the search process.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### isSearching

          public boolean isSearching()

      Returns if any search is in progress.
      Returns:
        true, if a search is in progress. false, otherwise.

    - #### isSearchingBle

          public boolean isSearchingBle()

      Returns if any BLE search is in progress.
      Returns:
        true, if a search is in progress. false, otherwise.

    - #### start

          public boolean start()

      Start the search process.
      Returns:
        true, if started. false, otherwise.

    - #### start

          public boolean start(Boolean showStandbyDevices)

      Start the search process.
      Parameters:
        `showStandbyDevices` - optional argument to stop showing standby devices.
      Returns:
        true, if started. false, otherwise.

    - #### stop

          public boolean stop()

      Stop the search process.
      Returns:
        true, if stopped. false, otherwise.

    - #### clearStandbyDeviceList

          public void clearStandbyDeviceList()

      Clears standby device list from the device.

    - #### isSupportBle

          public boolean isSupportBle()

      Checks whether BLE is supported.
      Returns:
        true, if stopped. false, otherwise.

    - #### startUsingBle

          public boolean startUsingBle()

      Start the ble search process.
      Returns:
        true, if started. false, otherwise.

    - #### stopUsingBle

          public boolean stopUsingBle()

      Stop the search process.
      Returns:
        true, if stopped. false, otherwise.

    - #### getServices

          public List<Service> getServices()

      The list of services found during the search process.
      Returns:
        a list of services found

    - #### addProvider

          public void addProvider(SearchProvider provider)

      Add a `SearchProvider` to the list of available search providers that search will scan for services. If a provider is not specified, then the `MDNSSearchProvider` will be used.
      Parameters:
        `provider` - a search provider to include in a scan for services

    - #### removeProvider

          public boolean removeProvider(SearchProvider provider)

      Removes the specified search provider
      Parameters:
        `provider` - the search provider to remove
      Returns:
        true, if the search provider is removed immediately. false, otherwise.

    - #### removeAllProviders

          public void removeAllProviders()

      Remove all search providers.

    - #### setOnStartListener

          public void setOnStartListener(Search.OnStartListener onStartListener)

      Set the listener for start (search) events.

    - #### setOnStopListener

          public void setOnStopListener(Search.OnStopListener onStopListener)

      Set the listener for stop (search) events.

    - #### setOnServiceFoundListener

          public void setOnServiceFoundListener(Search.OnServiceFoundListener onServiceFoundListener)

      Set the listener for service found events.

    - #### setOnServiceLostListener

          public void setOnServiceLostListener(Search.OnServiceLostListener onServiceLostListener)

      Set the listener for service lost events.

    - #### setOnBleFoundListener

          public void setOnBleFoundListener(Search.OnBleFoundListener onBleFoundListener)

      Set the listener for service found events using BLE.
      Parameters:
        `onBleFoundListener` - the listener to invoke on service found with BLE events