Code example for UsbManager

Methods: openAccessory

		new Accessory(callback, usbManager, accessory);
	private Accessory(OnAccessoryCallback callback, UsbManager usbManager,
			UsbAccessory accessory) throws IllegalStateException {
		mParcelFileDescriptor = usbManager.openAccessory(accessory);
		if (mParcelFileDescriptor == null) {
			Log.e(TAG, "accessory open failed");
			throw new IllegalStateException();
		FileDescriptor fd = mParcelFileDescriptor.getFileDescriptor();
		mInputStream = new FileInputStream(fd);
		mOutputStream = new FileOutputStream(fd);
		new LooperThread().start();
	public void write(byte... data) throws IOException {
Connect your IDE to all the code out there  Get Codota for Java