我需要将Bitmap设置为ImageView以保持16:9的比例.你有什么建议吗?主要解决方案可能是在自定义ImageView上的覆盖方法onMeasure,但是如何?
我正在尝试向智能卡发送命令.我使用Gemalto IDBridge CT30(PC TWIN阅读器)和通过USB连接到Android设备的IDBridge K30.
我尝试通过USB发送SELECT APDU命令:
boolean claim = openedConnection.claimInterface(usbInterface, true);
byte[] data = new byte[]{
(byte) 0x00, (byte) 0xA4, (byte) 0x04, (byte) 0x0C,
(byte) 0x07, (byte) 0xA0, (byte) 0x00, (byte) 0x00,
(byte) 0x01, (byte) 0x18, (byte) 0x45, (byte) 0x4E};
Run Code Online (Sandbox Code Playgroud)
之后我收到了答案:
final int dataTransferred = this.openedConnection.bulkTransfer(endPointOut, data, data.length, TIMEOUT_MS);
if(!(dataTransferred == 0 || dataTransferred == data.length)) {
throw new Exception("Error durring sending command [" + dataTransferred + " ; " + data.length + "]"); //$NON-NLS-1$ …
Run Code Online (Sandbox Code Playgroud)