我有一个任务,通过蓝牙程序共享一个文件。我尝试使用stackoverflow.But提供的一些示例,但它无法识别确切的solution.Let,我知道如何在安卓上使用OBEX api。
我尝试了用安卓实现Bluecove jar,我在构建路径中添加了jar,当我运行应用程序时,它显示了一个错误,比如- BlueCove native library version mismatch你能给我提供必要的解决方案来解决这个问题吗?当我使用加载库时,它通常会指出javax.bluetooth.BluetoothStateException: BlueCove本机库版本不匹配。
帮我解决这个问题。
提前谢谢。
发布于 2012-06-13 21:59:12
一种简单的方法是使用现有的应用程序通过BT发送文件(共享功能是Android的架构目标之一)。安装一个app (在playstore中搜索蓝牙),并使用类似于以下方式发送您的文件:
private File exportFile; // set when creating the file
/**
* Send the export file via an intent with the send action.
*/
private void doSendFile() {
final Intent i = new Intent(Intent.ACTION_SEND);
i.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(this.exportFile));
i.setType("text/*");
final Intent chooser = Intent.createChooser(i, this.global.getText(R.string.txt_send_chooser_title)); // R.string.... is the label's ID for the chooser headline
chooser.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
this.startActivity(chooser);
}https://stackoverflow.com/questions/11016236
复制相似问题