I\'m trying to create a basic bluetooth application, for testing the device.
I got the code from developer.android. Here is the link : http://developer.android.com/
Try using the Bluetooth Chat sample project provided as a part of the SDK if you are just trying to test the device. That code you're trying to use and the one provided on developer.android.com are included in the Bluetooth Chat example.