Code example for UsbManager

Methods: getDeviceList

0
		btnRefresh.setOnClickListener(new OnClickListener() {
			 
			@Override 
			public void onClick(View arg0) {
				// TODO Auto-generated method stub 
				HashMap<String, UsbDevice> deviceList = usbManager.getDeviceList();
				Toast.makeText(MainActivity.this, deviceList.size(), Toast.LENGTH_LONG).show();
			} 
		}); 
		refresh(); 
 
		if (null != usbDevice) {
			usbManager.requestPermission(usbDevice, mPermissionIntent);
			if (!usbManager.hasPermission(usbDevice)) {
				Toast.makeText(this,
						"No permission to connect to " + usbDevice,
						Toast.LENGTH_LONG).show();
				return; 
			} 
			writeData("hello world"); 
		}