Code example for UsbManager

Methods: hasPermissionopenDevice

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();
Contextual code suggestions in your IDE  Get Codota for Java