Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
161 views
in Technique[技术] by (71.8m points)

obexftp - How to receive image in android sent by a server using Obex FTP

I have developed an application in android using the Android Bluetooth Chat Example. https://developer.android.com/samples/BluetoothChat/index.html

I am suppose to receive data from an abc server by connecting my mobile client using Bluetooth. I have implemented Bluetooth Connectivity using RFCOMM as shown in above link. I am also able to receive text from server. However I am unable to receive Image file sent by server on Mobile Client. Server is sending image as a file using Obex FTP. Cannot post code here due to Confidentiality issues.

Can someone please tell me how to receive image in Android using Obex Protocol ? I am unable to find any API for the same in Android.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I recommend you to import javax.obex library. This library has nice APIs that helps you work with OBEX protocol. However, I had some problem using the library, because I couldn't find the package from the compiler bundle. I solved this problem by copying entire source files of javax.obex linked here.

The next problem was implementing the ObexTransport, but I sloved this problem by modifying this, as it caused runtime error that some methods are missing.

The last step is to open a bluetooth OBEX server using the apis. This and this files will help a lot.

P.S. I am developing an android bluetooth OBEX telnet(?) server and going to lost my source files on github. I will let you know later if you want. Anyway I hope my answer helped.

Edit: I posted more detailed explanation here. And Github repository here.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...