UPnP library for Java [closed]
Asked Answered
S

2

23

Is there a library for implementing service discovery and publishing via UPnP?

(I am trying to find some alternatives to JmDNS that while protocol-wise worked fine for our purposes, was highly unstable as a library, having an unacceptably bad tendency for deadlocking itself.)

Sweetscented answered 12/7, 2010 at 15:19 Comment(2)
You can also try: sourceforge.net/projects/cgupnpjavaSenatorial
I think we fixed all the deadlocks we ever found in JmDNS, but it has far bigger problems than that, e.g. it doesn't work at all on some systems.Witling
S
26

http://4thline.org/projects/cling/

Open Source DLNA/UPnP stack, libraries, and tools for Java and Android developers

Sangraal answered 13/7, 2010 at 5:49 Comment(5)
@Roland : Can u just tell me what exactly u r about to do? i need help on discovering the UPnP device in android.. I want to make app which my android device serves as a medium which can be able to stream media from internet and then make available to UPnP device..Any help on this..Suchlike
Thanks i was looking forward for this only...thanksSuchlike
We need it for integration with a 3rd party POS system that uses UPnP for comunication and negotiation. I can't really help you out in your particular case (fwiw - I find UPnP to be an extremely ugly protocol)Sweetscented
I have made an app with this library (market.android.com/details?id=com.mikebevz.upnp) but the library throws NulPointerException on Android 3.0+ devices. Does anyone see this problem?Iveyivie
The library is no longer maintained so probably not a good choice anymoreGloriagloriana
I
9

You could also try ohNet which includes Java bindings and control point / device stacks under a BSD license.

(Disclaimer: I have contributed to this project)

Inpour answered 13/9, 2011 at 13:51 Comment(7)
interesting... but i can not found how can i get my gateway UDN with it. is it possible to do that?Genisia
@IMAnis_tn use CpDeviceListUpnpDeviceType("upnp.org", "InternetGatewayDevice", 1, listener). 'listener' will be called back each time such a device is found. Use the getUdn() function to retrieve the device udn. You could also use CpDeviceListUpnpServiceType if you want to search for a particular service type.Inpour
@IMAnis_tn it'd also be worth having a look at the Control Point overview on the project wiki for details on how to initialise the libraryInpour
Looks like it is not 100% Java.Antiphonary
@ThorbjørnRavnAndersen that's correct. Its a C++ library with Java wrappers for all public APIs. The C++ code can be built for Android, Windows, Mac & Linux so can be trivially deployed to platforms most likely to host Java. Ports to other OSes would be possible too.Inpour
@simonc, hmm why aren't there some getting-started samplesOtten
@Otten the overview docs cover thisInpour

© 2022 - 2024 — McMap. All rights reserved.