안드로이드 개발 질문/답변
(글 수 45,052)
안드로이드 블루투스 통신을 이용해서 임베디드 보드의 모터를 돌리려고 합니다ㅠㅠ
우선안드로이드 어플을 만들려고 해서 안드로이드api를 보면서 짜고 있었는데요ㅠㅠ
BluetoothAdapter mBTAdapter = BluetoothAdapter.getDefaultAdapter();
if(mBTAdapter == null) {
// device does not support Bluetooth
if(mBTAdapter == null) {
// device does not support Bluetooth
}
else {
if(!mBTAdapter.isEnabled()) { // 블루투스 활성화 여부
// Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
// startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
// }
}
else {
if(!mBTAdapter.isEnabled()) { // 블루투스 활성화 여부
// Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
// startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
// }
}
까지만 짯는데요ㅠㅠ mBTAdapter.isEnabled()를 호출 하기만 해도 런타임에러가 나네요ㅠㅠ
왜그런건지 정말모르겟습니다ㅠㅠ 퍼미션도 제대로 했는데ㅠㅠ
제발답변부탁드립니다ㅠㅠ




메니페스트 확인은 해보셨나요?