| CustomAndroidAPI 1.11

- Main Page
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Functions Variables Pages
Public Member Functions | Static Public Member Functions | List of all members
it.custom.printer.api.android.CustomAndroidAPI Class Reference

## Public Member Functions
CustomPrinter | getPrinterDriverBT (BluetoothDevice printer) throws CustomException
CustomPrinter | getPrinterDriverBTMode (BluetoothDevice printer, int iConnMode) throws CustomException
CustomPrinter | getPrinterDriverETH (String printerIpAddr) throws CustomException
CustomPrinter | getPrinterDriverETH (String printerIpAddr, int printerIpPort) throws CustomException
CustomPrinter | getPrinterDriverCOM (String devPort) throws CustomException
CustomPrinter | getPrinterDriverUSB (UsbDevice device, Context cobj) throws CustomException

## Static Public Member Functions
static String | getAPIVersion ()
static void | EnableLogAPI (boolean enable)
static BluetoothDevice[] | EnumBluetoothDevices () throws CustomException
static String[] | EnumEthernetDevices (int searchTimeout, Context cobj) throws CustomException
static UsbDevice[] | EnumUsbDevices (Context cobj) throws CustomException

## Detailed Description

Factory class to get the printer driver class for supported model id

## Member Function Documentation

static void it.custom.printer.api.android.CustomAndroidAPI.EnableLogAPI | ( | boolean | enable | ) |
| inline static

Enable / disable the API log (default disabled).

static BluetoothDevice [] it.custom.printer.api.android.CustomAndroidAPI.EnumBluetoothDevices | ( |  | ) | throws CustomException
| inline static

Get the list of CUSTOM Bluetooth devices.

Returns
  the list of CUSTOM Bluetooth devices

Exceptions

  CustomException | if Bluetooth is not enable or is not supported

static String [] it.custom.printer.api.android.CustomAndroidAPI.EnumEthernetDevices | ( | int | searchTimeout,
|  | Context | cobj
| ) |  | throws CustomException
| inline static

Get the list of CUSTOM Ethernet devices.

Parameters

  searchTimeout | Search Ethernet devices timeout
  cobj | Context object

Returns
  the String list with IP ADDRESS of CUSTOM Ethernet devices

Exceptions

  CustomException |

static UsbDevice [] it.custom.printer.api.android.CustomAndroidAPI.EnumUsbDevices | ( | Context | cobj | ) | throws CustomException
| inline static

Get the list of CUSTOM USB Printer devices.

Parameters

  cobj | Context object

Returns
  the String list CUSTOM USB devices

Exceptions

  CustomException |

static String it.custom.printer.api.android.CustomAndroidAPI.getAPIVersion | ( |  | ) |
| inline static

Current API version

Returns
  current API version eg 1.00

Exceptions

  CustomException |

CustomPrinter it.custom.printer.api.android.CustomAndroidAPI.getPrinterDriverBT | ( | BluetoothDevice | printer | ) | throws CustomException
| inline

Connects to Bluetooth Printer device.

Parameters

  printer | device to connect

Returns
  printer driver class according to its model/printer id

Exceptions

  CustomException | if Bluetooth device is not printer or printer model is not supported

CustomPrinter it.custom.printer.api.android.CustomAndroidAPI.getPrinterDriverBTMode | ( | BluetoothDevice | printer,
|  | int | iConnMode
| ) |  | throws CustomException
| inline

Connects to Bluetooth Printer device using a particular connection mode.

Parameters

  printer | device to connect
  iConnMode | Bluetooth Connection Mode (0 - Standard, 1 - Alternate)

Returns
  printer driver class according to its model/printer id

Exceptions

  CustomException | if Bluetooth device is not printer or printer model is not supported

CustomPrinter it.custom.printer.api.android.CustomAndroidAPI.getPrinterDriverCOM | ( | String | devPort | ) | throws CustomException
| inline

Connects to Com/Serial Printer device.

Parameters

  devPort | String value with dev address of device to connect (the dev must be set with "666" permissions. Example: "chmod 666 /dev/ttyS0")

Returns
  printer driver class according to its model/printer id

Exceptions

  CustomException | if open port port error, device is not printer or printer model is not supported

CustomPrinter it.custom.printer.api.android.CustomAndroidAPI.getPrinterDriverETH | ( | String | printerIpAddr | ) | throws CustomException
| inline

Connects to WiFi/Ethernet Printer device.

Remarks
  NOTE: From Android 3.0 Network operations are not allowed on the UI Thread(main thread). You have to do the network communication in a separate thread. Google Android developer link about it.

Parameters

  printerIpAddr | String value with IP ADDRESS of device to connect (connect of prn port 9100)

Returns
  printer driver class according to its model/printer id

Exceptions

  CustomException | if WiFi/Ethernet device is not printer or printer model is not supported

CustomPrinter it.custom.printer.api.android.CustomAndroidAPI.getPrinterDriverETH | ( | String | printerIpAddr,
|  | int | printerIpPort
| ) |  | throws CustomException
| inline

Connects to WiFi/Ethernet Printer device.

Remarks
  NOTE: From Android 3.0 Network operations are not allowed on the UI Thread(main thread). You have to do the network communication in a separate thread. Google Android developer link about it.

Parameters

  printerIpAddr | String value with IP ADDRESS of device to connect
  printerIpPort | integer value with IP PORT of device to connect

Returns
  printer driver class according to its model/printer id

Exceptions

  CustomException | if WiFi/Ethernet device is not printer or printer model is not supported

CustomPrinter it.custom.printer.api.android.CustomAndroidAPI.getPrinterDriverUSB | ( | UsbDevice | device,
|  | Context | cobj
| ) |  | throws CustomException
| inline

Connects to Usb Printer device.

Parameters

  device | USB object of device to connect
  cobj | Context object

Returns
  printer driver class according to its model/printer id

Exceptions

  CustomException | if USB device is not printer or printer model is not supported