Skip to first unread message

smith park

unread,
Oct 27, 2017, 8:30:59 AM10/27/17
to MIT App Inventor Forum
앱 인벤터 2를 이용하여 앱을 제작하고 있는데요...스크린1에서 블루투스를 연결한 후 버튼을 눌러 다른 스크린으로 넘어가면 블루투스가 끊깁니다. 앱인벤터에서 한 스크린에서 블루투스를 사용하는 걸 권장한다고 그랬는데 다른 스크린에서도 블루투스 연결이 유지되어 있을 수는 없나요?
>>그래서 한 화면에 모두 옮겨 담았더니 블루투스가 연결이 안되어 있을 때, 연결이 안되어 있다는 경고창이 1초간격으로 계속 뜹니다. 블루투스가 연결되면 경고창이 안뜨고요. 블루투스 연결을 시도하고 실패했을 때 경고창이 뜨게 할 수 없나요?

Evan Patton

unread,
Oct 27, 2017, 10:18:03 AM10/27/17
to MIT App Inventor Forum
The translation Google provides is a bit garbled but I will do my best to answer what I think is your question.

Is there a warning can be opened when you attempt a Bluetooth connection fail?

The BluetoothClient's Connect method should return false if the connection fails. If it does, then you could use the notifier component to present a warning/error to the user. If you are looking for a warning/error for when the Bluetooth connection is lost, then the only way to do that currently is to occasionally try to interact with the device and if it has gone away the BluetoothError will run where you can notify the user.

Regards,
Evan
Reply all
Reply to author
Forward
0 new messages