Friday, March 23, 2012

How to check whether your Android device has Bluetooth support?


How to check whether your Android device has Bluetooth support?

Hello all..
This is a simple example to check whether your android device supports Bluetooth or not.
May be currently all devices may have bluetooth support, but still ………….
?
Drag and copy the code
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
package pack.coderzheaven;
 
import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.os.Bundle;
 
public class BluetoothExample extends Activity  {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
 
        BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
        if (mBluetoothAdapter == null) {
            System.out.println("Device do not support Bluetooth..");
        }
    }
}

No comments: