1

I'm making an application for android. I'm connecting devices from Settings and I want to receive everything it's coming from bluetooth.
I don't have a socket-client connection like in the BluetoothChat example and the device that is sending must be any device.
Practically I must accept any file in my application and also send a message to the device.
I've tried with BluetoothShare.java, but with no luck:

ContentValues values = new ContentValues();
    String address= addressString;
    values.put(BluetoothShare.URI, Uri.fromFile(new File(path)).toString());
    values.put(BluetoothShare.DESTINATION, address);
    values.put(BluetoothShare.DIRECTION, BluetoothShare.DIRECTION_OUTBOUND);
    Long ts = System.currentTimeMillis();
    values.put(BluetoothShare.TIMESTAMP, ts);
    Uri contentUri = getContentResolver().insert(BluetoothShare.CONTENT_URI, values);
    grantUriPermission(BluetoothShare., contentUri, Intent.FLAG_GRANT_READ_URI_PERMISSION);

Any idea on how to implement it?

4

0 に答える 0