This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I want to connect my android fone to pc by bluetooth and want to open notepad on pc. Then I want to write words on mobile but it should later write on my pc note pad. can you please tell how can i do that. I had a look at the bluetooth chat code on android website, it looks quite promising for what i want to do, bu i dont know if that is the rite code for it..please help!!!
Chat Example is very good for starting fun with bluetooth , you can use SPP profile (Bluetooth has many profiles, SPP is one of many )
SPP is a simple virtual COM port, you can put and receive data as a simple arrays of bytes ;)
When you connect to other bluetooth device you must create socket, the socket must contain information about of using communication like :
- type of connection (RFCOMM, L3CAP ... ) in your problem you should use RFCOMM, *
- socket type (new or connect to existing socket)*
- encryption and authorization*
- channel (1 - 30, bluetooth 2.1 use 30 channels to communication)*
- UUID (identifier of services, when you connect to other android device you can use your own UUID, but when you connect to other non android device you must use SPP UUID identifier)
* - you can't set those options in BluetoothDevice object, you can only set UUID. To use those options you need to using reflection uncover hidden methods some methods are uncovered in new version of Android 3.0 and newer.
You can install BlueSolei, it will activate SPP profile (on other device) otherwise you could probably not be able to connect.
Rest is contained in CHAT EXAMPLE ;) Have a good time ;)