closeBT
Bluetoothシリアルデバイスに接続するための簡単なAndroidアプリケーションを作成しました。Androidが接続されていない場合は、クラッシュのためにデバイスが範囲外にある可能性があることを追加したいと思います。
どうすればいいですか?このコードは正しいですか?
protected void onStart() {
super.onStart();
findBT(); //Check if bluettoth enable and paired devices
try {
openBT(); //open sockets,streams
} catch (IOException e) {
e.printStackTrace();
closeBT();
}
}