API version 15

Runtime.IsBluetoothEnabledメソッド変更履歴

iOSAndroidWindows

 

説明

端末のBluetooth機能が有効になっているかを取得します。

 

呼出形式

var result = rt.IsBluetoothEnabled()

 

戻り値

端末のBluetooth機能が機能が有効になっていれば$TRUEを、そうでなければ$FALSEを返します。

 

引数

なし

 

例外

RTM-84

Bluetoothの使用が許可されていません。OSの設定でBluetoothの使用を許可してください。*1

使用例

if(!Runtime.IsBluetoothEnabled()){
    MessageBox("Bluetooth機能をONにします。");
    try {
        Runtime.SetBluetoothEnabled(true);
    } catch (e) {
        //.Message("例外", e.Message, "が発生しました");
    }
} else {
    /* Bluetooth機能を使用することができます */
}

 

関連項目

ShowBluetoothSettingsSetBluetoothEnabledメソッド

 

変更履歴
*1 API version 16で追加されました。


「オンラインマニュアル」一覧へ戻る
「Bizの宝箱」TOPへ戻る