首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Android上使用OBEX/Bluecove

如何在Android上使用OBEX/Bluecove
EN

Stack Overflow用户
提问于 2012-06-13 21:46:57
回答 1查看 895关注 0票数 1

我有一个任务,通过蓝牙程序共享一个文件。我尝试使用stackoverflow.But提供的一些示例,但它无法识别确切的solution.Let,我知道如何在安卓上使用OBEX api。

我尝试了用安卓实现Bluecove jar,我在构建路径中添加了jar,当我运行应用程序时,它显示了一个错误,比如- BlueCove native library version mismatch你能给我提供必要的解决方案来解决这个问题吗?当我使用加载库时,它通常会指出javax.bluetooth.BluetoothStateException: BlueCove本机库版本不匹配。

帮我解决这个问题。

提前谢谢。

EN

回答 1

Stack Overflow用户

发布于 2012-06-13 21:59:12

一种简单的方法是使用现有的应用程序通过BT发送文件(共享功能是Android的架构目标之一)。安装一个app (在playstore中搜索蓝牙),并使用类似于以下方式发送您的文件:

代码语言:javascript
复制
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);
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11016236

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档