【问题标题】:Android Bluetooth Send Private/Internal File using OBEXAndroid 蓝牙使用 OBEX 发送私有/内部文件
【发布时间】:2012-04-19 21:51:49
【问题描述】:

是否可以通过蓝牙从 Android 应用程序私有目录发送文件? (目录 /data/data//.. (getFilesDir()))
我无法在任何地方找到并回答这个问题。

这种 Intent.ACTION_SEND 方法适用于外部文件:
Sending a File using Bluetooth OBEX Object Push Profile (OPP)

但是,当我尝试发送私人文件时,我得到“未发送未知文件”
当 BtOpp 抛出 FileNotFoundException 时,WCat 显示“BtOpp 服务“无法为 OUTBOUND 信息 57 打开文件”

谢谢

【问题讨论】:

  • 没有。您可以将文件从内部存储复制到外部存储,然后尝试发送。

标签: android file bluetooth internal obex


【解决方案1】:
String path = con.getFilesDir().getAbsolutePath() + File.separator  + TEMP_FILE_NAME; //i will get file from your /data/data/...
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("plain/text");// 
i.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:/" + path));
startActivity(Intent.createChooser(i, "Send File"));

如果工作,请点击接受.... 谢谢

【讨论】:

  • DeepSan,请停止要求人们接受你的答案。这只是噪音,给人的印象是过于需要。如果他们愿意,他们会接受的。
猜你喜欢
  • 2011-07-31
  • 2012-01-01
  • 2012-03-31
  • 1970-01-01
  • 1970-01-01
  • 2011-02-23
  • 2012-10-13
  • 2013-01-07
  • 2012-08-17
相关资源
最近更新 更多