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);

Hi Every One,
Please somebody help me on this issue. Any Clues? I have been Stuck on this for long time.

regards,
Sakthi

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.