i execute this sample code in android3.0
http://developer.android.com/resources/samples/BluetoothChat/res/index.html
Bluetooth Chat
<!-- BluetoothChat -->
<string name="send">Send</string>
<string name="not_connected">You are not connected to a device</string>
<string name="bt_not_enabled_leaving">Bluetooth was not enabled. Leaving Bluetooth Chat.</string>
<string name="title_connecting">connecting...</string>
<string name="title_connected_to">connected to <xliff:g id="device_name">%1$s</xliff:g></string>
<string name="title_not_connected">not connected</string>
<!-- DeviceListActivity -->
<string name="scanning">scanning for devices...</string>
<string name="select_device">select a device to connect</string>
<string name="none_paired">No devices have been paired</string>
<string name="none_found">No devices found</string>
<string name="title_paired_devices">Paired Devices</string>
<string name="title_other_devices">Other Available Devices</string>
<string name="button_scan">Scan for devices</string>
<!-- Options Menu -->
<string name="secure_connect">Connect a device - Secure</string>
<string name="insecure_connect">Connect a device - Insecure</string>
<string name="discoverable">Make discoverable</string>
if i set avd manager to 2.2 it gives me some error..
why?
OK.. sounds like you have SDK3.x and above only functionality in your bluetoothChat app. For a start, the action bar is an android 3+ feature. in this case you will have a problem going back to target Android v2.2
my copy of the example app came from the 2.1 examples, and it works fine with SDK 2.1 (played with this the most) and 2.2 (just changed to this) and I can’t find anywhere it used listenUsingInsecureRfcommWithServiceRecord() in any of my java files.
Try using your SDK manager to grab the SDK 2.2 samples, and re-import from there and see if you have the same problems.