Note that there are some explanatory texts on larger screens.

plurals
  1. PObluetooth file sending via BluetoothShare class is not working
    text
    copied!<p>I am developing an application where i have <strong>file uri as well as bt device address with me</strong>. I need to send the file to the defined bt device. But, the device picker screen should not be shown. <strong>It should directly start the device sending</strong>.</p> <p>Obviously, <strong>intent:ACTION_SEND is not an option</strong> here, as it will show the chooser dialog. The main intension of the application is to bypass the chooser dialog and enable user to send selected file to selected device directly.</p> <p>So, i was trying the following solution suggested in stack-overflow:</p> <pre><code>/*BluetoothDevice device; String filePath = Environment.getExternalStorageDirectory().toString() + "/file.jpg"; 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);*/ </code></pre> <p>But unfortunately, it is not working. After getContentResolver().insert, there is no action taken. Needless to say, i have tried various permissions and other stuffs, but to no effect.</p> <p>So, people who have used this code, please provide your suggestions. Any help to meet the requirement will be very much appreciated.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload