hi everyone,
i'm programming a bluetooth application in emulator everything is ok connection data transfer vs.
but on the real phone (6600 and 7610) connection ok but
when data transfer begin program crushes and throws no error.
here is my code :
try {
DataInputStream datain = person.conn.openDataInputStream();
int num = datain.available();
System.out.println("Available: "+num);
// if(num!=0){
int signal = datain.readInt();
// System.out.println("Gelen Signal: " + signal);
if (signal == Person.SIGNAL_GETCARDS) {
if (Game.yereDagit) {
for (int i = 0; i < 4; i++) {
int a = datain.readInt();
int b = datain.readInt();
int[] temp = {
a, b};
Game.yerdekiler[i] = temp;
Game.puanKontrol(Game.yerdekiler[i]);
}
Game.yerdeKapali = true;
Game.yereDagit = false;
Game.yerdekiKagit = Game.yerdekiler[3];
Game.atilanKagitlar.addElement(Game.yerdekiKagit);
Game.yerdeKagitSayisi = 4;

}

for (int i = 0; i < 4; i++) {
int a = datain.readInt();
int b = datain.readInt();
int[] temp = {
a, b};
Game.elimizdekiler[i] = temp;
}
Game.rakiptekiKagitSayisi = 4;
Game.elimizdekiKagitSayisi = 4;
Game.kontrolEt = false;
Game.oyunModu = Game.OYUN;
Game.oyuncuSirasi = true;
}
else if (signal == Person.SIGNAL_GETTHROWED) {
int[] temp = new int[2];
temp[0] = datain.readInt();
temp[1] = datain.readInt();
Game.kagitAl(temp);
Game.oyuncuSirasi = true;
Game.rakiptekiKagitSayisi--;
}
else if (signal == Person.SIGNAL_SENDPOINT) {
Game.rakipPuan = datain.readInt();
System.out.println("Rakip Puan: " + Game.rakipPuan);
}
else if (signal == Person.SIGNAL_GAMEMODE) {
Game.oyunModu = datain.readInt();
// if(Game.oyunModu==Game.DESTE_AYARLA)Pishti.benimSiram=true;
}
else if (signal == Person.SIGNAL_3POINT) {
Enumeration e = Game.atilanKagitlar.elements();
int[] temp = new int[2];
while (e.hasMoreElements()) {
temp = (int[]) e.nextElement();
Game.kimAldiKontrol(temp);
}

Game.oyuncuPuan += 3;
//person.sendData(Person.SIGNAL_SENDPOINT);
Game.bizaldik[4] = 1;
Game.rakipaldi[4] = 0;
}
else if (signal == Person.SIGNAL_OPPENENTPOINT) {
Game.oyuncuPuan += datain.readInt();
}
// }
datain.close();

}
catch (Exception e) {
e.printStackTrace();
person.netLayer.m.showErrorScreen(e);
}
in emulator
datain.available() is 0.
is this the problem or what is it?