【问题标题】:how can i send file over bluetooth in android?我如何在android中通过蓝牙发送文件?
【发布时间】:2012-12-17 12:59:58
【问题描述】:

我已经搜索了很多,但我没有找到任何解决方案,但我在这个例子的某个地方:

ContentValues values = new ContentValues(); 
values.put(BluetoothShare.URI, "content://" + uritoSend);
values.put(BluetoothShare.DESTINATION, deviceAddress);
values.put(BluetoothShare.DIRECTION, BluetoothShare.DIRECTION_OUTBOUND);    
Long ts = System.currentTimeMillis();  
values.put(BluetoothShare.TIMESTAMP, ts);  

但是这个例子给出了错误不受支持的内容。请给我正确的答案。

提前致谢

【问题讨论】:

标签: android


【解决方案1】:
Intent intent = new Intent();  
intent.setAction(Intent.ACTION_SEND);  
intent.setType("image/*");


String uri = "/mnt/sdcard/test.jpg";
intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(uri)));
startActivity(intent);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-15
    • 2016-05-07
    • 2016-05-08
    • 1970-01-01
    • 2012-02-14
    相关资源
    最近更新 更多