package exam.BluetoothTest_5;
import java.io.IOException;
import java.util.UUID;
import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothSocket;
import android.os.Bundle;
import android.util.Log;
public class BluetoothTest_5 extends Activity {
 
 BluetoothAdapter bluetooth = BluetoothAdapter.getDefaultAdapter();
 UUID uuid = UUID.fromString("00001101-0000-100­0-8000-00805F9B34FB");
 @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        try{
         BluetoothDevice device = bluetooth.getRemoteDevice("00:19:01:21:42:FE");
         BluetoothSocket clientSocket = device.createRfcommSocketToServiceRecord(uuid);
         clientSocket.connect();
        }catch(IOException e){
         Log.d("BLUTOOTH",e.getMessage());
        }
    }
}


현재 안드로이드와 블루투스 임베디드 모듈과 연결해 로봇을 조종하려고 합니다. (SPP프로파일)

위의 소스는 그냥 원격장치와 접속까지만 한것입니다.

원격장치의 블루투스 주소는 알고있어서 위의 코드처럼 적어놓았습니다.

그런데 폰에 넣어 실행하면 강제로 종료됩니다.

왜그런걸까요 ㅜ