aspose file tools*
The moose likes Android and the fly likes How to control pc notepad by bluetooth enabled android device? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "How to control pc notepad by bluetooth enabled android device?" Watch "How to control pc notepad by bluetooth enabled android device?" New topic
Author

How to control pc notepad by bluetooth enabled android device?

hassan naveed
Greenhorn

Joined: Feb 16, 2012
Posts: 8
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!!!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
Using punctuation would make this easier to understand; you can edit your post to add that.


Ping & DNS - my free Android networking tools app
Przemek Boryka
Ranch Hand

Joined: Dec 06, 2011
Posts: 51

Hi !

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 ;)

Bye sorry for my english I am still learning
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to control pc notepad by bluetooth enabled android device?