【问题标题】:Android: Issue with acceptable file types via bluetoothAndroid:通过蓝牙可接受的文件类型问题
【发布时间】:2011-02-25 21:55:23
【问题描述】:

我在将文件推送到我的 Nexus One 时遇到问题。

在我看来,我的手机只能接受一小部分文件类型(例如 jpg、gif 等)。

我最近尝试将其他文件推送到我的手机(在我的情况下为 gpx),但我的手机自动拒绝了它。

有没有办法在我的程序中绕过或扩展这个过滤器?
还有一种方法可以通过服务捕获这些文件吗?

【问题讨论】:

  • 这很奇怪。我刚刚尝试将 .gpx 文件发送到我的 HTC Desire,它运行良好。它确实有 Android 2.1 的定制版本,但我认为这不会影响这类问题。也许拥有 Nexus One 的人可以尝试一下并报告
  • 嗯,我的 nexus 已经更新到 2.2...这可能是错误的来源吗?
  • 这个问题不是给开发者的,应该移到superuser.com
  • @rds:根据this answer上的评论,它实际上是针对开发人员的。

标签: android bluetooth file-type blacklist


【解决方案1】:

我以前遇到过这个错误。它会说“文件未接受:目标设备声称它不会接受您尝试发送的类型的文件”或“错误,设备不接受这种类型的文件”这是因为没有权限接受这个文件。您必须在清单文件中添加权限。

<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

在活动下输入类似这样的内容!

<activity name="BluetoothActivity">
<intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:mimeType="*/*" />
    <data android:pathPattern="*.*\\.gpx" />
</intent-filter>
</activity>

【讨论】:

    【解决方案2】:

    您可以尝试为您希望收到的文件扩展名添加意图过滤器,请参阅Android intent filter for a particular file extension?

    【讨论】:

      猜你喜欢
      • 2011-12-23
      • 1970-01-01
      • 2012-06-11
      • 2011-09-24
      • 1970-01-01
      • 1970-01-01
      • 2011-10-15
      • 1970-01-01
      • 2012-02-07
      相关资源
      最近更新 更多