BluetoothAdapter | Android Developers
getDefaultAdapterでデフォルトのアダプタインスタンスを取得。
実機の場合は取得できたが、エミュレータの場合はどうなるか。
strings.xmlで、
Button1。
activity_main.xmlで、
Button。
MainActivity.javaで、
BluetoothAdapter.getDefaultAdapterでインスタンス取得できるかnullかを試す。
AndroidManifest.xmlで、
android.permission.BLUETOOTHを書いている。
右下のSettingsを押す。
BluetoothはOFF。
起動時。
Button1を押すと、
not supportedなのでnullが返ってきてる。
BluetoothをONにする。
ONOFF関係なくエミュレータはnot supportedみたい。