2

我正在使用以下代码使用蓝牙传输文件而无需用户交互,如何使用此代码传输多个文件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);
4

0 回答 0