How to send a image file from one device to another using bluetooth in Android programmatically. I Can send text files correctly,but when trying to send image files it shows error.
Sample code is here:
ContentValues values = new ContentValues();
values.put(BluetoothShare.URI, url);
values.put(BluetoothShare.DESTINATION, deviceAddress);
values.put(BluetoothShare.DIRECTION, BluetoothShare.DIRECTION_OUTBOUND);
Long ts = System.currentTimeMillis();
values.put(BluetoothShare.TIMESTAMP, ts);
getContentResolver().insert(BluetoothShare.CONTENT_URI, values);
Here url
refers to the path of the image.