Hello,
I am developing an android chat application. It works well on the emulator. But from the android mobile(Using HTC), it doesnot receives UDP packets from other devices. But it receives well from the same device and also sends the packets well. How to make the application to receive the UDP packets from other devices also. Please help me on this.....
Below is the code using for socket connection and receive data.
DatagramChannel channel = DatagramChannel.open( );
DatagramSocket socket = channel.socket( );
SocketAddress address = new InetSocketAddress(DEFAULT_PORT);
socket.bind(address);
ByteBuffer buffer = ByteBuffer.allocateDirect(MAX_PACKET_SIZE);
channel.receive(buffer);