2010-07-12T16:45:03CEST
[Cling, UPnP, DLNA, Android]
Christian Bauer

It was a struggle but Cling finally works on Android platform level 7. I had to rewrite all of the XML parsing routines because, and this is truly hard to believe, you can't even print an org.w3c.Document graph into a string. There is no transformer on Android 2.1, only in platform 8.

The code that generates XML descriptors (the actual strings) is therefore really ugly and I will revert that as soon as 2.2 is more mainstream.

(Naturally, in 2.2 they added a SchemaFactory but it's broken, so now you can print your DOM but you still can't validate it. It's a good thing then that you can't validate UPnP descriptor XML with W3C schema anyway. Those MSFT geniuses sure were planning ahead.)

So now I'm able to run and test Cling on my Motorola Milestone with Android 2.1. I've updated the demo application (UPnP browser). Get the source code archive here and if you are feeling adventurous, you can install the app on your phone: Browse to http://teleal.org/projects/download/misc/ on your phone and click on the APK archive. After the download finished, click on the downloaded item which should bring up the installer.

Here is a video of the browser and the binary light service running on the phone, which I'm switching from the Workbench application on my desktop:

Alright, what's next then...

7 Comments
2010-07-12T15:20:45CEST
Pete Gould
Nice one, I'll be trying that out. Will still have to write the DIDL parsing if I'm going to put my mediaserver on there I suppose?
2010-07-12T15:28:47CEST
Christian Bauer
Yep, I don't see JAXB working on either 2.1 or even 2.2. There is an issue being tracked here: http://code.google.com/p/android/issues/detail?id=314 I guess most of the value for DIDL in Cling Support is in the schemas. Writing a SAX/DOM parser on Android 2.2 based on those schemas is just a lot of boring work but I don't see any real problem. I wouldn't try that on 2.1 though, the XML support is abysmal.
2011-04-01T07:21:22CEST
Julian Chou
http://www.teleal.org/projects/download/misc/UpnpBrowser-100712.tar.gz <-- this link is lose , how can i get the "UpnpBrowser-100712.tar.gz " file?
2011-04-01T07:23:33CEST
Christian Bauer
If you look at the URL, you can see the path "Projects", then "Download", then "Misc". So you can just click on "Projects", then "Download", then "Misc". Or you can remove the filename from the URL.
2011-04-21T10:14:51CEST
tobiz
I installed your UPnP browser on my Witstech A81E (Android 2.2) and tried it against my Mythbuntu AV system, it failed. It flashes some text on the screen several times, which looks like "MythTV AV Media Renderer" but is difficult to see it the fails with "Discovery failed of 'MythTV AV Media Renderer 0.21.20080304-1':org.teal.cling.binding.xml. DescriptionBindingException:device service description failed: (remote Device) Identity: (RemoteDeviceIdentity) UDN: uuidxxxxxxxxxxxxxxxx, Descriptor: http://xxxxxxxxxxxxxx:6547/getDeviceDesc, Root: true" The "xxxxxxxxxxxxxxx's" are addresses particular to my machines. I tried GUPnP on my Ubuntu 10.04 system against the same Mythbuntu box and it detects it ok. I tried Demo Light and both your UPnP browser detects it and so does GUPnP. This info may be of help to you. I was thinking of using your UPnP library in a Android app I'm working on for controlling MythTV.
2011-04-21T11:47:54CEST
Christian Bauer
Not enough information. Use the Cling Workbench - based on the same core of course - and enable debug logging. Then you should see why discovery failed, most likely your device is not UPnP compatible and a special workaround is needed in Cling. Post all of this including version information to the mailinglist: http://www.teleal.org/projects/mailinglists-cling.html
2011-04-21T11:50:20CEST
Christian Bauer
The Android UPnP browser by the way also has debug logging: Connect your phone through USB to a computer, open 'adb logcat' on the computer and turn on debug logging in the menu of the UPnP browser application on the phone.
Add comment

Creative Commons License