Skip to content

PrinterSearcher

A Brother Label & Mobile printer searcher.

Overview

You use this object to search for printers. Available printers are returned as an array of Channel objects.

Class methods

startNetworkSearch

Begins searching for compatible printers that exist on the network.

Declaration

public static PrinterSearchResult startNetworkSearch(Context context, NetworkSearchOption option, Consumer<Channel> callback);

Parameters

Name Type Description
context Context Android context
option NetworkSearchOption Option to control this function
callback Consumer<Channel> A function called whenever a printer is found

Return Value

See PrinterSearchResult.

startNetworkSearch

Searches for a compatible printer by specifying its IP address.

Declaration

public static PrinterSearchResult startNetworkSearch(Context context, NetworkSearchOption option, String ipAddress);

Parameters

Name Type Description
context Context Android context
option NetworkSearchOption Option to control this function
ipAddress String IP address of the printer you search for

Return Value

See PrinterSearchResult. If the printer does not respond or is not a compatible printer, the code of PrinterSearchError in the result is CommunicationError.

cancelNetworkSearch

Cancel searching for compatible printers that exist on the network.

Declaration

public static void cancelNetworkSearch();

startBluetoothSearch

Get the list of compatible printers paired to the mobile device.

Declaration

public static PrinterSearchResult startBluetoothSearch(Context context);

Parameters

Name Type Description
context Context Android context

Return Value

See PrinterSearchResult.

startBLESearch

Begins searching printers which support Bluetooth Low Energy.

Declaration

public static PrinterSearchResult startBLESearch(Context context, BLESearchOption option, Consumer<Channel> callback);

Parameters

Name Type Description
context Context Android context
option BLESearchOption Option to control this function
callback Consumer<Channel> A function called whenever a printer is found

Return Value See PrinterSearchResult.

cancelBLESearch

Cancel searching for compatible printers which support Bluetooth Low Energy.

Declaration

public static void cancelBLESearch();

startUSBSearch

Get the printer connected to the mobile device via USB.

Declaration

public static PrinterSearchResult startUSBSearch(Context context);

Parameters

Name Type Description
context Context Android context

Return Value

See PrinterSearchResult.