- Android
-
2012-12-18
AndroidでBluetoothを使ってみます。
Bluetoothアダプタークラスをインポート
import android.bluetooth.BluetoothAdapter;
アダプターとリクエストコードの定義
BluetoothAdapter mBluetoothAdapter = null; final int REQUEST_ENABLE_BT = 1; //任意のコード
アクティビティのonCreateでアダプターをセットします。
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
}
7,413 views




