Real Posté(e) 22 mars 2010 Share Posté(e) 22 mars 2010 Bonjour je suis entrain de développer un client UPNP pour Android. Au moment de la découverte mon application Android ne trouve aucuns devices, pourtant si j'exécute mon application en tant que Projet JAVA Application, je réussi bien à recupérer ma liste de devices. Il y a t'il une configuration à faire sur l'Emulateur Android ? (redirection de port). public class Wizard { private DatagramSocket socket; private DatagramPacket packet; private InetAddress address; private byte[] message; private int port; public Wizard() throws UnknownHostException { address = InetAddress.getByName("239.255.255.250");; message = new byte[1024]; port = 1900; } public ArrayList init_network() throws IOException { String search = "M-SEARCH * HTTP/1.1\r\nHOST: 239.255.255.250:1900\r\nMAN: \"ssdp:discover\"\r\nMX: 1\r\nST: urn:schemas-upnp-org:device:MediaServer:1\r\n\r\n"; message = search.getBytes(); socket = new DatagramSocket(); packet = new DatagramPacket(message, message.length,address, port); socket.send(packet); ArrayList list_result = new ArrayList(); for (int i=0; i<15; i++){ socket.receive(packet); String received = new String(packet.getData(), 0, packet.getLength()); list_result.add(received); } return list_result; } Merci d'avance pour vos réponses. Citer Lien vers le commentaire Partager sur d’autres sites More sharing options...
Kiosquec Posté(e) 18 août 2010 Share Posté(e) 18 août 2010 Bonjour, Avez-vous progressé depuis mars ? Le sujet m'intéresse. Je cherche des infos et suis donc preneur de tout ce qui touche à Android + UPnP. Or, pour l'instant, je ne dispose d'aucune doc. Merci d'avance. Citer Lien vers le commentaire Partager sur d’autres sites More sharing options...
Kiosquec Posté(e) 19 août 2010 Share Posté(e) 19 août 2010 Avez-vous visité cette page ? Il pourrait y avoir des infos intéressantes : http://teleal.org/projects/cling/ Extrait : Cling - Java UPnP library and toolsCling is an effort to create a UPnP-compatible software stack in Java. The project's goals are strict specification compliance, complete, clean and extensive APIs, as well as rich SPIs for easy extension. The current release of Cling is 1.0-beta4 (2010-08-04), see the Changelog for a summary of improvements. Main modules of Cling are: Cling Core An embeddable Java library that implements the UPnP Device Architecture 1.0. Use Cling Core to expose services with a UPnP remoting interface, or to write control point applications that discover UPnP devices and utilize their services. You can also integrate Cling Core as a UPnP/DLNA library in your Android applications (platform level 7/2.1 required). Citer Lien vers le commentaire Partager sur d’autres sites More sharing options...
Recommended Posts
Rejoignez la conversation
Vous pouvez poster maintenant et vous enregistrez plus tard. Si vous avez un compte, connectez-vous maintenant pour poster.