This page last changed on Sep 08, 2010 by mgallissot.

Hello All,

I've been testing the latest version of OR (v2), using the BOSS controller and an Android.

Strangly, my Android gets very slow while openning panel. In fact, I just have on panel, with a sensored switch, and one image, depending on the same sensor. Even not doing anything, I've got an amazing 10s delay for any reaction.
My Android version is 1.6.

Is it possible it is due to the polling ? When my panel is not sensored, things are getting much better.

Cheers,

Mathieu

Haven't tried this on hardware yet.. didn't notice anything particularly suspicious when trying this on an emulator.

Posted by admin at Sep 10, 2010 00:55

One thing I did notice though that even on emulator, SDK 2.2 is noticeably faster than 1.5 and is not eating CPU the same way – not sure if that is reflected on actual hardware.

Posted by juha at Sep 10, 2010 01:25

In Android 2.2 Froyo there is a JIT (Just-In-Time) Compiler. Google says 2.2 is up to 5 times faster than 2.1.

Posted by mishoboss at Sep 10, 2010 11:52

Ahh, JIT would definitely explain it.

Posted by juha at Sep 10, 2010 12:10

So there's at least one test run on HTC Tattoo which is Android OS 1.6, and no report on such performance issue (10s delays)

Posted by admin at Sep 10, 2010 17:04

I just tried this with the old Google Dev Phone 1 with Android 1.5 installed – the app is quite responsive (even more so than using the emulator) and had no issues with KNX update polling.

I can try with Android 1.6 also but would be surprised if it gets worse going forwards. So might need some other info about your device – hardware, vendor, what kind of UI design did you use, which protocol, etc?

Posted by admin at Sep 10, 2010 22:03

I can't find the damn log going with it, as last time it ended up crashing. I'm using an X10 Mini from Sony Ericsson, thus, it is possible the problem is on the protocol since I was trying a very beta UPnP bidirectionnal implementation...
Could it be XML errors or a to high frequency for polling (like if new statues was available each time the console is sending a request ?)

Posted by mgallissot at Sep 14, 2010 12:53

I haven't been able to reproduce this yet on 3 different hardware we've tried the app on (Android 1.5, 1.6 and 2.1) – so it would seem that it can be something configuration specific.

At some point we need to increase these types of stress/network testing for the Android device (the SDK seems to have some tools to do it with software) but I'm unlikely to have time to do this at least for another 2 weeks.

If you're able to discover anything more about it (e.g. narrow it down to as minimal as possible panel/controller XML config) then let us know.

Posted by juha at Sep 15, 2010 12:47

Polling is logging to "POLLING" category, little inconvenient that there isn't an OpenRemote prefix for all our logging categories, they get lost in with the rest of the noise, will look to fixing that... but you can filter adb logcat

Posted by juha at Sep 16, 2010 02:04

yeah actually it could, the while loop looks a bit suspect – I didn't analyze the code, just a quick read, head over to PollingHelper.java and check your phone logs... you will notice if it fails to protect itself from an over-eager sensor.

   /**
    * Request current status and start polling.
    */
   public void requestCurrentStatusAndStartPolling() {
      HttpParams params = new BasicHttpParams();
      HttpConnectionParams.setConnectionTimeout(params, 50 * 1000);
      
      //make polling socket timout bigger than Controller (50s)
      HttpConnectionParams.setSoTimeout(params, 55 * 1000);
      
      client = new DefaultHttpClient(params);
      if (isPolling) {
         return;
      }
      
      try {
         URL uri = new URL(serverUrl);
         if ("https".equals(uri.getProtocol())) {
            Scheme sch = new Scheme(uri.getProtocol(), new SelfCertificateSSLSocketFactory(), uri.getPort());
            client.getConnectionManager().getSchemeRegistry().register(sch);
         }
      } catch (MalformedURLException e) {
         Log.e("POLLING", "Create URL fail:" + serverUrl);
      }
      isPolling = true;
      handleRequest(serverUrl + "/rest/status/" + pollingStatusIds);
      while (isPolling) {
         doPolling();
      }
   }

Not saying it's necessarily there but you wanna drill into that.

Posted by juha at Sep 16, 2010 02:11
Document generated by Confluence on Jun 05, 2016 09:29