I wish to perform device-to-device file transfer over Bluetooth in my Android application. Currently I have written the code necessary to make connections between multiple Bluetooth devices and I have retrieved connected BluetoothSockets for data exchange.
Is there a library available which implements file transfer that can be given a socket, or streams to use?
If not, can someone point me towards information about implementing the ability myself?
I am very new to file transfer programming and Bluetooth, so any help is appreciated.
Also, because I want this functionality built into my app, I am not looking to just run some other end-user app on the phone, I really do need to be able to code against this functionality (whether via a library, or my own implementation).
Normally over Bluetooth you would use something like OPP.
However that doesn't seem to be implemented on Android yet...
What I would do, is try serializing the data and sending it via RFCOMM or SPP bit by bit. For XML there is XStream, or, even simpler, Google's Protobuf.
Let me know if it works.
Related
I'm trying to use an Android device to control an Arduino through Bluetooth. I able to control an LED and a few component at the Arduino. But I don't know how to have Android receive data from the Arduino similar to how the BlueTerm application works.
How can I do this? I don't want to use the Amarino library, because I don't want to have to use an extra .jar.
I suggest using a small library called Amarino. I have used it in the past and it provides a VERY simple interface for communicating from Android to Arduino and visa versa. It has a great deal of tutorials and you can even read the creators thesis to get a full understanding of how everything works behind the scenes.
I realize that this is the kind of question that frequently gets a lot of (well deserved) "what have you tried" comments and down-votes, but I'm hoping that by the time I'm done asking I can avoid that.
I've been looking around but unable to find the answer to how one goes about writing an application that consists of the following three things:
An Android app that connects to a host device via bluetooth
Communication io layer that sends signals back and forth on
that bluetooth connection
A host resident native app (preferably Unity3D, or AIR) that can receive/send messages back and forth to the connected app.
I have written many Android applications so I am not in need of any kind of "getting started" hand-holding, rather I just need some guidance (preferably in the way of a web link or book tutorial) on what it takes to utilize bluetooth and how one actually communicates via it.
Thanks in advance for all useful tips.
Here are a few links that I found in terms of Bluetooth connections
First of all the dev guide(I assume you have already looked here, but if not this is a good place to start)
http://developer.android.com/guide/topics/connectivity/bluetooth.html
http://developer.android.com/reference/android/bluetooth/BluetoothDevice.html
This one is a basic tutorial on how to Bluetooth on android
http://luugiathuy.com/2011/02/android-java-bluetooth/
This is a long PDF on Bluetooth programming in general (I haven't read it, but from what I have seen it looks over in depth) it covers java and OSX, but not android
people.csail.mit.edu/rudolph/Teaching/Articles/BTBook.pdf
Here is a similar SO question which might contain helpful links
Code samples for Android Bluetooth programming
This is the best Bluetooth open source project that I could find for android, it doesn't fit your description over well, but here it is anyways
http://code.google.com/p/bluetooth-remote-control/source/browse/#svn%2Ftrunk%2Fsrc%2Fpro%2Fapus%2Fblueremote
I realise that a lot of these links are simpler than what you really want, if I find anything more complicate I will add that.
I would like to develop a Remote application for Peer-to-peer Android Device using TCP/IP connection. once one of the device successfully remote to the other, he/she will be able to see what the other device is doing (example : doing drawing with an application, etc).
Is this possible to do or there is other way that is more efficient to do ? Any reference/road map is appreciated. code samples are greatly appreciated.
Here have pair of projects implementing a remote service and a client for it:
https://github.com/commonsguy/cw-advandroid/tree/master/AdvServices/RemoteService/
https://github.com/commonsguy/cw-advandroid/tree/master/AdvServices/RemoteClient/
I think this can help you..
Thanks...
If remote means on the LAN, you can use IP multicasting. If remote means the WAN, then you'll need a fully fledge P2P framework, with NAT traversal solutions, such as JXTA for example. Google JXTA and you will find info, including code samples. It is not the only solution, you could explore JGroups too.
There are UDP based P2P frameworks too. These are a bit better at NAT traversal, but you're left with the duty of putting the pieces of the puzzle (i.e., data slicing) back together.
I want to develop an app that makes use of the WiFi interface to establish cooperation amongst a subset of mobile devices, which will then allow me to exploit location information and achieve higher energy efficiency (cluster based communications).
For security reasons, I must append a digital signature (or a keyed hash) at the end of specific WiFi frames (e.g. when ARP protocol runs).
Is it possible to achieve this in Android OS?
Will I be able to update the WiFi protocol stack in Android?
Will it be feasible?
Any literature suggestions?
I'd be grateful for any directions.
Is it possible to achieve this in Android OS?
I think you would need some kind of raw sockets. For that you can look to Raw Sockets on Android
Will I be able to update the WiFi protocol stack in Android?
Android is open source so you can try to modify it and load another Android firmware to your phone. For example, you have custom firmware versiones like the one you find at http://www.cyanogenmod.com/
Will it be feasible?
In my opinion it is possible but very difficult. Probably you can find a more feasible solution for your problem.
Any literature suggestions?
You can read this threat about how to download and edit Android source code: http://groups.google.com/group/android-kernel/browse_thread/thread/6e428031c5e70417/8d99386a62f7d75e?pli=1
Good luck.
I have an android tablet and have an application installed on it... Now i need to control this application on the tablet through my android device... is there a way to do such thing?
Explore this example project by Google
http://developer.android.com/resources/samples/BluetoothChat/index.html
see how it works and try to implement your programming skill to transform this chat application to your idea...
How ever I am assuming that you are the author of application which you have desire to control.
happy coding.
EDITED:
Logic structure is simple both application should be able to detect bluetooth and paired(connect) with each other for communication. once you have communication instead of sending message(in chat) you send some information via buttons which will execute some methods on tablet...Just a thought... As if in chat application you can update and add messages to your thread...this application will help you to reach goal. Lot of work though!
If you are familiar with Sockets, this shouldn't be a problem for you, because the Bluetooth-connection and communication in Android is very much the same. See the Bluetooth-Tutorial and Googles "Bluetooth-Chat" example.