If I send a UDP packet to Tablet's IP, e.g. This is AndroidManifest.xml permissions: Log.v("UDServerThread", "Mensaje recibido.") Public UDPServerThread(String serverName, int port) throws IOExceptionÄatagramPacket packet = new DatagramPacket(buf, buf.length) Private static final int MESSAGE_SIZE = 11 This is UDP socket thread: public class UDPServerThread extends Thread MyThread = new UDPServerThread("X", 8001) Txt.setText(Integer.toString(ipAddress)) TextView txt = (TextView)findViewById(R.id.deviceIP) WifiInfo wifiInfo = wifiManager.getConnectionInfo() WifiManager wifiManager = (WifiManager) getSystemService(WIFI_SERVICE) ** Called when the activity is first created. This is my Activity: public class UDPSocketActivity extends Activity Using desktop program Docklight scripting v1.9 I see that this device sends a 11 bytes packet every 5 seconds, by my app doesn't receive every packet: sometimes it receives one, and sometimes it receives 5 or 6 packets at the same time. I'm going to use this app to listen to UDP packets send by a device which is sending UDP packets to 255.255.255.255:8001 every 5 seconds. I'm developing an Android 3.1 Tablet application.
0 Comments
Leave a Reply. |