Android:通过蓝牙可接受的文件类型存在问题

发布于 2024-09-03 18:08:37 字数 183 浏览 5 评论 0原文

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

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

我最近尝试将其他文件推送到我的手机(在我的例子中是 gpx),但我的手机自动拒绝了它。

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

I've got a problem with pushing files to my Nexus One.

It seems to me that there is only a small selection of file types that are accepted by my phone (such as jpg, gif and so on).

I recently tried to push other files to my phone (in my case gpx) and my phone rejected it automatically.

Is there a way to bypass or extend this filter in my program?
Is there also a way to catch those files by a service?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

天煞孤星 2024-09-10 18:08:37

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

<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>

I've got this error before. It would say "File Not Accepted: The target device claims it will not accept a file of the type you are trying to send" or "Error, device does not accept files of this type" This is because of not having permission to accept this file. You have to add permission in the Manifest file.

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

Under the activity enter something like this!

<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>
何时共饮酒 2024-09-10 18:08:37

您可以尝试为您期望收到的文件扩展名添加意图过滤器,请参阅 针对特定文件扩展名的 Android 意图过滤器?

You could try to add intent filters for the file extensions you expect to receive, see Android intent filter for a particular file extension?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文