--- android/Side9/src/dk/thoerup/side9/Side9Xml.java 2010/03/23 13:34:52 632 +++ android/Side9/src/dk/thoerup/side9/Side9Xml.java 2010/05/03 14:54:30 703 @@ -16,11 +16,13 @@ import org.w3c.dom.NodeList; import org.xml.sax.SAXException; +import android.util.Log; + public class Side9Xml { - static final int WIDTH = 100; + static final int WIDTH = 400; static final String BASEURL = "http://apps.todic.net/side9/"; public static Document parseXML(String str) throws SAXException, IOException, ParserConfigurationException @@ -37,6 +39,7 @@ URL url = new URL(uri); URLConnection connection = url.openConnection(); + connection.setConnectTimeout(2500); InputStream is = connection.getInputStream(); try { @@ -54,11 +57,11 @@ return baos.toByteArray(); } - public Side9Data loadXml() throws IOException, ParserConfigurationException, SAXException{ + public static Side9Data loadXml() throws IOException, ParserConfigurationException, SAXException{ String dataURL = BASEURL + "xml.php?width=" + WIDTH; byte data[] = getContent( dataURL ); - String xmlData = new String(data, "UTF-8"); + String xmlData = new String(data, "ISO-8859-1"); Document doc = parseXML(xmlData); Node rootNode = doc.getDocumentElement(); // stations @@ -85,6 +88,11 @@ if (name.equals("caption")) side9Data.caption = content; } + + Log.i("Side9Xml", "url: " + side9Data.url); + Log.i("Side9Xml", "size: " + side9Data.width + "/" + side9Data.height); + Log.i("Side9Xml", "capt: " + side9Data.caption); +