Code example for UsbManager

Methods: hasPermission, openDevice

0
		} 
		return false; 
	} 
	 
	public boolean connectToDevice() { 
		if(mManager.hasPermission(mDevice)) {
			mDeviceConnection = mManager.openDevice(mDevice);
			if(mDeviceConnection == null) {
				Log.v(TAG, "cannot open usb device");
				return false; 
			} 
			 
			if(!mDeviceConnection.claimInterface(mStreamingIntf, false)) {
				Log.v(TAG, "failed to claim streaming interface");
				return false; 
			} 
			mCameraControls = new CameraControls(mDeviceConnection);
			initUvc(); 
			frameGrabber.start();
			renderingView.start();
			isStreaming = true;