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

烂漫一生 提交于 2019-12-01 16:49:59
Jasoneer

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!