Znajdowanie identyfikatorów UUID w systemie Android 2.0

Piszę program, który musi być uruchomiony w systemie Android 2.0. Obecnie próbuję podłączyć urządzenie z Androidem do wbudowanego układu Bluetooth. Otrzymałem informacje dotyczące używania fetchuidsWithSDP () lub getUuids (), ale strona, którą przeczytałem, wyjaśniła, że ​​metody te są ukryte w zestawie SDK 2.0 i muszą być wywoływane za pomocą odbicia. Nie mam pojęcia, co to znaczy i nie ma wyjaśnienia. Podany jest przykładowy kod, ale za nim bardzo mało wyjaśnień. Miałem nadzieję, że ktoś pomoże mi zrozumieć, co tu się właściwie dzieje, ponieważ jestem bardzo nowy w rozwoju Androida.

String action = "android.bleutooth.device.action.UUID";
IntentFilter filter = new IntentFilter( action );
registerReceiver( mReceiver, filter );

Strona, którą przeczytałem, mówi również, że w pierwszej linii celowo bluetooth napisano „bleutooth”. Gdyby ktoś mógł to wyjaśnić, byłbym wdzięczny za to, jak również nie ma to dla mnie sensu, chyba że programiści popełnili literówkę.

private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
@Override
public void onReceive( Context context, Intent intent ) {
    BluetoothDevice deviceExtra = intent.getParcelableExtra("android.bluetooth.device.extra.Device");
    Parcelable[] uuidExtra = intent.getParcelableArrayExtra("android.bluetooth.device.extra.UUID");
}

};

Mam problem z zrozumieniem, jak dokładnie znajduję poprawny identyfikator UUID dla mojego wbudowanego układu Bluetooth. Gdyby ktoś mógł pomóc, byłoby to bardzo mile widziane.

EDYTUJ: Dodam resztę mojej metody onCreate (), abyś mógł zobaczyć z czym pracuję.

 public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Set up window View
    setContentView(R.layout.main);

    // Initialize the button to scan for other devices.
    btnScanDevice = (Button) findViewById( R.id.scandevice );

    // Initialize the TextView which displays the current state of the bluetooth
    stateBluetooth = (TextView) findViewById( R.id.bluetoothstate );
    startBluetooth();

    // Initialize the ListView of the nearby bluetooth devices which are found.
    listDevicesFound = (ListView) findViewById( R.id.devicesfound );
    btArrayAdapter = new ArrayAdapter<String>( AndroidBluetooth.this,
            android.R.layout.simple_list_item_1 );
    listDevicesFound.setAdapter( btArrayAdapter );

    CheckBlueToothState();

    // Add an OnClickListener to the scan button.
    btnScanDevice.setOnClickListener( btnScanDeviceOnClickListener );

    // Register an ActionFound Receiver to the bluetooth device for ACTION_FOUND
    registerReceiver( ActionFoundReceiver, new IntentFilter( BluetoothDevice.ACTION_FOUND ) );

    // Add an item click listener to the ListView
    listDevicesFound.setOnItemClickListener( new OnItemClickListener()
    {
      public void onItemClick(AdapterView<?> arg0, View arg1,int arg2, long arg3) 
      {
          // Save the device the user chose.
          myBtDevice = btDevicesFound.get( arg2 );

          // Open a socket to connect to the device chosen.
          try {
              btSocket = myBtDevice.createRfcommSocketToServiceRecord( MY_UUID );
          } catch ( IOException e ) {
              Log.e( "Bluetooth Socket", "Bluetooth not available, or insufficient permissions" );
          } catch ( NullPointerException e ) {
              Log.e( "Bluetooth Socket", "Null Pointer One" );
          }

          // Cancel the discovery process to save battery.
          myBtAdapter.cancelDiscovery();

          // Update the current state of the Bluetooth.
          CheckBlueToothState();

          // Attempt to connect the socket to the bluetooth device.
          try {
              btSocket.connect();                 
              // Open I/O streams so the device can send/receive data.
              iStream = btSocket.getInputStream();
              oStream = btSocket.getOutputStream();
          } catch ( IOException e ) {
              Log.e( "Bluetooth Socket", "IO Exception" );
          } catch ( NullPointerException e ) {
              Log.e( "Bluetooth Socket", "Null Pointer Two" );
          }
      } 
  });
}

questionAnswers(2)

yourAnswerToTheQuestion