Android getting XML values
Posted
by Nils
on Stack Overflow
See other posts from Stack Overflow
or by Nils
Published on 2010-06-08T21:01:12Z
Indexed on
2010/06/08
21:02 UTC
Read the original article
Hit count: 318
Hello,
I have the following XML code, which I got by a UPnP device and like to get the res value - the RTSP URL. In this case rtsp://10.42.0.103:554/live.sdp
How can I do this? I heard that Android has some built-in support for reading XML. Is that true?
<DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/">
<item id="11" parentID="1" restricted="1">
<dc:title>Network Camera Stream 1</dc:title>
<upnp:class>object.item.videoItem</upnp:class>
<res protocolInfo="rtsp-rtp-udp:*:video/mpeg4-generic:*" resolution="640x480">rtsp://10.42.0.103:554/live.sdp</res>
</item>
<item id="12" parentID="1" restricted="1">
<dc:title>Network Camera Stream 2</dc:title>
<upnp:class>object.item.videoItem</upnp:class>
<res protocolInfo="rtsp-rtp-udp:*:video/mpeg4-generic:*" resolution="176x144">rtsp://10.42.0.103:554/live2.sdp</res>
</item>
</DIDL-Lite>
© Stack Overflow or respective owner