在android中使用蓝牙(BluetoothShare.java)传输多个文件

时间:2013-03-27 05:31:59

标签: android file bluetooth transfer

我使用以下代码在没有用户交互的情况下使用蓝牙传输文件, 如何使用此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);

0 个答案:

没有答案