我使用以下代码在没有用户交互的情况下使用蓝牙传输文件,
如何使用此BluetoothShare.java
传输多个文件:
String filePath = Environment.getExternalStorageDirectory().toString() + "/test.mp3";
ContentValues values = new ContentValues();
values.put(BluetoothShare.URI, Uri.fromFile(new File(filePath)).toString());
values.put(BluetoothShare.DESTINATION, device.getAddress());
values.put(BluetoothShare.DIRECTION, BluetoothShare.DIRECTION_OUTBOUND);
Long ts = System.currentTimeMillis();
values.put(BluetoothShare.TIMESTAMP, ts);
Uri contentUri = getContentResolver().insert(BluetoothShare.CONTENT_URI, values);