Android: how can i browse remote device file system via bluetooth?

前端 未结 2 1530
一向
一向 2021-01-18 02:39

I need to build an Android app that puts/gets files from a remote device via Bluetooth; the app must also browse the remote filesystem. I\'ve read something about OBEX but h

相关标签:
2条回答
  • 2021-01-18 03:27

    Since there is no standard method/implementation of OBEX OPP/FTP that is exposed to developers on Android, you will have to roll you own over the Bluetooth API which is powerful enough implement just about any protocol you want as it mirrors TCP sockets.

    The first thing you will have to do is get access to the filesystem. Assuming the SD Card, here is a guide otherwise you would need root access. Then you want to get a Bluetooth connection working between two devices (boilerplate code). Lastly you should Google up the protocol specification for OBEX OPP/FTP and implement it which is probably going to take the most time.

    I'm pretty sure that's how the other apps on the marketplace do it as they require the app on both devices in order to send/receive files and browse the filesystem. I can't go in depth on the OBEX protocol itself as I'm not familiar with it but I can elaborate on everything before that if needed. However a google search turned up this which may be useful while implementing.

    Not sure if this will help but I've seen this to have worked for a lot of people to send files.

    0 讨论(0)
  • 2021-01-18 03:33

    This is not possible with the built-in Android API. There are intents you can call to share files over Bluetooth - but compatibility between models varies. However, there are some methods if you would like to write an app for rooted phones. If this is the case, please note it.

    0 讨论(0)
提交回复
热议问题