This page last changed on May 08, 2012 by mdarwin.

Not sure where to report bugs. Using the Android market version but this problem appears to be in trunk as well.

In (method parse), it doesn't handle the case where the nodevalue is blank. i.e. if my HTTP server responds with a null string (using a custom sensor), the Android console throws an exception and dies.

I believe checking to make sure there are nodes should fix the problem. See below:

            String newStatus = "";
            if (nodeList.item(i).hasChildNodes()) {
            	newStatus = nodeList.item(i).getFirstChild().getNodeValue();

This does not seem to be an issue on the iOs console.


The latest code in the Android_Console_2_0_0_SNAPSHOT_20111012 looks like this:

         NodeList nodeList = root.getElementsByTagName("status");
         int nodeNums = nodeList.getLength();
         for (int i = 0; i < nodeNums; i++) {
            String lastId = nodeList.item(i).getAttributes().getNamedItem("id").getNodeValue();
            String newStatus = nodeList.item(i).getFirstChild().getNodeValue();
            statusMap.put(lastId, newStatus);
            Log.i("OpenRemote/POLLING", "set " + lastId + " to new status: " + newStatus);
            ORListenerManager.getInstance().notifyOREventListener(ListenerConstant.ListenerPollingStatusIdFormat + lastId, null);

Normally it should be ok to put NULL as a HashMap value. The crash would occur at another position where the NULL is taken out of the HashMap.

Posted by mredeker at May 22, 2012 09:00
Document generated by Confluence on Jun 05, 2016 09:29