Magtek BulleT Manuel d'utilisateur Page 11

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 11
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 10
Development
else
{
//Handle Error and Return
}
}
private boolean IsCompleteMessage(String lpstrData)
{
try
{
if (lpstrData.length() > 0)
{
if (Character.toString('\r').compareTo(
Character.toString(lpstrData
.charAt(lpstrData.length() - 1))) == 0)
{
return true;
}
}
}
catch (Exception ex)
{
}
return false;
}
Add Code to BluetoothChat.java
// The Handler that gets information back from the BluetoothChatService
private final Handler mHandler = new Handler() {
case MESSAGE_READ:
byte[] readBuf = (byte[]) msg.obj;
// construct a string from the valid bytes in the buffer
String readMessage = new String(readBuf, 0, msg.arg1);
if (readMessage.length() > 0)
{
mStringCardDataBuffer += readMessage;
if (IsCompleteMessage(mStringCardDataBuffer))
{
processCardData (mStringCardDataBuffer);
mStringCardDataBuffer="";
}//
}
break;
Vue de la page 10
1 2 ... 6 7 8 9 10 11

Commentaires sur ces manuels

Pas de commentaire