Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 have really not found any example for Android, except some great apps on the market as Bluetooth File Transfer. How can it be implemented in an app?

like image 384
Cris Avatar asked Aug 25 '11 16:08

Cris


People also ask

How do I open files received by Bluetooth?

In Bluetooth & other devices settings, select Send or receive files via Bluetooth > Receive files. Have your friend send the files from their device. See Send files over Bluetooth. On your PC, on the Save the received file screen in Bluetooth File Transfer, select the location to save the files to, then select Finish.

How do I share files with Bluetooth?

In Bluetooth & other devices settings, select Send or receive files via Bluetooth. In Bluetooth File Transfer, select Send files > choose the device you want to share to > Next. Select Browse > the file or files to share > Open > Next (which sends it) > Finish.


1 Answers

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.

like image 90
Jasoneer Avatar answered Oct 01 '22 01:10

Jasoneer