diff --git a/.classpath b/.classpath
deleted file mode 100644
index ce3c8b8d5dfa79f7062b0c3c66b455c7916c8071..0000000000000000000000000000000000000000
--- a/.classpath
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry exported="true" kind="lib" path="/Volumes/Macintosh HD/Users/belovictor/.m2/repository/com/google/android/analytics/analytics/2.0/analytics-2.0.jar"/>
-	<classpathentry exported="true" kind="lib" path="/Volumes/Macintosh HD/Users/belovictor/.m2/repository/com/loopj/android-async-http/1.0-openhab/android-async-http-1.0-openhab.jar"/>
-	<classpathentry exported="true" kind="lib" path="/Volumes/Macintosh HD/Users/belovictor/.m2/repository/com/loopj/android-smart-image-view/1.0.0/android-smart-image-view-1.0.0.jar"/>
-	<classpathentry exported="true" kind="lib" path="/Volumes/Macintosh HD/Users/belovictor/.m2/repository/com/crittercism/crittercism-android/3.0.3/crittercism-android-3.0.3.jar"/>
-	<classpathentry exported="true" kind="lib" path="/Volumes/Macintosh HD/Users/belovictor/.m2/repository/javax/jmdns/jmdns/3.4.1/jmdns-3.4.1.jar"/>
-	<classpathentry kind="src" output="bin/classes" path="src">
-		<attributes>
-			<attribute name="optional" value="true"/>
-			<attribute name="maven.pomderived" value="true"/>
-		</attributes>
-	</classpathentry>
-	<classpathentry kind="src" path="gen"/>
-	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
-	<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
-		<attributes>
-			<attribute name="maven.pomderived" value="true"/>
-		</attributes>
-	</classpathentry>
-	<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
-		<attributes>
-			<attribute name="maven.pomderived" value="true"/>
-		</attributes>
-	</classpathentry>
-	<classpathentry kind="output" path="bin/classes"/>
-</classpath>
diff --git a/.gitignore b/.gitignore
index 27d21d0c066f140aede9ddf8915b76ea1175f5f7..866ea150da5ec353614c7e2adea2f4d95dc5a1de 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,11 +1,9 @@
-bin/
-.idea/copyright/
-.idea/libraries/
-.idea/scopes/
-.settings/
-gen/
-gen-external-apklibs/
-target/
-out/
-.DS_Store
-*.apk
++/out
++*.class
++*.iml
++.idea
++gen
++mobile/build
++wear/build
++local.properties
++.gradle
diff --git a/.hgignore b/.hgignore
deleted file mode 100644
index 260c18d5afd5c1fadbbffc35942f9c2a3ce7a63c..0000000000000000000000000000000000000000
--- a/.hgignore
+++ /dev/null
@@ -1,11 +0,0 @@
-target
-
-syntax: glob
-bin/*
-.idea/*
-.settings/*
-gen/*
-gen-external-apklibs/*
-target/*
-out/*
-.DS_Store
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
deleted file mode 100644
index 6f8c67f60742870f2c5806d439c19322965412d4..0000000000000000000000000000000000000000
--- a/.idea/compiler.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="CompilerConfiguration">
-    <option name="DEFAULT_COMPILER" value="Javac" />
-    <resourceExtensions />
-    <wildcardResourcePatterns>
-      <entry name="!?*.java" />
-      <entry name="!?*.form" />
-      <entry name="!?*.class" />
-      <entry name="!?*.groovy" />
-      <entry name="!?*.scala" />
-      <entry name="!?*.flex" />
-      <entry name="!?*.kt" />
-      <entry name="!?*.clj" />
-    </wildcardResourcePatterns>
-    <annotationProcessing>
-      <profile default="true" name="Default" enabled="false">
-        <processorPath useClasspath="true" />
-      </profile>
-      <profile default="false" name="Maven default annotation processors profile" enabled="true">
-        <sourceOutputDir name="target/generated-sources/annotations" />
-        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
-        <outputRelativeToContentRoot value="true" />
-        <processorPath useClasspath="true" />
-        <module name="org.openhab.habdroid" />
-      </profile>
-    </annotationProcessing>
-    <bytecodeTargetLevel>
-      <module name="org.openhab.habdroid" target="1.6" />
-    </bytecodeTargetLevel>
-  </component>
-</project>
-
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
deleted file mode 100644
index 74c0d0a52bff0662a7742899c0a0af5d71341b18..0000000000000000000000000000000000000000
--- a/.idea/encodings.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false">
-    <file url="file://$PROJECT_DIR$" charset="UTF-8" />
-  </component>
-</project>
-
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index 24f63d6e99e97087861e4aff387af9b76fae6188..0000000000000000000000000000000000000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="EntryPointsManager">
-    <entry_points version="2.0" />
-  </component>
-  <component name="FrameworkDetectionExcludesConfiguration">
-    <file type="android" url="file://$PROJECT_DIR$" />
-  </component>
-  <component name="MavenProjectsManager">
-    <option name="originalFiles">
-      <list>
-        <option value="$PROJECT_DIR$/pom.xml" />
-      </list>
-    </option>
-  </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="JDK" project-jdk-type="JavaSDK">
-    <output url="file://$PROJECT_DIR$/classes" />
-  </component>
-</project>
-
diff --git a/.idea/modules.xml b/.idea/modules.xml
deleted file mode 100644
index 131829aa44989c64bd27c78573d9facf9f22074f..0000000000000000000000000000000000000000
--- a/.idea/modules.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="ProjectModuleManager">
-    <modules>
-      <module fileurl="file://$PROJECT_DIR$/org.openhab.habdroid.iml" filepath="$PROJECT_DIR$/org.openhab.habdroid.iml" />
-    </modules>
-  </component>
-</project>
-
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 275077f82558f02f5c5151cc5c676b9f5f60dce3..0000000000000000000000000000000000000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="VcsDirectoryMappings">
-    <mapping directory="" vcs="Git" />
-  </component>
-</project>
-
diff --git a/.project b/.project
deleted file mode 100644
index d08c7cb74a7d6ebefc5c88d0079e66d7c123cc16..0000000000000000000000000000000000000000
--- a/.project
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.openhab.habdroid</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>com.android.ide.eclipse.adt.ApkBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.m2e.core.maven2Builder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
-		<nature>org.eclipse.m2e.core.maven2Nature</nature>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 7a531392842ef1351f9f7eb9bb286bd3d936bc5c..0000000000000000000000000000000000000000
--- a/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-eclipse.preferences.version=1
-encoding/<project>=UTF-8
-encoding/src=UTF-8
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 69c31cd493ce042398e9fe93d22b72beb46afa88..0000000000000000000000000000000000000000
--- a/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,8 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs
deleted file mode 100644
index f897a7f1cb2389f85fe6381425d29f0a9866fb65..0000000000000000000000000000000000000000
--- a/.settings/org.eclipse.m2e.core.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-activeProfiles=
-eclipse.preferences.version=1
-resolveWorkspaceProjects=true
-version=1
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
deleted file mode 100644
index f44c49a36b1297f2a8afeba4d4b0d18c85116e43..0000000000000000000000000000000000000000
--- a/AndroidManifest.xml
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="org.openhab.habdroid"
-    android:versionCode="11"
-    android:versionName="1.5.1.1" >
-    <uses-sdk
-        android:minSdkVersion="15"
-        android:targetSdkVersion="15"
-    />
-    <uses-permission android:name="android.permission.INTERNET" />
-    <uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
-    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
-    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
-    <uses-permission android:name="android.permission.READ_LOGS" />
-    <uses-permission android:name="android.permission.GET_TASKS" />
-    <uses-permission android:name="android.permission.NFC" />
-    <!-- Keeps the processor from sleeping when a message is received. -->
-    <uses-permission android:name="android.permission.WAKE_LOCK" />
-    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
-    <permission android:name="com.example.gcm.permission.C2D_MESSAGE"
-        android:protectionLevel="signature" />
-    <uses-permission android:name="com.example.gcm.permission.C2D_MESSAGE" />
-    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
-    <uses-feature
-        android:name="android.hardware.nfc"
-        android:required="false" />
-    <application
-        android:allowBackup="true"
-        android:icon="@drawable/openhabicon"
-        android:label="@string/app_name" >
-        <meta-data android:name="com.google.android.gms.version"
-            android:value="4030500" />
-        <activity
-            android:name="org.openhab.habdroid.ui.OpenHABPreferencesActivity"
-            android:label="@string/app_preferences_name" >
-            <intent-filter>
-            </intent-filter>
-        </activity>
-        <activity
-            android:name="org.openhab.habdroid.ui.OpenHABMainActivity"
-            android:label="@string/app_name"
-            android:launchMode="singleTop">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-            <intent-filter>
-                <action android:name="android.nfc.action.NDEF_DISCOVERED" />
-                <category android:name="android.intent.category.DEFAULT" />
-                <data android:scheme="openhab" />
-            </intent-filter>
-        </activity>
-        <activity
-            android:name="org.openhab.habdroid.ui.OpenHABWriteTagActivity"
-            android:label="@string/title_activity_openhabwritetag" >
-        </activity>
-        <activity
-                android:name="org.openhab.habdroid.ui.OpenHABInfoActivity"
-                android:label="@string/title_activity_openhabinfo" >
-        </activity>
-        <activity android:name="com.crittercism.NotificationActivity" />
-        <activity android:name="de.duenndns.ssl.MemorizingActivity" />
-        <receiver
-            android:name="org.openhab.habdroid.core.GcmBroadcastReceiver"
-            android:permission="com.google.android.c2dm.permission.SEND">
-            <intent-filter>
-                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
-                <category android:name="org.openhab.habdroid" />
-            </intent-filter>
-        </receiver>
-        <receiver android:name=".core.NotificationDeletedBroadcastReceiver">
-            <intent-filter>
-                <action android:name="org.openhab.habdroid.notification.deleted" />
-                <category android:name="org.openhab.habdroid" />
-            </intent-filter>
-        </receiver>
-        <service android:name="org.openhab.habdroid.core.GcmIntentService" />
-    </application>
-</manifest>
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
index 50328437753245c6bebf0a183ce0f96ec127f875..f735bee0e8d11a51506989bb287a6b51957d8d4f 100644
--- a/LICENSE
+++ b/LICENSE
@@ -200,4 +200,4 @@ This Agreement is governed by the laws of the State of New York and the
 intellectual property laws of the United States of America. No party to this
 Agreement will bring a legal action under this Agreement more than one year
 after the cause of action arose. Each party waives its rights to a jury trial in
-any resulting litigation.
\ No newline at end of file
+any resulting litigation.
diff --git a/build.xml b/build.xml
deleted file mode 100644
index 46841b6c31065baad385cefc82f8fa1353497213..0000000000000000000000000000000000000000
--- a/build.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="HABDroid" default="help">
-
-    <!-- The local.properties file is created and updated by the 'android' tool.
-         It contains the path to the SDK. It should *NOT* be checked into
-         Version Control Systems. -->
-    <property file="local.properties" />
-
-    <!-- The ant.properties file can be created by you. It is only edited by the
-         'android' tool to add properties to it.
-         This is the place to change some Ant specific build properties.
-         Here are some properties you may want to change/update:
-
-         source.dir
-             The name of the source directory. Default is 'src'.
-         out.dir
-             The name of the output directory. Default is 'bin'.
-
-         For other overridable properties, look at the beginning of the rules
-         files in the SDK, at tools/ant/build.xml
-
-         Properties related to the SDK location or the project target should
-         be updated using the 'android' tool with the 'update' action.
-
-         This file is an integral part of the build system for your
-         application and should be checked into Version Control Systems.
-
-         -->
-    <property file="ant.properties" />
-
-    <!-- if sdk.dir was not set from one of the property file, then
-         get it from the ANDROID_HOME env var.
-         This must be done before we load project.properties since
-         the proguard config can use sdk.dir -->
-    <property environment="env" />
-    <condition property="sdk.dir" value="${env.ANDROID_HOME}">
-        <isset property="env.ANDROID_HOME" />
-    </condition>
-
-    <!-- The project.properties file is created and updated by the 'android'
-         tool, as well as ADT.
-
-         This contains project specific properties such as project target, and library
-         dependencies. Lower level build properties are stored in ant.properties
-         (or in .classpath for Eclipse projects).
-
-         This file is an integral part of the build system for your
-         application and should be checked into Version Control Systems. -->
-    <loadproperties srcFile="project.properties" />
-
-    <!-- quick check on sdk.dir -->
-    <fail
-            message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
-            unless="sdk.dir"
-    />
-
-    <!--
-        Import per project custom build rules if present at the root of the project.
-        This is the place to put custom intermediary targets such as:
-            -pre-build
-            -pre-compile
-            -post-compile (This is typically used for code obfuscation.
-                           Compiled code location: ${out.classes.absolute.dir}
-                           If this is not done in place, override ${out.dex.input.absolute.dir})
-            -post-package
-            -post-build
-            -pre-clean
-    -->
-    <import file="custom_rules.xml" optional="true" />
-
-    <!-- Import the actual build file.
-
-         To customize existing targets, there are two options:
-         - Customize only one target:
-             - copy/paste the target into this file, *before* the
-               <import> task.
-             - customize it to your needs.
-         - Customize the whole content of build.xml
-             - copy/paste the content of the rules files (minus the top node)
-               into this file, replacing the <import> task.
-             - customize to your needs.
-
-         ***********************
-         ****** IMPORTANT ******
-         ***********************
-         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
-         in order to avoid having your file be overridden by tools such as "android update project"
-    -->
-    <!-- version-tag: 1 -->
-    <import file="${sdk.dir}/tools/ant/build.xml" />
-
-</project>
diff --git a/lib/android-4.0.1.2.jar b/lib/android-4.0.1.2.jar
deleted file mode 100644
index c46e71baa70ffcec297f91efcf52e5b052fec759..0000000000000000000000000000000000000000
Binary files a/lib/android-4.0.1.2.jar and /dev/null differ
diff --git a/lib/commons-codec-1.3.jar b/lib/commons-codec-1.3.jar
deleted file mode 100644
index 957b6752af9a60c1bb2a4f65db0e90e5ce00f521..0000000000000000000000000000000000000000
Binary files a/lib/commons-codec-1.3.jar and /dev/null differ
diff --git a/lib/commons-logging-1.1.1.jar b/lib/commons-logging-1.1.1.jar
deleted file mode 100644
index 1deef144cb17ed2c11c6cdcdcb2d9530fa8d0b47..0000000000000000000000000000000000000000
Binary files a/lib/commons-logging-1.1.1.jar and /dev/null differ
diff --git a/lib/httpclient-4.0.1.jar b/lib/httpclient-4.0.1.jar
deleted file mode 100644
index ad32285abc5bb3ea94e363cf19e9bc8197ef9a93..0000000000000000000000000000000000000000
Binary files a/lib/httpclient-4.0.1.jar and /dev/null differ
diff --git a/lib/httpcore-4.0.1.jar b/lib/httpcore-4.0.1.jar
deleted file mode 100644
index 4aef35e2ffa17c332ad53caa0b360c56ae969d05..0000000000000000000000000000000000000000
Binary files a/lib/httpcore-4.0.1.jar and /dev/null differ
diff --git a/lib/json-20080701.jar b/lib/json-20080701.jar
deleted file mode 100644
index c9a093edb8887d18a1c238d9a1d790a6930e72cf..0000000000000000000000000000000000000000
Binary files a/lib/json-20080701.jar and /dev/null differ
diff --git a/lib/opengl-api-gl1.1-android-2.1_r1.jar b/lib/opengl-api-gl1.1-android-2.1_r1.jar
deleted file mode 100644
index f635aeae801306113c0d35a77a66b41bc47d2561..0000000000000000000000000000000000000000
Binary files a/lib/opengl-api-gl1.1-android-2.1_r1.jar and /dev/null differ
diff --git a/lib/support-v4-r7.jar b/lib/support-v4-r7.jar
deleted file mode 100644
index 382255eb367238a6e5dd390825b8c4dd899ee548..0000000000000000000000000000000000000000
Binary files a/lib/support-v4-r7.jar and /dev/null differ
diff --git a/lib/xmlParserAPIs-2.6.2.jar b/lib/xmlParserAPIs-2.6.2.jar
deleted file mode 100644
index 2dd83771445c00b3f11ece7aa2cb7dc947a8e2c1..0000000000000000000000000000000000000000
Binary files a/lib/xmlParserAPIs-2.6.2.jar and /dev/null differ
diff --git a/lib/xpp3-1.1.4c.jar b/lib/xpp3-1.1.4c.jar
deleted file mode 100644
index 451ac82af4a30c845cac77137cd9f64f5b5d60a3..0000000000000000000000000000000000000000
Binary files a/lib/xpp3-1.1.4c.jar and /dev/null differ
diff --git a/lint.xml b/lint.xml
deleted file mode 100644
index ee0eead5bb7d90f91387b589a7940b0fcd1f16f5..0000000000000000000000000000000000000000
--- a/lint.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<lint>
-</lint>
\ No newline at end of file
diff --git a/local.properties b/local.properties
deleted file mode 100644
index 4612322ab2ea4416128239e9c9af69093ac8324d..0000000000000000000000000000000000000000
--- a/local.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must *NOT* be checked into Version Control Systems,
-# as it contains information specific to your local configuration.
-
-# location of the SDK. This is only used by Ant
-# For customization when using a Version Control System, please read the
-# header note.
-sdk.dir=/Volumes/Macintosh HD/Users/belovictor/apps/android-sdk-macosx
diff --git a/org.openhab.habdroid.iml b/org.openhab.habdroid.iml
deleted file mode 100644
index 33f82753aef5c6f70cfe86ce2ca5ea3d7f403d24..0000000000000000000000000000000000000000
--- a/org.openhab.habdroid.iml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
-  <component name="FacetManager">
-    <facet type="android" name="Android">
-      <configuration>
-        <option name="GEN_FOLDER_RELATIVE_PATH_APT" value="/target/generated-sources/r" />
-        <option name="GEN_FOLDER_RELATIVE_PATH_AIDL" value="/target/generated-sources/aidl" />
-        <option name="CUSTOM_APK_RESOURCE_FOLDER" value="/target/generated-sources/combined-resources/res" />
-        <option name="APK_PATH" value="/target/org.openhab.habdroid.apk" />
-        <option name="RUN_PROCESS_RESOURCES_MAVEN_TASK" value="false" />
-        <option name="COMPILE_CUSTOM_GENERATED_SOURCES" value="false" />
-        <includeAssetsFromLibraries>true</includeAssetsFromLibraries>
-        <resOverlayFolders>
-          <path>/res-overlay</path>
-        </resOverlayFolders>
-      </configuration>
-    </facet>
-  </component>
-  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
-    <output url="file://$MODULE_DIR$/target/classes" />
-    <output-test url="file://$MODULE_DIR$/target/test-classes" />
-    <content url="file://$MODULE_DIR$">
-      <sourceFolder url="file://$MODULE_DIR$/target/generated-sources/r" isTestSource="false" generated="true" />
-      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
-      <excludeFolder url="file://$MODULE_DIR$/target/classes" />
-      <excludeFolder url="file://$MODULE_DIR$/target/generated-sources/combined-assets" />
-      <excludeFolder url="file://$MODULE_DIR$/target/generated-sources/combined-resources" />
-      <excludeFolder url="file://$MODULE_DIR$/target/generated-sources/extracted-dependencies" />
-    </content>
-    <orderEntry type="jdk" jdkName="Maven Android API 15 Platform" jdkType="Android SDK" />
-    <orderEntry type="sourceFolder" forTests="false" />
-    <orderEntry type="library" scope="PROVIDED" name="Maven: com.google.android:android:4.0.1.2" level="project" />
-    <orderEntry type="library" scope="PROVIDED" name="Maven: commons-logging:commons-logging:1.1.1" level="project" />
-    <orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.httpcomponents:httpclient:4.0.1" level="project" />
-    <orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.httpcomponents:httpcore:4.0.1" level="project" />
-    <orderEntry type="library" scope="PROVIDED" name="Maven: commons-codec:commons-codec:1.3" level="project" />
-    <orderEntry type="library" scope="PROVIDED" name="Maven: org.khronos:opengl-api:gl1.1-android-2.1_r1" level="project" />
-    <orderEntry type="library" scope="PROVIDED" name="Maven: xerces:xmlParserAPIs:2.6.2" level="project" />
-    <orderEntry type="library" scope="PROVIDED" name="Maven: xpp3:xpp3:1.1.4c" level="project" />
-    <orderEntry type="library" scope="PROVIDED" name="Maven: org.json:json:20080701" level="project" />
-    <orderEntry type="library" name="Maven: com.crittercism:crittercism-android:3.0.3" level="project" />
-    <orderEntry type="library" name="Maven: com.loopj:android-async-http:1.4.2-openhab" level="project" />
-    <orderEntry type="library" name="Maven: com.loopj:android-smart-image-view:1.0.0" level="project" />
-    <orderEntry type="library" name="Maven: javax.jmdns:jmdns:3.4.1" level="project" />
-    <orderEntry type="library" name="Maven: com.google.android.analytics:analytics:2.0" level="project" />
-    <orderEntry type="library" name="Maven: com.google.android:support-v4:r19" level="project" />
-    <orderEntry type="library" name="Maven: com.google.android.gms:google-play-services:4" level="project" />
-  </component>
-</module>
-
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
index a933813b2398be30f1543c0f73e432e07fc417cc..0000000000000000000000000000000000000000
--- a/pom.xml
+++ /dev/null
@@ -1,246 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-	<modelVersion>4.0.0</modelVersion>
-	<groupId>org.openhab</groupId>
-	<artifactId>org.openhab.habdroid</artifactId>
-
-	<version>1.5.0-SNAPSHOT</version>
-	<packaging>apk</packaging>
-	<name>HABDroid</name>
-
-	<organization>
-		<name>openHAB.org</name>
-		<url>http://www.openhab.org</url>
-	</organization>
-
-	<properties>
-		<platform.version>4.0.1.2</platform.version>
-		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-	</properties>
-
-	<licenses>
-		<license>
-			<name>GNU General Public License</name>
-			<url>http://www.gnu.org/licenses/gpl.html</url>
-			<comments>
-        Additional permission under GNU GPL version 3 section 7
-        
-        If you modify this Program, or any covered work, by linking or 
-        combining it with Eclipse (or a modified version of that library),
-        containing parts covered by the terms of the Eclipse Public License
-        (EPL), the licensors of this Program grant you additional permission
-        to convey the resulting work.
-      </comments>
-		</license>
-	</licenses>
-
-	<scm>
-		<connection>scm:hg:https://code.google.com/p/openhab.android/</connection>
-		<url>http://code.google.com/p/openhab.android/source/browse/</url>
-	</scm>
-
-	<mailingLists>
-		<mailingList>
-			<name>openhab Mailing List</name>
-			<post>openhab@googlegroups.com</post>
-			<subscribe>http://groups.google.com/group/openhab</subscribe>
-			<unsubscribe>http://groups.google.com/group/openhab</unsubscribe>
-			<archive>http://groups.google.com/group/openhab</archive>
-		</mailingList>
-	</mailingLists>
-
-	<issueManagement>
-		<url>http://code.google.com/p/openhab/issues/list</url>
-		<system>Google Code</system>
-	</issueManagement>
-
-	<description>This is native Android UI for the open Home Automation Bus (openHAB)</description>
-
-	<build>
-		<sourceDirectory>src</sourceDirectory>
-		<plugins>
-			<plugin>
-				<groupId>com.jayway.maven.plugins.android.generation2</groupId>
-				<artifactId>android-maven-plugin</artifactId>
-				<version>3.8.0</version>
-				<configuration>
-					<androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile>
-					<assetsDirectory>${project.basedir}/assets</assetsDirectory>
-					<resourceDirectory>${project.basedir}/res</resourceDirectory>
-					<sdk>
-						<platform>15</platform>
-					</sdk>
-					<undeployBeforeDeploy>true</undeployBeforeDeploy>
-					<zipalign>
-						<skip>false</skip>
-						<verbose>true</verbose>
-						<inputApk>${project.build.directory}/${project.artifactId}-${project.version}.apk</inputApk>
-						<outputApk>${project.build.directory}/${project.name}-${project.version}.apk</outputApk>
-					</zipalign>
-				</configuration>
-				<extensions>true</extensions>
-				<executions>
-					<execution>
-						<id>alignApk</id>
-						<phase>package</phase>
-						<goals>
-							<goal>zipalign</goal>
-						</goals>
-					</execution>
-				</executions>
-			</plugin>
-			<plugin>
-				<artifactId>maven-compiler-plugin</artifactId>
-				<version>3.0</version>
-				<configuration>
-					<source>1.6</source>
-					<target>1.6</target>
-				</configuration>
-			</plugin>
-<!--			<plugin>
-				<groupId>com.mycila.maven-license-plugin</groupId>
-				<artifactId>maven-license-plugin</artifactId>
-				<version>1.9.0</version>
-				<configuration>
-					<basedir>${basedir}</basedir>
-					<header>src/etc/header.txt</header>
-					<quiet>false</quiet>
-					<failIfMissing>true</failIfMissing>
-					<strictCheck>true</strictCheck>
-					<aggregate>true</aggregate>
-					<includes>
-						<include>**/*.java</include>
-						<include>**/feature.xml</include>
-					</includes>
-					<excludes>
-						<exclude>target/**</exclude>
-						<exclude>gen/**</exclude>
-						<exclude>src/at/**</exclude>
-						<exclude>**/pom.xml</exclude>
-					</excludes>
-					<useDefaultExcludes>true</useDefaultExcludes>
-					<properties>
-						<year>2012</year>
-					</properties>
-					<encoding>UTF-8</encoding>
-				</configuration>
-				<executions>
-					<execution>
-						<goals>
-							<goal>check</goal>
-						</goals>
-					</execution>
-				</executions>
-			</plugin> -->
-		</plugins>
-		<extensions>
-			<extension>
-				<groupId>org.apache.maven.wagon</groupId>
-				<artifactId>wagon-webdav</artifactId>
-				<version>1.0-beta-2</version>
-			</extension>
-		</extensions>
-		<pluginManagement>
-			<plugins>
-				<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
-				<plugin>
-					<groupId>org.eclipse.m2e</groupId>
-					<artifactId>lifecycle-mapping</artifactId>
-					<version>1.0.0</version>
-					<configuration>
-						<lifecycleMappingMetadata>
-							<pluginExecutions>
-								<pluginExecution>
-									<pluginExecutionFilter>
-										<groupId>
-											com.jayway.maven.plugins.android.generation2
-										</groupId>
-										<artifactId>
-											android-maven-plugin
-										</artifactId>
-										<versionRange>
-											[3.5.0,)
-										</versionRange>
-										<goals>
-											<goal>proguard</goal>
-											<goal>
-												generate-sources
-											</goal>
-										</goals>
-									</pluginExecutionFilter>
-									<action>
-										<ignore></ignore>
-									</action>
-								</pluginExecution>
-							</pluginExecutions>
-						</lifecycleMappingMetadata>
-					</configuration>
-				</plugin>
-			</plugins>
-		</pluginManagement>
-	</build>
-		
-	<dependencies>
-		<dependency>
-			<groupId>com.google.android</groupId>
-			<artifactId>android</artifactId>
-			<version>${platform.version}</version>
-			<scope>provided</scope>
-		</dependency>
-		<dependency>
-			<groupId>com.crittercism</groupId>
-			<artifactId>crittercism-android</artifactId>
-			<version>3.0.3</version>
-		</dependency>
-		<dependency>
-			<groupId>com.loopj</groupId>
-			<artifactId>android-async-http</artifactId>
-			<version>1.4.2-openhab</version>
-		</dependency>
-		<dependency>
-			<groupId>com.loopj</groupId>
-			<artifactId>android-smart-image-view</artifactId>
-			<version>1.0.0</version>
-		</dependency>
-		<dependency>
-			<groupId>javax.jmdns</groupId>
-			<artifactId>jmdns</artifactId>
-			<version>3.4.1</version>
-		</dependency>
-		<dependency>
-			<groupId>com.google.android.analytics</groupId>
-			<artifactId>analytics</artifactId>
-			<version>2.0</version>
-		</dependency>
-        <dependency>
-            <groupId>com.google.android</groupId>
-            <artifactId>support-v4</artifactId>
-            <version>r19</version>
-        </dependency>
-        <dependency>
-            <groupId>com.google.android.gms</groupId>
-            <artifactId>google-play-services</artifactId>
-            <type>jar</type>
-            <version>4</version>
-        </dependency>
-<!--        <dependency>
-            <groupId>de.duenndns.ssl</groupId>
-            <artifactId>memorizingtrustmanager</artifactId>
-            <version>1.1</version>
-        </dependency> -->
-    </dependencies>
-	<repositories>
-		<repository>
-			<id>openhab.repository</id>
-			<name>openHAB Cloudbees Repository</name>
-			<url>http://repository-openhab.forge.cloudbees.com/release/</url>
-		</repository>
-        <repository>
-            <id>nexus.repository</id>
-            <name>openHAB Cloudbees Repository</name>
-            <url>http://www.ldsmobile.org/nexus/content/repositories/public/</url>
-        </repository>
-    </repositories>
-</project>
diff --git a/proguard-project.txt b/proguard-project.txt
deleted file mode 100644
index f2fe1559a217865a5454add526dcc446f892385b..0000000000000000000000000000000000000000
--- a/proguard-project.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-#   http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-#   public *;
-#}
diff --git a/proguard.cfg b/proguard.cfg
deleted file mode 100644
index b1cdf17b5bb40b4839cfc80f7e91bbcf7b94f798..0000000000000000000000000000000000000000
--- a/proguard.cfg
+++ /dev/null
@@ -1,40 +0,0 @@
--optimizationpasses 5
--dontusemixedcaseclassnames
--dontskipnonpubliclibraryclasses
--dontpreverify
--verbose
--optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-
--keep public class * extends android.app.Activity
--keep public class * extends android.app.Application
--keep public class * extends android.app.Service
--keep public class * extends android.content.BroadcastReceiver
--keep public class * extends android.content.ContentProvider
--keep public class * extends android.app.backup.BackupAgentHelper
--keep public class * extends android.preference.Preference
--keep public class com.android.vending.licensing.ILicensingService
-
--keepclasseswithmembernames class * {
-    native <methods>;
-}
-
--keepclasseswithmembers class * {
-    public <init>(android.content.Context, android.util.AttributeSet);
-}
-
--keepclasseswithmembers class * {
-    public <init>(android.content.Context, android.util.AttributeSet, int);
-}
-
--keepclassmembers class * extends android.app.Activity {
-   public void *(android.view.View);
-}
-
--keepclassmembers enum * {
-    public static **[] values();
-    public static ** valueOf(java.lang.String);
-}
-
--keep class * implements android.os.Parcelable {
-  public static final android.os.Parcelable$Creator *;
-}
diff --git a/project.properties b/project.properties
deleted file mode 100644
index ae36aa50be72dbe18fc90f0d671b37547bd69202..0000000000000000000000000000000000000000
--- a/project.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system use,
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-
-# Project target.
-target=android-19
-
diff --git a/res/anim/slide_in_left.xml b/res/anim/slide_in_left.xml
deleted file mode 100644
index 3e1c8e8ea0248783c772834a69041d691a87f775..0000000000000000000000000000000000000000
--- a/res/anim/slide_in_left.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<set xmlns:android="http://schemas.android.com/apk/res/android">
-	<translate android:fromXDelta="-100%p" android:toXDelta="0" android:duration="400" />
-</set>
diff --git a/res/anim/slide_in_right.xml b/res/anim/slide_in_right.xml
deleted file mode 100644
index 4681bc7236b72236dedc587e15a674ffaa49f0f6..0000000000000000000000000000000000000000
--- a/res/anim/slide_in_right.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<set xmlns:android="http://schemas.android.com/apk/res/android">
-	<translate android:fromXDelta="100%p" android:toXDelta="0" android:duration="400" />
-</set>
diff --git a/res/anim/slide_out_left.xml b/res/anim/slide_out_left.xml
deleted file mode 100644
index a847936bdbf7bfa7a65b9acd35dfaed8e672d7e2..0000000000000000000000000000000000000000
--- a/res/anim/slide_out_left.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<set xmlns:android="http://schemas.android.com/apk/res/android">
-    <translate android:fromXDelta="0" android:toXDelta="-100%p" android:duration="400" />
-</set>
diff --git a/res/anim/slide_out_right.xml b/res/anim/slide_out_right.xml
deleted file mode 100644
index 5c1badad62f44b514e7f43c44530d7c511df2eec..0000000000000000000000000000000000000000
--- a/res/anim/slide_out_right.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<set xmlns:android="http://schemas.android.com/apk/res/android">
-    <translate android:fromXDelta="0" android:toXDelta="100%p" android:duration="400" />
-</set>
diff --git a/res/drawable-hdpi/ab_dark_background.png b/res/drawable-hdpi/ab_dark_background.png
deleted file mode 100644
index 75e29dfc3708213dde830fea6e18aecf01a87420..0000000000000000000000000000000000000000
Binary files a/res/drawable-hdpi/ab_dark_background.png and /dev/null differ
diff --git a/res/drawable-hdpi/ab_solid.png b/res/drawable-hdpi/ab_solid.png
deleted file mode 100644
index fb4071713f32fac6016dd89adc01a9f2513ef3b5..0000000000000000000000000000000000000000
Binary files a/res/drawable-hdpi/ab_solid.png and /dev/null differ
diff --git a/res/drawable-hdpi/blank_icon.png b/res/drawable-hdpi/blank_icon.png
deleted file mode 100644
index ab730090692b445e5d6e90105c6e688e9f1e0b7c..0000000000000000000000000000000000000000
Binary files a/res/drawable-hdpi/blank_icon.png and /dev/null differ
diff --git a/res/drawable-hdpi/chart_image.png b/res/drawable-hdpi/chart_image.png
deleted file mode 100644
index 2a76439634ae48218b771b90c9145337cd4448fa..0000000000000000000000000000000000000000
Binary files a/res/drawable-hdpi/chart_image.png and /dev/null differ
diff --git a/res/drawable-hdpi/colorwheel.png b/res/drawable-hdpi/colorwheel.png
deleted file mode 100644
index 2a20611aad0266dac59e4d67e23137efc6f02c01..0000000000000000000000000000000000000000
Binary files a/res/drawable-hdpi/colorwheel.png and /dev/null differ
diff --git a/res/drawable-hdpi/ic_action_add.png b/res/drawable-hdpi/ic_action_add.png
deleted file mode 100644
index 833ccc64b3a44888ceddad3710dadc9cdc7ccdae..0000000000000000000000000000000000000000
Binary files a/res/drawable-hdpi/ic_action_add.png and /dev/null differ
diff --git a/res/drawable-hdpi/ic_action_arrow_bottom.png b/res/drawable-hdpi/ic_action_arrow_bottom.png
deleted file mode 100644
index 09f103b4258e9849ddf38897c05a372844d878b8..0000000000000000000000000000000000000000
Binary files a/res/drawable-hdpi/ic_action_arrow_bottom.png and /dev/null differ
diff --git a/res/drawable-hdpi/ic_action_arrow_top.png b/res/drawable-hdpi/ic_action_arrow_top.png
deleted file mode 100644
index 5b2a10dba45ac9c1e1205802cb601081c55a87c7..0000000000000000000000000000000000000000
Binary files a/res/drawable-hdpi/ic_action_arrow_top.png and /dev/null differ
diff --git a/res/drawable-hdpi/ic_action_cancel.png b/res/drawable-hdpi/ic_action_cancel.png
deleted file mode 100644
index 6ba255a305ddc1a5b55474d3c8faed064f87739e..0000000000000000000000000000000000000000
Binary files a/res/drawable-hdpi/ic_action_cancel.png and /dev/null differ
diff --git a/res/drawable-hdpi/ic_action_down.png b/res/drawable-hdpi/ic_action_down.png
deleted file mode 100644
index 502a6d7ef96c7c3d1a56951b2b04f66be06382e6..0000000000000000000000000000000000000000
Binary files a/res/drawable-hdpi/ic_action_down.png and /dev/null differ
diff --git a/res/drawable-hdpi/ic_action_up.png b/res/drawable-hdpi/ic_action_up.png
deleted file mode 100644
index a74eeaa7019ee19f272be6858c41c38639a1cd0d..0000000000000000000000000000000000000000
Binary files a/res/drawable-hdpi/ic_action_up.png and /dev/null differ
diff --git a/res/drawable-hdpi/ic_launcher.png b/res/drawable-hdpi/ic_launcher.png
deleted file mode 100644
index 8074c4c571b8cd19e27f4ee5545df367420686d7..0000000000000000000000000000000000000000
Binary files a/res/drawable-hdpi/ic_launcher.png and /dev/null differ
diff --git a/res/drawable-hdpi/ic_navigation_drawer.png b/res/drawable-hdpi/ic_navigation_drawer.png
deleted file mode 100755
index 5c9db3584a4c79a075a2d1d18451913f66bf2852..0000000000000000000000000000000000000000
Binary files a/res/drawable-hdpi/ic_navigation_drawer.png and /dev/null differ
diff --git a/res/drawable-hdpi/menu_mic_dark.png b/res/drawable-hdpi/menu_mic_dark.png
deleted file mode 100644
index a1932904fa619458bbe2aca93bdd7a3390c877ff..0000000000000000000000000000000000000000
Binary files a/res/drawable-hdpi/menu_mic_dark.png and /dev/null differ
diff --git a/res/drawable-hdpi/menu_mic_light.png b/res/drawable-hdpi/menu_mic_light.png
deleted file mode 100644
index 305a6fe7e057024eb5b2b4f520b2b39146ebd1c2..0000000000000000000000000000000000000000
Binary files a/res/drawable-hdpi/menu_mic_light.png and /dev/null differ
diff --git a/res/drawable-hdpi/nfc_splash.png b/res/drawable-hdpi/nfc_splash.png
deleted file mode 100644
index 18768af4ec7cd42147d917ddb8388c7d9ce7f1f9..0000000000000000000000000000000000000000
Binary files a/res/drawable-hdpi/nfc_splash.png and /dev/null differ
diff --git a/res/drawable-hdpi/openhab.png b/res/drawable-hdpi/openhab.png
deleted file mode 100644
index 24cfa6f4aa74d419845597a129a6c32af0439be0..0000000000000000000000000000000000000000
Binary files a/res/drawable-hdpi/openhab.png and /dev/null differ
diff --git a/res/drawable-hdpi/openhabicon.png b/res/drawable-hdpi/openhabicon.png
deleted file mode 100644
index 5c3e1d62a07b0d936aacfd9f244f3f355af0ef6e..0000000000000000000000000000000000000000
Binary files a/res/drawable-hdpi/openhabicon.png and /dev/null differ
diff --git a/res/drawable-hdpi/openhabicon_light.png b/res/drawable-hdpi/openhabicon_light.png
deleted file mode 100644
index f8ee4c2e824812df87f8b44c92144a65931582ad..0000000000000000000000000000000000000000
Binary files a/res/drawable-hdpi/openhabicon_light.png and /dev/null differ
diff --git a/res/drawable-hdpi/openhabiconsmall.png b/res/drawable-hdpi/openhabiconsmall.png
deleted file mode 100644
index 08837cfe42c923e7495960d87639195f78da7b30..0000000000000000000000000000000000000000
Binary files a/res/drawable-hdpi/openhabiconsmall.png and /dev/null differ
diff --git a/res/drawable-ldpi/ic_launcher.png b/res/drawable-ldpi/ic_launcher.png
deleted file mode 100644
index 1095584ec21f71cd0afc9e0993aa2209671b590c..0000000000000000000000000000000000000000
Binary files a/res/drawable-ldpi/ic_launcher.png and /dev/null differ
diff --git a/res/drawable-mdpi/ic_launcher.png b/res/drawable-mdpi/ic_launcher.png
deleted file mode 100644
index a07c69fa5a0f4da5d5efe96eea12a543154dbab6..0000000000000000000000000000000000000000
Binary files a/res/drawable-mdpi/ic_launcher.png and /dev/null differ
diff --git a/res/drawable-mdpi/ic_navigation_drawer.png b/res/drawable-mdpi/ic_navigation_drawer.png
deleted file mode 100755
index b7d28b5c7181477ac11696a49e58f39662383361..0000000000000000000000000000000000000000
Binary files a/res/drawable-mdpi/ic_navigation_drawer.png and /dev/null differ
diff --git a/res/drawable/list_arrow_activated.9.png b/res/drawable/list_arrow_activated.9.png
deleted file mode 100644
index 2ed40b02783b89261bfddc7d4fbe14caad50dcee..0000000000000000000000000000000000000000
Binary files a/res/drawable/list_arrow_activated.9.png and /dev/null differ
diff --git a/res/drawable/list_arrow_pressed.9.png b/res/drawable/list_arrow_pressed.9.png
deleted file mode 100644
index 454582dfcf3d8de980d17924cd658492088197bb..0000000000000000000000000000000000000000
Binary files a/res/drawable/list_arrow_pressed.9.png and /dev/null differ
diff --git a/res/drawable/list_inactive_right_border.9.png b/res/drawable/list_inactive_right_border.9.png
deleted file mode 100644
index 6a4eb6f0a4c8421350e5c225c5b3091092c4cf6d..0000000000000000000000000000000000000000
Binary files a/res/drawable/list_inactive_right_border.9.png and /dev/null differ
diff --git a/res/drawable/list_selector.xml b/res/drawable/list_selector.xml
deleted file mode 100644
index bdc827c41677b2adebfd3314283e10e9cf5a8cb6..0000000000000000000000000000000000000000
--- a/res/drawable/list_selector.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_activated="true" android:drawable="@drawable/list_arrow_activated" />
-    <item android:drawable="@android:color/transparent" />
-</selector>
diff --git a/res/drawable/test_selector.xml b/res/drawable/test_selector.xml
deleted file mode 100644
index 4c3b240456a42e0215e57291bbf9ca2ace88d095..0000000000000000000000000000000000000000
--- a/res/drawable/test_selector.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
-    <solid android:color="#fb9d23"></solid>
-</shape>
diff --git a/res/layout/activity_main_onepane.xml b/res/layout/activity_main_onepane.xml
deleted file mode 100644
index 7f23f62fcaa753fe60027eda17101d67fa7fc0e0..0000000000000000000000000000000000000000
--- a/res/layout/activity_main_onepane.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<android.support.v4.widget.DrawerLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/drawer_layout"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-    <org.openhab.habdroid.ui.OpenHABViewPager
-            android:id="@+id/pager"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"/>
-    <ListView android:id="@+id/left_drawer"
-        android:layout_width="240dp"
-        android:layout_height="match_parent"
-        android:layout_gravity="start"
-        android:choiceMode="singleChoice"
-        android:divider="@android:color/transparent"
-        android:dividerHeight="0dp"
-        android:background="#111"/>
-</android.support.v4.widget.DrawerLayout>
diff --git a/res/layout/activity_main_twopane.xml b/res/layout/activity_main_twopane.xml
deleted file mode 100644
index 47e8d95e6c1726135f7c24a037345e128cac0103..0000000000000000000000000000000000000000
--- a/res/layout/activity_main_twopane.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-              android:orientation="horizontal"
-              android:layout_width="fill_parent"
-              android:layout_height="fill_parent">
-    <org.openhab.habdroid.ui.OpenHABViewPager
-            android:id="@+id/left_pager"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"/>
-    <org.openhab.habdroid.ui.OpenHABViewPager
-            android:id="@+id/right_pager"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"/>
-</LinearLayout>
diff --git a/res/layout/openhabdrawer_item.xml b/res/layout/openhabdrawer_item.xml
deleted file mode 100644
index 144ffc60f95d9cb0c1bba7bd5017ed7dc94937be..0000000000000000000000000000000000000000
--- a/res/layout/openhabdrawer_item.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="fill_parent"
-    android:layout_height="wrap_content"
-    android:paddingLeft="@dimen/widgetlist_item_left_margin"
-    android:paddingRight="@dimen/widgetlist_item_right_margin">
-    <org.openhab.habdroid.util.MySmartImageView
-        android:paddingTop="6dip"
-        android:paddingBottom="6dip"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:id="@+id/itemimage"
-        android:layout_gravity="center_vertical"
-        android:minHeight="50dip"
-        android:minWidth="50dip"
-        android:maxHeight="50dip"
-        android:maxWidth="50dip"
-        />
-    <LinearLayout
-        xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_toRightOf="@+id/itemimage"
-        android:layout_centerVertical="true">
-        <TextView android:id="@+id/itemlabel"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:textAppearance="?android:attr/textAppearanceMedium"
-            />
-    </LinearLayout>
-    <LinearLayout
-        android:id="@+id/listdivider"
-        android:layout_width="fill_parent"
-        android:layout_height="1dip"
-        android:background="?android:attr/listDivider"
-        android:orientation="horizontal"
-        android:layout_below="@+id/itemimage"
-        android:layout_marginLeft="@dimen/widgetlist_divider_left_margin"
-        android:layout_marginRight="@dimen/widgetlist_divider_right_margin"
-        />
-</RelativeLayout>
diff --git a/res/layout/openhabinfo.xml b/res/layout/openhabinfo.xml
deleted file mode 100644
index ffc0638328be7d7c474170469f49b0d5e171a9f1..0000000000000000000000000000000000000000
--- a/res/layout/openhabinfo.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-              xmlns:tools="http://schemas.android.com/tools"
-              android:orientation="vertical"
-              android:layout_width="fill_parent"
-              android:layout_height="fill_parent"
-              tools:context=".OpenHABWriteTagActivity" >
-    <TextView
-        android:id="@+id/openhab_version_label"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:text="@string/info_openhab_version_label"
-        android:textAppearance="?android:attr/textAppearanceMedium"
-        android:layout_marginTop="20dp"
-        android:gravity="center" />
-    <TextView
-        android:id="@+id/openhab_version"
-        android:textIsSelectable="true"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:text=""
-        android:textAppearance="?android:attr/textAppearanceMedium"
-        android:layout_marginTop="20dp"
-        android:gravity="center" />
-    <TextView
-        android:id="@+id/openhab_uuid_label"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:text="@string/info_openhab_uuid_label"
-        android:textAppearance="?android:attr/textAppearanceMedium"
-        android:layout_marginTop="20dp"
-        android:gravity="center" />
-    <TextView
-        android:id="@+id/openhab_uuid"
-        android:textIsSelectable="true"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:text=""
-        android:textAppearance="?android:attr/textAppearanceMedium"
-        android:layout_marginTop="20dp"
-        android:gravity="center" />
-    <TextView
-        android:id="@+id/openhab_secret_label"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:text="@string/info_openhab_secret_label"
-        android:textAppearance="?android:attr/textAppearanceMedium"
-        android:layout_marginTop="20dp"
-        android:gravity="center" />
-    <TextView
-        android:id="@+id/openhab_secret"
-        android:textIsSelectable="true"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:text=""
-        android:textAppearance="?android:attr/textAppearanceMedium"
-        android:layout_marginTop="20dp"
-        android:gravity="center" />
-</LinearLayout>
diff --git a/res/layout/openhabstartup.xml b/res/layout/openhabstartup.xml
deleted file mode 100644
index 86fd610503033a06246dff655b71795a152200de..0000000000000000000000000000000000000000
--- a/res/layout/openhabstartup.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-</LinearLayout>
diff --git a/res/layout/openhabwidgetlist.xml b/res/layout/openhabwidgetlist.xml
deleted file mode 100644
index 90d1e1756a3d1447839424bc7e543dc44d75abec..0000000000000000000000000000000000000000
--- a/res/layout/openhabwidgetlist.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    >
-<ListView
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:id="@+id/android:list"
-    android:footerDividersEnabled="false"
-    android:headerDividersEnabled="false"
-    android:divider="#00000000"
-    android:dividerHeight="0dip"
-    />
-</LinearLayout>
diff --git a/res/layout/openhabwidgetlist_chartitem.xml b/res/layout/openhabwidgetlist_chartitem.xml
deleted file mode 100644
index 23bb702f49040f69638f50b5479f6dd80c780c84..0000000000000000000000000000000000000000
--- a/res/layout/openhabwidgetlist_chartitem.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout
-  xmlns:android="http://schemas.android.com/apk/res/android"
-  android:layout_width="fill_parent"
-  android:layout_height="wrap_content"
-        android:adjustViewBounds="true"
-        android:paddingLeft="@dimen/widgetlist_item_left_margin"
-        android:paddingRight="@dimen/widgetlist_item_right_margin"
-        android:background="?android:activatedBackgroundIndicator"
-
-        >
-<org.openhab.habdroid.util.MySmartImageView
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content" 
-        android:id="@+id/chartimage"
-        android:adjustViewBounds="true"
-        android:scaleType="fitCenter"
-        android:layout_margin="5dip"
- 		/>
-<LinearLayout 
-    	android:id="@+id/listdivider"
-        android:layout_width="fill_parent"
-        android:layout_height="1dip"
-        android:background="?android:attr/listDivider"
-        android:orientation="horizontal"
-        android:layout_below="@+id/chartimage"
-        android:layout_marginLeft="@dimen/widgetlist_divider_left_margin"
-        android:layout_marginRight="@dimen/widgetlist_divider_right_margin"
-       />
-</RelativeLayout>
diff --git a/res/layout/openhabwidgetlist_coloritem.xml b/res/layout/openhabwidgetlist_coloritem.xml
deleted file mode 100644
index 47a6102f34c414474a36623ccac3b5df8cc70e60..0000000000000000000000000000000000000000
--- a/res/layout/openhabwidgetlist_coloritem.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout
-  xmlns:android="http://schemas.android.com/apk/res/android"
-  android:layout_width="fill_parent"
-  android:layout_height="wrap_content"
-  android:orientation="horizontal"
-  android:descendantFocusability="blocksDescendants"
-  android:paddingLeft="@dimen/widgetlist_item_left_margin"
-  android:paddingRight="@dimen/widgetlist_item_right_margin"
-  android:background="?android:activatedBackgroundIndicator"
-        >
-  <LinearLayout
-	    android:id="@+id/switchleftlayout"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" 
-		android:layout_alignParentLeft="true"
-      >
-<org.openhab.habdroid.util.MySmartImageView 
-        android:paddingTop="6dip" 
-        android:paddingBottom="6dip" 
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" 
-        android:id="@+id/widgetimage"
-		android:minHeight="50dip"
-		android:minWidth="50dip"
-		android:maxHeight="50dip"
-		android:maxWidth="50dip"
-		/>
-<TextView android:id="@+id/widgetlabel"
-        	android:layout_width="wrap_content"
-        	android:layout_height="wrap_content"
-        	android:textAppearance="?android:attr/textAppearanceMedium"
-  			android:layout_gravity="center_vertical"
-    	/>
-</LinearLayout>
-<LinearLayout
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" 
-		android:layout_alignParentRight="true"
-        android:layout_centerInParent="true"
-        android:focusable="false"
-        android:focusableInTouchMode="false"
-      >
-<ImageButton
-        android:id="@+id/colorbutton_up"
-        android:paddingLeft="3dip"
-        android:paddingRight="3dip"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:src="@drawable/ic_action_up"
-        android:layout_gravity="center_vertical"
-        android:focusable="false"
-        android:focusableInTouchMode="false"
-        />
-<ImageButton
-        android:id="@+id/colorbutton_color"
-        android:paddingLeft="7dip"
-        android:paddingRight="7dip"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:src="@drawable/colorwheel" 
-        android:layout_gravity="center_vertical"
-        android:focusable="false"
-        android:focusableInTouchMode="false"
-        />
-<ImageButton
-        android:id="@+id/colorbutton_down"
-        android:paddingLeft="3dip"
-        android:paddingRight="3dip"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:src="@drawable/ic_action_down"
-        android:layout_gravity="center_vertical"
-        android:focusable="false"
-        android:focusableInTouchMode="false"
-        />
-</LinearLayout>
-<LinearLayout 
-    	android:id="@+id/listdivider"
-        android:layout_width="fill_parent"
-        android:layout_height="1dip"
-        android:background="?android:attr/listDivider"
-        android:orientation="horizontal"
-        android:layout_below="@+id/switchleftlayout"
-        android:layout_marginLeft="@dimen/widgetlist_divider_left_margin"
-        android:layout_marginRight="@dimen/widgetlist_divider_right_margin"
-       />
-</RelativeLayout>
diff --git a/res/layout/openhabwidgetlist_fragment.xml b/res/layout/openhabwidgetlist_fragment.xml
deleted file mode 100644
index f579a8d983e458e67948aca28b38fe01d70e0f69..0000000000000000000000000000000000000000
--- a/res/layout/openhabwidgetlist_fragment.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-              android:orientation="vertical"
-              android:layout_width="match_parent"
-              android:layout_height="match_parent"
-              android:paddingLeft="@dimen/widgetlist_fragment_left_margin"
-              android:paddingRight="@dimen/widgetlist_fragment_right_margin"
-        >
-    <ListView android:id="@id/android:list"
-              android:layout_width="match_parent"
-              android:layout_height="0dip"
-              android:layout_weight="1"
-              android:drawSelectorOnTop="false"
-              android:footerDividersEnabled="false"
-              android:headerDividersEnabled="false"
-              android:divider="#00000000"
-              android:dividerHeight="0dip"
-              android:scrollbarStyle="outsideOverlay"
-            />
-</LinearLayout>
diff --git a/res/layout/openhabwidgetlist_frameitem.xml b/res/layout/openhabwidgetlist_frameitem.xml
deleted file mode 100644
index 3ef65c9553407d0cb1d71ce8be34ea8e01b715c8..0000000000000000000000000000000000000000
--- a/res/layout/openhabwidgetlist_frameitem.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout
-  xmlns:android="http://schemas.android.com/apk/res/android"
-  android:layout_width="fill_parent"
-  android:layout_height="wrap_content"
-  android:focusable="false"
-  android:paddingLeft="@dimen/widgetlist_item_left_margin"
-  android:paddingRight="@dimen/widgetlist_item_right_margin"
-	>
-    <TextView android:id="@+id/widgetlabel"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginLeft="6dip"
-        android:layout_centerVertical="true"
-        android:textAppearance="?android:attr/textAppearanceSmall"
-        android:textStyle="bold"
-        android:textAllCaps="true"
-        android:textColor="#ff32b2e2"
-        android:paddingLeft="5dp"
-    />
-<LinearLayout 
-    	android:id="@+id/listdivider"
-        android:layout_width="fill_parent"
-        android:layout_height="2dip"
-        android:background="#ff32b2e2"
-        android:orientation="horizontal"
-        android:layout_below="@+id/widgetlabel"
-        android:layout_marginLeft="@dimen/widgetlist_divider_left_margin"
-        android:layout_marginRight="@dimen/widgetlist_divider_right_margin"
-        android:layout_marginTop="7dip"
-        android:layout_marginBottom="7dip"
-       />
-</RelativeLayout>
\ No newline at end of file
diff --git a/res/layout/openhabwidgetlist_genericitem.xml b/res/layout/openhabwidgetlist_genericitem.xml
deleted file mode 100644
index f4902bcfd45850e48172b786814961ea65f282a9..0000000000000000000000000000000000000000
--- a/res/layout/openhabwidgetlist_genericitem.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout
-  xmlns:android="http://schemas.android.com/apk/res/android"
-  android:layout_width="fill_parent"
-  android:layout_height="wrap_content"
-  android:paddingLeft="@dimen/widgetlist_item_left_margin"
-  android:paddingRight="@dimen/widgetlist_item_right_margin"
-  android:background="?android:activatedBackgroundIndicator"
-        >
-<org.openhab.habdroid.util.MySmartImageView 
-        android:paddingTop="6dip" 
-        android:paddingBottom="6dip" 
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" 
-        android:id="@+id/widgetimage"
-		android:layout_gravity="center_vertical"
-		android:minHeight="50dip"
-		android:minWidth="50dip"
-		android:maxHeight="50dip"
-		android:maxWidth="50dip"
-		/>
-<LinearLayout
-  xmlns:android="http://schemas.android.com/apk/res/android"
-  android:layout_width="wrap_content"
-  android:layout_height="wrap_content"
-  android:layout_toRightOf="@+id/widgetimage">
-  <TextView android:id="@+id/widgetlabel"
-        	android:layout_width="wrap_content"
-        	android:layout_height="wrap_content"
-        	android:textAppearance="?android:attr/textAppearanceMedium"
-    	/>
-<TextView android:id="@+id/widgetvalue"
-    android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:textAppearance="?android:attr/textAppearanceSmall"
-    />
-</LinearLayout>
-<LinearLayout 
-    	android:id="@+id/listdivider"
-        android:layout_width="fill_parent"
-        android:layout_height="1dip"
-        android:background="?android:attr/listDivider"
-        android:orientation="horizontal"
-        android:layout_below="@+id/widgetimage"
-        android:layout_marginLeft="@dimen/widgetlist_divider_left_margin"
-        android:layout_marginRight="@dimen/widgetlist_divider_right_margin"
-       />
-</RelativeLayout>
diff --git a/res/layout/openhabwidgetlist_groupitem.xml b/res/layout/openhabwidgetlist_groupitem.xml
deleted file mode 100644
index 597a216cfa8143c3f27819af505f6b95f5a263f8..0000000000000000000000000000000000000000
--- a/res/layout/openhabwidgetlist_groupitem.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout
-  xmlns:android="http://schemas.android.com/apk/res/android"
-  android:layout_width="fill_parent"
-  android:layout_height="wrap_content"
-  android:paddingLeft="@dimen/widgetlist_item_left_margin"
-  android:paddingRight="@dimen/widgetlist_item_right_margin"
-    android:background="@drawable/list_selector"
-        >
-<org.openhab.habdroid.util.MySmartImageView 
-        android:paddingTop="6dip" 
-        android:paddingBottom="6dip" 
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" 
-        android:id="@+id/widgetimage"
-		android:layout_gravity="center_vertical"
-		android:minHeight="50dip"
-		android:minWidth="50dip"
-		android:maxHeight="50dip"
-		android:maxWidth="50dip"
-		/>
-<RelativeLayout
-  xmlns:android="http://schemas.android.com/apk/res/android"
-  android:layout_width="wrap_content"
-  android:layout_height="wrap_content"
-  android:orientation="vertical"
-  android:layout_centerVertical="true"
-  android:layout_toRightOf="@+id/widgetimage">
-  <TextView android:id="@+id/widgetlabel"
-        	android:layout_width="wrap_content"
-        	android:layout_height="wrap_content"
-        	android:textAppearance="?android:attr/textAppearanceMedium"
-    	/>
-<TextView android:id="@+id/widgetvalue"
-    android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:textAppearance="?android:attr/textAppearanceMedium"
-        android:layout_alignParentRight="true"
-        android:layout_marginRight="5dp"
-    />
-</RelativeLayout>
-    <LinearLayout
-            android:id="@+id/listdivider"
-            android:layout_width="fill_parent"
-            android:layout_height="1dip"
-            android:background="?attr/widgetlistItemDivider"
-            android:orientation="horizontal"
-            android:layout_below="@+id/widgetimage"
-            android:layout_marginLeft="@dimen/widgetlist_divider_left_margin"
-            android:layout_marginRight="@dimen/widgetlist_divider_right_margin"
-            />
-</RelativeLayout>
\ No newline at end of file
diff --git a/res/layout/openhabwidgetlist_imageitem.xml b/res/layout/openhabwidgetlist_imageitem.xml
deleted file mode 100644
index 073eb3b4dbb982210f73cedb3a98c68269e90346..0000000000000000000000000000000000000000
--- a/res/layout/openhabwidgetlist_imageitem.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout
-  xmlns:android="http://schemas.android.com/apk/res/android"
-  android:layout_width="fill_parent"
-  android:layout_height="wrap_content"
-  android:paddingLeft="@dimen/widgetlist_item_left_margin"
-  android:paddingRight="@dimen/widgetlist_item_right_margin"
-  android:background="?android:activatedBackgroundIndicator"
-
-        >
-<org.openhab.habdroid.util.MySmartImageView 
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content" 
-        android:id="@+id/imageimage"
-        android:adjustViewBounds="true"
-        android:layout_margin="5dip"
-		/>
-<LinearLayout 
-    	android:id="@+id/listdivider"
-        android:layout_width="fill_parent"
-        android:layout_height="1dip"
-        android:background="?android:attr/listDivider"
-        android:orientation="horizontal"
-        android:layout_below="@+id/imageimage"
-        android:layout_marginLeft="@dimen/widgetlist_divider_left_margin"
-        android:layout_marginRight="@dimen/widgetlist_divider_right_margin"
-       />
-</RelativeLayout>
diff --git a/res/layout/openhabwidgetlist_rollershutteritem.xml b/res/layout/openhabwidgetlist_rollershutteritem.xml
deleted file mode 100644
index e66f7f1c68ea4d5736ed72c2c88a9c36723a43a5..0000000000000000000000000000000000000000
--- a/res/layout/openhabwidgetlist_rollershutteritem.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout
-  xmlns:android="http://schemas.android.com/apk/res/android"
-  android:layout_width="fill_parent"
-  android:layout_height="wrap_content"
-  android:orientation="horizontal"
-  android:descendantFocusability="blocksDescendants"
-  android:paddingLeft="@dimen/widgetlist_item_left_margin"
-  android:paddingRight="@dimen/widgetlist_item_right_margin"
-  android:background="?android:activatedBackgroundIndicator"
-
-        >
-  <LinearLayout
-	    android:id="@+id/rollershutterleftlayout"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" 
-		android:layout_alignParentLeft="true"
-      >
-<org.openhab.habdroid.util.MySmartImageView 
-        android:paddingTop="6dip" 
-        android:paddingBottom="6dip" 
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" 
-        android:id="@+id/widgetimage"
-		android:minHeight="50dip"
-		android:minWidth="50dip"
-		android:maxHeight="50dip"
-		android:maxWidth="50dip"
-		/>
-<TextView android:id="@+id/widgetlabel"
-        	android:layout_width="wrap_content"
-        	android:layout_height="wrap_content"
-        	android:textAppearance="?android:attr/textAppearanceMedium"
-  			android:layout_gravity="center_vertical"
-    	/>
-</LinearLayout>
-  <LinearLayout
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" 
-		android:layout_alignParentRight="true"
-        android:layout_centerInParent="true"
-        android:focusable="false"
-        android:focusableInTouchMode="false"
-      >
-<ImageButton
-        android:id="@+id/rollershutterbutton_up"
-        android:paddingLeft="3dip"
-        android:paddingRight="3dip"
-        android:layout_width="40dip"
-        android:layout_height="wrap_content"
-        android:src="@drawable/ic_action_up"
-        android:layout_gravity="center_vertical"
-        android:focusable="false"
-        android:focusableInTouchMode="false"
-        />
-<ImageButton
-        android:id="@+id/rollershutterbutton_stop"
-        android:paddingLeft="7dip"
-        android:paddingRight="7dip"
-        android:layout_width="46dip"
-        android:layout_height="wrap_content"
-        android:src="@drawable/ic_action_cancel" 
-        android:layout_gravity="center_vertical"
-        android:focusable="false"
-        android:focusableInTouchMode="false"
-        />
-<ImageButton
-        android:id="@+id/rollershutterbutton_down"
-        android:paddingLeft="3dip"
-        android:paddingRight="3dip"
-        android:layout_width="40dip"
-        android:layout_height="wrap_content"
-        android:src="@drawable/ic_action_down"
-        android:layout_gravity="center_vertical"
-        android:focusable="false"
-        android:focusableInTouchMode="false"
-        />
-</LinearLayout>
-<LinearLayout 
-    	android:id="@+id/listdivider"
-        android:layout_width="fill_parent"
-        android:layout_height="1dip"
-        android:background="?android:attr/listDivider"
-        android:orientation="horizontal"
-        android:layout_below="@+id/rollershutterleftlayout"
-        android:layout_marginLeft="@dimen/widgetlist_divider_left_margin"
-        android:layout_marginRight="@dimen/widgetlist_divider_right_margin"
-       />
-</RelativeLayout>
diff --git a/res/layout/openhabwidgetlist_sectionswitchitem.xml b/res/layout/openhabwidgetlist_sectionswitchitem.xml
deleted file mode 100644
index 82044eec35f7214200eb05020f27ddeb79e17d04..0000000000000000000000000000000000000000
--- a/res/layout/openhabwidgetlist_sectionswitchitem.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout
-  xmlns:android="http://schemas.android.com/apk/res/android"
-  android:layout_width="fill_parent"
-  android:layout_height="wrap_content"
-  android:orientation="horizontal"
-  android:paddingLeft="@dimen/widgetlist_item_left_margin"
-  android:paddingRight="@dimen/widgetlist_item_right_margin"
-  android:background="?android:activatedBackgroundIndicator"
-
-        >
-  <LinearLayout
-	    android:id="@+id/sectionleftlayout"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" 
-		android:layout_alignParentLeft="true"
-      >
-<org.openhab.habdroid.util.MySmartImageView 
-        android:paddingTop="6dip" 
-        android:paddingBottom="6dip" 
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" 
-        android:id="@+id/widgetimage"
-		android:minHeight="50dip"
-		android:minWidth="50dip"
-		android:maxHeight="50dip"
-		android:maxWidth="50dip"
-		/>
-<TextView android:id="@+id/widgetlabel"
-        	android:layout_width="wrap_content"
-        	android:layout_height="wrap_content"
-        	android:textAppearance="?android:attr/textAppearanceMedium"
-  			android:layout_gravity="center_vertical"
-    	/>
-</LinearLayout>
-<TextView android:id="@+id/widgetvalue"
-        	android:layout_width="wrap_content"
-        	android:layout_height="wrap_content"
-        	android:textAppearance="?android:attr/textAppearanceMedium"
-    		android:layout_toLeftOf="@+id/sectionswitchradiogroup"
-        	android:layout_centerVertical="true"
-    	/>
-  <RadioGroup
-        android:id="@+id/sectionswitchradiogroup"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:orientation="horizontal" 
-        android:layout_alignParentRight="true"
-        android:layout_centerVertical="true"
-        android:layout_margin="0px"
-            style="@style/buttonStyle2"
-        >
-        android:focusable="false"
-        android:focusableInTouchMode="false"
-  </RadioGroup>
-<LinearLayout 
-    	android:id="@+id/listdivider"
-        android:layout_width="fill_parent"
-        android:layout_height="1dip"
-        android:background="?android:attr/listDivider"
-        android:orientation="horizontal"
-        android:layout_below="@+id/sectionleftlayout"
-        android:layout_marginLeft="@dimen/widgetlist_divider_left_margin"
-        android:layout_marginRight="@dimen/widgetlist_divider_right_margin"
-       />
-</RelativeLayout>
diff --git a/res/layout/openhabwidgetlist_sectionswitchitem_button.xml b/res/layout/openhabwidgetlist_sectionswitchitem_button.xml
deleted file mode 100644
index 0186834a15071915a015a3ad81f86a660ab3ff85..0000000000000000000000000000000000000000
--- a/res/layout/openhabwidgetlist_sectionswitchitem_button.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<org.openhab.habdroid.ui.widget.SegmentedControlButton
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:bd="http://schemas.android.com/apk/res/at.bookworm.widget.segcontrol"
-            style="@style/buttonStyle2"
-            android:text=""
-        android:focusable="false"
-        android:focusableInTouchMode="false"
-            />
diff --git a/res/layout/openhabwidgetlist_selectionitem.xml b/res/layout/openhabwidgetlist_selectionitem.xml
deleted file mode 100644
index f04791fc654c23fe386f49da2738d51feb65dde0..0000000000000000000000000000000000000000
--- a/res/layout/openhabwidgetlist_selectionitem.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout
-  xmlns:android="http://schemas.android.com/apk/res/android"
-  android:layout_width="fill_parent"
-  android:layout_height="wrap_content"
-  android:orientation="horizontal"
-  android:descendantFocusability="blocksDescendants"
-  android:paddingLeft="@dimen/widgetlist_item_left_margin"
-  android:paddingRight="@dimen/widgetlist_item_right_margin"
-  android:background="?android:activatedBackgroundIndicator"
-
-        >
-  <LinearLayout
-	    android:id="@+id/selectionleftlayout"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" 
-		android:layout_alignParentLeft="true"
-      >
-<org.openhab.habdroid.util.MySmartImageView 
-        android:paddingTop="6dip" 
-        android:paddingBottom="6dip" 
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" 
-        android:id="@+id/widgetimage"
-		android:minHeight="50dip"
-		android:minWidth="50dip"
-		android:maxHeight="50dip"
-		android:maxWidth="50dip"
-		/>
-<TextView android:id="@+id/widgetlabel"
-        	android:layout_width="wrap_content"
-        	android:layout_height="wrap_content"
-        	android:textAppearance="?android:attr/textAppearanceMedium"
-  			android:layout_gravity="center_vertical"
-    	/>
-</LinearLayout>
-<Spinner 
-        android:id="@+id/selectionspinner"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentRight="true"
-        android:layout_centerVertical="true"
-        android:focusable="false"
-        android:focusableInTouchMode="false"
-	/>
-<LinearLayout 
-    	android:id="@+id/listdivider"
-        android:layout_width="fill_parent"
-        android:layout_height="1dip"
-        android:background="?android:attr/listDivider"
-        android:orientation="horizontal"
-        android:layout_below="@+id/selectionleftlayout"
-        android:layout_marginLeft="@dimen/widgetlist_divider_left_margin"
-        android:layout_marginRight="@dimen/widgetlist_divider_right_margin"
-       />
-</RelativeLayout>
diff --git a/res/layout/openhabwidgetlist_setpointitem.xml b/res/layout/openhabwidgetlist_setpointitem.xml
deleted file mode 100644
index 9688bef305d7c607afec1fbe4dfa7a0dca73a441..0000000000000000000000000000000000000000
--- a/res/layout/openhabwidgetlist_setpointitem.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout
-  xmlns:android="http://schemas.android.com/apk/res/android"
-  android:layout_width="fill_parent"
-  android:layout_height="wrap_content"
-  android:orientation="horizontal"
-  android:paddingLeft="@dimen/widgetlist_item_left_margin"
-  android:paddingRight="@dimen/widgetlist_item_right_margin"
-  android:background="?android:activatedBackgroundIndicator"
-
-        >
-  <LinearLayout
-	    xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="wrap_content"
-        android:id="@+id/setpointleftlayout"
-        android:layout_height="wrap_content" 
-		android:layout_alignParentLeft="true"
-      >
-<org.openhab.habdroid.util.MySmartImageView 
-        android:paddingTop="6dip" 
-        android:paddingBottom="6dip" 
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" 
-        android:id="@+id/widgetimage"
-		android:minHeight="50dip"
-		android:minWidth="50dip"
-		android:maxHeight="50dip"
-		android:maxWidth="50dip"
-		/>
-<TextView android:id="@+id/widgetlabel"
-        	android:layout_width="wrap_content"
-        	android:layout_height="wrap_content"
-        	android:textAppearance="?android:attr/textAppearanceMedium"
-  			android:layout_gravity="center_vertical"
-    	/>
-</LinearLayout>
-  <LinearLayout
-	    xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" 
-		android:layout_alignParentRight="true"
-      >
-<Button
-        android:id="@+id/setpointbutton_minus"
-        android:layout_width="40dip"
-        android:layout_height="wrap_content"
-        android:text="-" />
-  <TextView android:id="@+id/widgetvalue"
-        	android:layout_width="wrap_content"
-        	android:layout_height="wrap_content"
-        	android:textAppearance="?android:attr/textAppearanceMedium"
-    	/>
-<Button
-        android:id="@+id/setpointbutton_plus"
-        android:layout_width="40dip"
-        android:layout_height="wrap_content"
-        android:text="+" />
-</LinearLayout>
-<LinearLayout 
-    	android:id="@+id/listdivider"
-        android:layout_width="fill_parent"
-        android:layout_height="1dip"
-        android:background="?android:attr/listDivider"
-        android:orientation="horizontal"
-        android:layout_below="@+id/setpointleftlayout"
-        android:layout_marginLeft="@dimen/widgetlist_divider_left_margin"
-        android:layout_marginRight="@dimen/widgetlist_divider_right_margin"
-        android:layout_alignParentLeft="true"
-       />
-</RelativeLayout>
\ No newline at end of file
diff --git a/res/layout/openhabwidgetlist_slideritem.xml b/res/layout/openhabwidgetlist_slideritem.xml
deleted file mode 100644
index 60fbba3d1d183e7bb93b0c78243cd521d096216c..0000000000000000000000000000000000000000
--- a/res/layout/openhabwidgetlist_slideritem.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout
-  xmlns:android="http://schemas.android.com/apk/res/android"
-  android:layout_width="fill_parent"
-  android:layout_height="wrap_content"
-  android:orientation="horizontal"
-  android:paddingLeft="@dimen/widgetlist_item_left_margin"
-  android:paddingRight="@dimen/widgetlist_item_right_margin"
-  android:background="?android:activatedBackgroundIndicator"
-
-        >
-  <LinearLayout
-	    xmlns:android="http://schemas.android.com/apk/res/android"
-	    android:id="@+id/sliderleftlayout"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" 
-		android:layout_alignParentLeft="true"
-      >
-<org.openhab.habdroid.util.MySmartImageView 
-        android:paddingTop="6dip" 
-        android:paddingBottom="6dip" 
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" 
-        android:id="@+id/widgetimage"
-		android:minHeight="50dip"
-		android:minWidth="50dip"
-		android:maxHeight="50dip"
-		android:maxWidth="50dip"
-		/>
-<TextView android:id="@+id/widgetlabel"
-        	android:layout_width="wrap_content"
-        	android:layout_height="wrap_content"
-        	android:textAppearance="?android:attr/textAppearanceMedium"
-  			android:layout_gravity="center_vertical"
-    	/>
-</LinearLayout>
-<SeekBar android:id="@+id/sliderseekbar"
-        android:layout_width="130dip"
-        android:layout_height="wrap_content"
-        android:layout_alignParentRight="true"
-        android:layout_centerVertical="true"
-        android:max="100">
-</SeekBar>
-<LinearLayout 
-    	android:id="@+id/listdivider"
-        android:layout_width="fill_parent"
-        android:layout_height="1dip"
-        android:background="?android:attr/listDivider"
-        android:orientation="horizontal"
-        android:layout_below="@+id/sliderleftlayout"
-        android:layout_marginLeft="@dimen/widgetlist_divider_left_margin"
-        android:layout_marginRight="@dimen/widgetlist_divider_right_margin"
-       />
-</RelativeLayout>
diff --git a/res/layout/openhabwidgetlist_switchitem.xml b/res/layout/openhabwidgetlist_switchitem.xml
deleted file mode 100644
index d671f0efe46b2af6e5354367c30c5bed4e34f725..0000000000000000000000000000000000000000
--- a/res/layout/openhabwidgetlist_switchitem.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout
-  xmlns:android="http://schemas.android.com/apk/res/android"
-  android:layout_width="fill_parent"
-  android:layout_height="wrap_content"
-  android:orientation="horizontal"
-  android:paddingLeft="@dimen/widgetlist_item_left_margin"
-  android:paddingRight="@dimen/widgetlist_item_right_margin"
-  android:background="?android:activatedBackgroundIndicator"
-
-        >
-  <LinearLayout
-	    android:id="@+id/switchleftlayout"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" 
-		android:layout_alignParentLeft="true"
-      >
-<org.openhab.habdroid.util.MySmartImageView 
-        android:paddingTop="6dip" 
-        android:paddingBottom="6dip" 
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" 
-        android:id="@+id/widgetimage"
-		android:minHeight="50dip"
-		android:minWidth="50dip"
-		android:maxHeight="50dip"
-		android:maxWidth="50dip"
-		/>
-<TextView android:id="@+id/widgetlabel"
-        	android:layout_width="wrap_content"
-        	android:layout_height="wrap_content"
-        	android:textAppearance="?android:attr/textAppearanceMedium"
-  			android:layout_gravity="center_vertical"
-    	/>
-</LinearLayout>
-<Switch android:id="@+id/switchswitch"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentRight="true"
-        android:layout_centerVertical="true"
-        android:focusable="false"
-        android:focusableInTouchMode="false"
-        android:layout_marginRight="3dip"
-    />
-<LinearLayout 
-    	android:id="@+id/listdivider"
-        android:layout_width="fill_parent"
-        android:layout_height="1dip"
-        android:background="?android:attr/listDivider"
-        android:orientation="horizontal"
-        android:layout_below="@+id/switchleftlayout"
-        android:layout_marginLeft="@dimen/widgetlist_divider_left_margin"
-        android:layout_marginRight="@dimen/widgetlist_divider_right_margin"
-       />
-</RelativeLayout>
diff --git a/res/layout/openhabwidgetlist_textitem.xml b/res/layout/openhabwidgetlist_textitem.xml
deleted file mode 100644
index 4ab7701cbdccee8ee539e6ef8c374f6265455bbc..0000000000000000000000000000000000000000
--- a/res/layout/openhabwidgetlist_textitem.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout
-  xmlns:android="http://schemas.android.com/apk/res/android"
-  android:layout_width="fill_parent"
-  android:layout_height="wrap_content"
-  android:paddingLeft="@dimen/widgetlist_item_left_margin"
-  android:paddingRight="@dimen/widgetlist_item_right_margin"
-  android:background="@drawable/list_selector"
-        >
-<org.openhab.habdroid.util.MySmartImageView 
-        android:paddingTop="6dip" 
-        android:paddingBottom="6dip" 
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" 
-        android:id="@+id/widgetimage"
-		android:layout_gravity="center_vertical"
-		android:minHeight="50dip"
-		android:minWidth="50dip"
-		android:maxHeight="50dip"
-		android:maxWidth="50dip"
-		/>
-<RelativeLayout
-  xmlns:android="http://schemas.android.com/apk/res/android"
-  android:layout_width="wrap_content"
-  android:layout_height="wrap_content"
-  android:orientation="vertical"
-  android:layout_centerVertical="true"
-  android:layout_toRightOf="@+id/widgetimage">
-  <TextView android:id="@+id/widgetlabel"
-        	android:layout_width="wrap_content"
-        	android:layout_height="wrap_content"
-        	android:textAppearance="?android:attr/textAppearanceMedium"
-    	/>
-<TextView android:id="@+id/widgetvalue"
-    android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:textAppearance="?android:attr/textAppearanceMedium"
-        android:layout_alignParentRight="true"
-        android:layout_marginRight="5dp"
-    />
-</RelativeLayout>
-    <LinearLayout
-            android:id="@+id/listdivider"
-            android:layout_width="fill_parent"
-            android:layout_height="1dip"
-            android:background="?attr/widgetlistItemDivider"
-            android:orientation="horizontal"
-            android:layout_below="@+id/widgetimage"
-            android:layout_marginLeft="@dimen/widgetlist_divider_left_margin"
-            android:layout_marginRight="@dimen/widgetlist_divider_right_margin"
-           />
-</RelativeLayout>
diff --git a/res/layout/openhabwidgetlist_videoitem.xml b/res/layout/openhabwidgetlist_videoitem.xml
deleted file mode 100644
index f7f7627cbd312ba62a20b767ece6d0a44601f83f..0000000000000000000000000000000000000000
--- a/res/layout/openhabwidgetlist_videoitem.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout
-  xmlns:android="http://schemas.android.com/apk/res/android"
-  android:layout_width="fill_parent"
-  android:layout_height="wrap_content"
-  android:paddingLeft="@dimen/widgetlist_item_left_margin"
-  android:paddingRight="@dimen/widgetlist_item_right_margin"
-  android:background="?android:activatedBackgroundIndicator"
-
-        >
-  <VideoView 
-      android:id="@+id/videovideo"
-      android:layout_width="fill_parent"
-      android:layout_height="200dip"
-      android:layout_margin="5dip"
-      android:layout_centerHorizontal="true"
-      android:adjustViewBounds="true"
-      android:minHeight="200dip"
-      />
-  <LinearLayout 
-      android:id="@+id/listdivider"
-        android:layout_width="fill_parent"
-        android:layout_height="1dip"
-        android:background="?android:attr/listDivider"
-        android:orientation="horizontal"
-        android:layout_below="@+id/videovideo"
-        android:layout_marginLeft="@dimen/widgetlist_divider_left_margin"
-        android:layout_marginRight="@dimen/widgetlist_divider_right_margin"
-       />
-</RelativeLayout>
diff --git a/res/layout/openhabwidgetlist_videomjpegitem.xml b/res/layout/openhabwidgetlist_videomjpegitem.xml
deleted file mode 100644
index 1e3f8588d8ae906cc2540f20c2c8d9be54384f8b..0000000000000000000000000000000000000000
--- a/res/layout/openhabwidgetlist_videomjpegitem.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="fill_parent"
-    android:layout_height="wrap_content"
-    android:paddingLeft="@dimen/widgetlist_item_left_margin"
-    android:paddingRight="@dimen/widgetlist_item_right_margin"
-    android:background="?android:activatedBackgroundIndicator"
-
-    >
-    <ImageView
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:id="@+id/mjpegimage"
-        android:adjustViewBounds="true"
-        android:layout_margin="5dip"
-        />
-    <LinearLayout
-        android:id="@+id/listdivider"
-        android:layout_width="fill_parent"
-        android:layout_height="1dip"
-        android:background="?android:attr/listDivider"
-        android:orientation="horizontal"
-        android:layout_below="@+id/imageimage"
-        android:layout_marginLeft="@dimen/widgetlist_divider_left_margin"
-        android:layout_marginRight="@dimen/widgetlist_divider_right_margin"
-        />
-</RelativeLayout>
\ No newline at end of file
diff --git a/res/layout/openhabwidgetlist_webitem.xml b/res/layout/openhabwidgetlist_webitem.xml
deleted file mode 100644
index 3ed485f5d3fade35ae8f578d1e3333ab606b2043..0000000000000000000000000000000000000000
--- a/res/layout/openhabwidgetlist_webitem.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout
-  xmlns:android="http://schemas.android.com/apk/res/android"
-  android:layout_width="fill_parent"
-  android:layout_height="wrap_content"
-  android:adjustViewBounds="true"
-  android:paddingLeft="@dimen/widgetlist_item_left_margin"
-  android:paddingRight="@dimen/widgetlist_item_right_margin"
-  android:background="?android:activatedBackgroundIndicator"
-
-        >
-<WebView 
-    android:id="@+id/webweb"
-    android:layout_width="fill_parent"
-    android:layout_height="wrap_content"
-    android:adjustViewBounds="true"
-    android:layout_margin="5dip"
-    />
-<LinearLayout 
-    	android:id="@+id/listdivider"
-        android:layout_width="fill_parent"
-        android:layout_height="1dip"
-        android:background="?android:attr/listDivider"
-        android:orientation="horizontal"
-        android:layout_below="@+id/webweb"
-        android:layout_marginLeft="@dimen/widgetlist_divider_left_margin"
-        android:layout_marginRight="@dimen/widgetlist_divider_right_margin"
-       />
-</RelativeLayout>
diff --git a/res/layout/openhabwritetag.xml b/res/layout/openhabwritetag.xml
deleted file mode 100644
index aa32ecbcd15861da3a65228056f970bb8c0326f8..0000000000000000000000000000000000000000
--- a/res/layout/openhabwritetag.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    tools:context=".OpenHABWriteTagActivity" >
-    <ImageView
-        android:id="@+id/write_tag_image"
-        android:src="@drawable/nfc_splash"
-        android:layout_height="wrap_content"
-        android:layout_width="fill_parent"
-        android:layout_marginTop="30dp"
-        android:gravity="center" />
-    <TextView
-        android:id="@+id/write_tag_message"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:text="@string/info_write_tag" 
-        android:textAppearance="?android:attr/textAppearanceMedium"
-        android:layout_marginTop="20dp"
-        android:gravity="center" />
-</LinearLayout>
diff --git a/res/menu/main_menu.xml b/res/menu/main_menu.xml
deleted file mode 100644
index bca6a98597c5771a1d71e52dd769bf7ec1969ca1..0000000000000000000000000000000000000000
--- a/res/menu/main_menu.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<menu xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:id="@+id/mainmenu_openhab_preferences"
-          android:title="@string/mainmenu_openhab_preferences" 
-          />
-    <item android:id="@+id/mainmenu_openhab_selectsitemap"
-          android:title="@string/mainmenu_openhab_selectsitemap" 
-          />
-    <item android:id="@+id/mainmenu_openhab_writetag"
-          android:title="@string/mainmenu_openhab_writetag"
-          />
-    <item android:id="@+id/mainmenu_openhab_info"
-          android:title="@string/mainmenu_openhab_info"
-            />
-    <item android:id="@+id/mainmenu_openhab_clearcache"
-          android:title="@string/mainmenu_openhab_clearcache"
-          />
-    <item
-            android:id="@+id/mainmenu_voice_recognition"
-            android:orderInCategory="100"
-            android:showAsAction="always"
-            android:icon="?attr/customMicIcon"
-            android:title="Voice Recognition"/>
-</menu>
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
deleted file mode 100644
index 7503d7127afc60b109da1a8192db66e6bf90299e..0000000000000000000000000000000000000000
--- a/res/values-de/strings.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <!-- General app strings -->
-    <string name="app_name">HABDroid</string>
-    <string name="openhab_service_type">_openhab-server-ssl._tcp.local.</string>
-    <string name="openhab_demo_url">https://demo.openhab.org:8443/</string>
-    <string name="app_preferences_name">Settings</string>
-    <!-- Main menu items -->
-    <string name="mainmenu_openhab_preferences">Einstellungen</string>
-    <string name="mainmenu_openhab_selectsitemap">Wähle Sitemap</string>
-    <string name="mainmenu_openhab_writetag">Schreibe NFC Tag</string>
-    <string name="mainmenu_openhab_clearcache">Lösche Bildercache</string>
-    <!-- App settings strings -->
-    <string name="settings_title">HABDroid Einstellungen</string>
-    <string name="settings_openhab_url">openHAB URL</string>
-    <string name="settings_openhab_url_summary">Manual konfigurierte openHAB URL. Wenn gesetzt, ist Auto-Discovery deaktiviert.</string>
-    <string name="settings_openhab_alturl">openHAB Remote URL</string>
-    <string name="settings_openhab_alturl_summary">Remote openHAB URL (genutzt, wenn openHAB lokal nicht gefunden wird)</string>
-    <string name="settings_openhab_username">Benutzername</string>
-    <string name="settings_openhab_username_summary">openHAB Benutzername</string>
-    <string name="settings_openhab_password">Passwort</string>
-    <string name="settings_openhab_password_summary">openHAB Passwort</string>
-    <string name="settings_openhab_screentimeroff">Deaktiviere Ruhezustand</string>
-    <string name="settings_openhab_screentimeroff_summary">Schaltet das automatische Aktivieren des Ruhezustands nach Inaktivität ab, wenn HABDroid läuft.</string>
-    <string name="settings_openhab_demomode">Demo Modus</string>
-    <string name="settings_openhab_demomode_summary">Betreibt HABDroid im Demo Modus</string>
-    <string name="settings_openhab_theme">HABDroid Theme</string>
-    <string name="settings_openhab_appversion">HABDroid Version</string>
-    <string name="settings_openhab_animation">Animation style</string>
-    <string name="settings_openhab_sslcert">Ignoriere SSL Zertifikat</string>
-    <string name="settings_openhab_sslcert_summary">Ignoriere Zertifikatsvalidierung beim SSL-Handshake</string>
-    <string name="settings_openhab_sslhost">Ignoriere SSL Hostnamen</string>
-    <string name="settings_openhab_sslhost_summary">Ignoriere Hostname-Prüfung beim SSL-Handshake</string>
-    <!-- App messages strings -->
-    <string name="info_demo_mode">HABDroid läuft im Demo Modus. Unter Einstellungen kann eine eigene openHAB-Instanz konfiguriert werden.</string>
-    <string name="info_conn_url">Verbinde mit lokaler URL</string>
-    <string name="info_conn_rem_url">Verbinde mit Remote URL</string>
-    <string name="info_discovery">Suche openHAB. Bitte warten...</string>
-    <string name="error_no_url">Bitte prüfen Sie, ob openHAB läuft oder die URLs falsch konfiguriert sind.</string>
-    <string name="error_authentication_failed">Benutzeranmeldung fehlgeschlagen. Bitte prüfen Sie Benutzername/Passwort</string>
-    <string name="error_empty_sitemap_list">openHAB lieferte eine leere Sitemapliste</string>
-    <string name="error_network_not_available">Netzwerk nicht verfügbar</string>
-    <string name="error_no_uuid">Konnte openHAB UUID nicht abrufen, Verbindung fehlgeschlagen</string>
-    <string name="erorr_invalid_url">Bitte geben Sie eine gültige URL im \'protocol://host:port/\' format an.</string>
-    <string name="erorr_no_wifi_mcast_permission">CHANGE_WIFI_MULTICAST_STATE permission wurde nicht erteilt, openHAB discovery wird daher deaktivert!</string>
-    <string name="erorr_no_wifi_state_permission">ACCESS_WIFI_STATE permission wurde nicht erteilt, openHAB discovery wird daher deaktiviert!</string>
-    <string name="title_activity_openhabwritetag">Schreibe NFC Tag</string>
-    <string name="info_write_tag">Berühren Sie den NFC-Tag und warten Sie auf die Bestätigungsmitteilung</string>
-    <string name="info_write_tag_progress">Schreibe NFC-Tag</string>
-    <string name="info_write_tag_finished">Erfolgreich abgeschlossen</string>
-    <string name="info_write_failed">Fehler beim Schreiben des NFC-Tags</string>
-    <string name="info_write_tag_unsupported">Dieses Gerät unterstützt leider kein NFC :-(</string>
-    <string name="info_write_tag_disabled">NFC ist deaktiviert. Bitte aktivieren Sie es im Geräte Einstellungsmenü.</string>
-    <string name="action_settings">Einstellungen</string>
-    <string name="nfc_dialog_title">Aktion des NFC-Tags</string>
-    <string name="info_not_set">Nicht gesetzt</string>    
-    <!-- Strings for MemorizingTrustManager activity -->
-    <string name="mtm_accept_cert">Akzeptiere unbekanntes Zertifikat?</string>
-    <string name="mtm_decision_always">Immer</string>
-    <string name="mtm_decision_once">Einmalig</string>
-    <string name="mtm_decision_abort">Abbrechen</string>
-    <string name="mtm_notification">Unbekanntes Zertifikat</string>
-</resources>
diff --git a/res/values-sw600dp-land/dimens.xml b/res/values-sw600dp-land/dimens.xml
deleted file mode 100644
index 44f01db75f0fef18081132a9e86517f8d5efa8f6..0000000000000000000000000000000000000000
--- a/res/values-sw600dp-land/dimens.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<resources>
-
-    <!--
-         Customize dimensions originally defined in res/values/dimens.xml (such as
-         screen margins) for sw600dp devices (e.g. 7" tablets) here.
-    -->
-
-</resources>
diff --git a/res/values-sw600dp-land/layout.xml b/res/values-sw600dp-land/layout.xml
deleted file mode 100644
index 680fd28a0308880e225a42731f407a281becf386..0000000000000000000000000000000000000000
--- a/res/values-sw600dp-land/layout.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<resources>
-    <item name="activity_main" type="layout">@layout/activity_main_onepane</item>
-    <integer name="pager_columns">2</integer>
-</resources>
diff --git a/res/values-sw600dp/dimens.xml b/res/values-sw600dp/dimens.xml
deleted file mode 100644
index 44f01db75f0fef18081132a9e86517f8d5efa8f6..0000000000000000000000000000000000000000
--- a/res/values-sw600dp/dimens.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<resources>
-
-    <!--
-         Customize dimensions originally defined in res/values/dimens.xml (such as
-         screen margins) for sw600dp devices (e.g. 7" tablets) here.
-    -->
-
-</resources>
diff --git a/res/values-sw600dp/layout.xml b/res/values-sw600dp/layout.xml
deleted file mode 100644
index 506619d95c5e50c6ea19bdb2d1af68be8f66a7f5..0000000000000000000000000000000000000000
--- a/res/values-sw600dp/layout.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<resources>
-    <item name="activity_main" type="layout">@layout/activity_main_onepane</item>
-</resources>
diff --git a/res/values-sw720dp-land/dimens.xml b/res/values-sw720dp-land/dimens.xml
deleted file mode 100644
index 61e3fa8fbca01c469f05fb488bdb8f5ffdb9da3c..0000000000000000000000000000000000000000
--- a/res/values-sw720dp-land/dimens.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<resources>
-
-    <!--
-         Customize dimensions originally defined in res/values/dimens.xml (such as
-         screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here.
-    -->
-    <dimen name="activity_horizontal_margin">128dp</dimen>
-
-</resources>
diff --git a/res/values-sw720dp-land/layout.xml b/res/values-sw720dp-land/layout.xml
deleted file mode 100644
index 680fd28a0308880e225a42731f407a281becf386..0000000000000000000000000000000000000000
--- a/res/values-sw720dp-land/layout.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<resources>
-    <item name="activity_main" type="layout">@layout/activity_main_onepane</item>
-    <integer name="pager_columns">2</integer>
-</resources>
diff --git a/res/values/analytics.xml b/res/values/analytics.xml
deleted file mode 100644
index 14fa71edf483b3242dcdcddcdfb45cf53cfa9ba9..0000000000000000000000000000000000000000
--- a/res/values/analytics.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<resources>
-  <string name="ga_trackingId">UA-39285202-1</string>
-  <bool name="ga_autoActivityTracking">true</bool>
-  <bool name="ga_reportUncaughtExceptions">true</bool>
-</resources>
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
deleted file mode 100644
index aabc3cbe61fe4bcdb236ae6dc174cf3ab2a71053..0000000000000000000000000000000000000000
--- a/res/values/arrays.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-<string-array name="themeArray">
-   <item>Holo Dark</item>
-   <item>Holo Light</item>
-</string-array>
-<string-array name="themeValues">
-   <item>dark</item>
-   <item>light</item>
-</string-array>
-<string-array name="animationArray">
-   <item>Android (Dissolve)</item>
-   <item>iOS (Slide)</item>
-   <item>None</item>
-</string-array>
-<string-array name="animationValues">
-   <item>android</item>
-   <item>ios</item>
-   <item>none</item>
-</string-array>
-<string-array name="nfcActionValues">
-    <item>On</item>
-    <item>Off</item>
-    <item>Toggle</item>
-</string-array>
-</resources>
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
deleted file mode 100644
index 7179f48b163dc9e84cbf1df34db68cd527647936..0000000000000000000000000000000000000000
--- a/res/values/attrs.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <declare-styleable name="ColorPicker">
-       <attr name="wheel_size" format="integer" />
-       <attr name="pointer_size" format="integer" />
-   </declare-styleable>
-    <declare-styleable name="SegmentedControlButton">
-        <attr name="textColorSelected" format="color" />
-        <attr name="textColorUnselected" format="color" />
-        <attr name="lineColor" format="color" />
-        <attr name="backgroundSelected" format="reference" />
-        <attr name="textDistanceFromLine" format="dimension" />
-        <attr name="lineHeightUnselected" format="dimension" />
-        <attr name="lineHeightSelected" format="dimension" />
-    </declare-styleable>
-    <declare-styleable name="customAttrs">
-        <attr name="customMicIcon" format="reference" />
-        <attr name="widgetlistItemDivider" format="reference" />
-    </declare-styleable>
-</resources>
\ No newline at end of file
diff --git a/res/values/colors.xml b/res/values/colors.xml
deleted file mode 100644
index fbc634c33e0fb5858faeb52d3fdaf5d48104f8ad..0000000000000000000000000000000000000000
--- a/res/values/colors.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
-    <!-- NEW NEW DESIGN ;) -->
-    <color name="normal">#b0b0b0</color>
-    <color name="light">#ffffff</color>
-    <color name="dark">#191919</color>
-    <color name="highlight">#38c0f4</color>
-
-</resources>
\ No newline at end of file
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
deleted file mode 100644
index f4366a590c4a1043ac20b08c7cad56213ad00b8d..0000000000000000000000000000000000000000
--- a/res/values/dimens.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<resources>
-
-    <!-- Default screen margins, per the Android Design guidelines. -->
-    <dimen name="activity_horizontal_margin">0dp</dimen>
-    <dimen name="activity_vertical_margin">0dp</dimen>
-    <dimen name="widgetlist_fragment_left_margin">0dp</dimen>
-    <dimen name="widgetlist_fragment_right_margin">0dp</dimen>
-    <dimen name="widgetlist_divider_left_margin">0dp</dimen>
-    <dimen name="widgetlist_divider_right_margin">0dp</dimen>
-    <dimen name="widgetlist_item_left_margin">0dp</dimen>
-    <dimen name="widgetlist_item_right_margin">0dp</dimen>
-
-</resources>
diff --git a/res/values/layout.xml b/res/values/layout.xml
deleted file mode 100644
index 3e8f42ddd1dd6471b8dfa5a6d2688cdf936de18a..0000000000000000000000000000000000000000
--- a/res/values/layout.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<resources>
-    <item name="activity_main" type="layout">@layout/activity_main_onepane</item>
-    <integer name="pager_columns">1</integer>
-</resources>
diff --git a/res/values/segcontrol_styles.xml b/res/values/segcontrol_styles.xml
deleted file mode 100644
index 2c8b9004ba3e906d66cea737574c913622d176b7..0000000000000000000000000000000000000000
--- a/res/values/segcontrol_styles.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources xmlns:bd="http://schemas.android.com/apk/res/at.bookworm.widget.segcontrol">
-
-    <style xmlns:bd="http://schemas.android.com/apk/res/at.bookworm.widget.segcontrol" name="buttonStyle1">
-        <item name="android:layout_margin">0px</item><item name="textColorSelected">@color/light</item>
-        <item name="textColorUnselected">@color/normal</item>
-        <item name="lineColor">@color/highlight</item>
-        <item name="lineHeightUnselected">2dp</item>
-        <item name="lineHeightSelected">7dp</item>
-        <item name="android:layout_width">wrap_content</item>
-        <item name="android:layout_height">wrap_content</item>
-        <item name="android:textSize">14dp</item>
-        <item name="textDistanceFromLine">5dp</item>
-        <item name="android:stretchColumns">10</item>
-        <item name="android:orientation">horizontal</item>
-        <item name="android:gravity">center_vertical|center_horizontal</item>
-        <item name="android:layout_gravity">center_vertical|center_horizontal</item>
-    </style>
-
-    <style xmlns:bd="http://schemas.android.com/apk/res/at.bookworm.widget.segcontrol" name="buttonStyle2">
-        <item name="android:layout_margin">0px</item>
-        <item name="textColorUnselected">@color/normal</item>
-        <item name="android:minWidth">45dp</item>
-        <item name="textColorSelected">@color/dark</item>
-        <item name="android:background">#00000000</item>
-        <item name="backgroundSelected">@color/highlight</item>
-        <item name="lineColor">@color/highlight</item>
-        <item name="lineHeightUnselected">2dp</item>
-        <item name="lineHeightSelected">2dp</item>
-        <item name="android:layout_width">wrap_content</item>
-        <item name="android:layout_height">41dp</item>
-        <item name="android:textSize">18dp</item>
-        <item name="textDistanceFromLine">12dp</item>
-        <item name="android:stretchColumns">0</item>
-        <item name="android:orientation">horizontal</item>
-        <item name="android:gravity">center_vertical|center_horizontal</item>
-        <item name="android:layout_gravity">center_vertical|center_horizontal</item>
-        <item name="android:padding">5dip</item>
-    </style>
-
-</resources>
\ No newline at end of file
diff --git a/res/values/strings.xml b/res/values/strings.xml
deleted file mode 100644
index adfc79219aae350d096b128d09ea72fb7dd0e45a..0000000000000000000000000000000000000000
--- a/res/values/strings.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <!-- General app strings -->
-    <string name="app_name">openHAB</string>
-    <string name="openhab_service_type">_openhab-server-ssl._tcp.local.</string>
-    <string name="openhab_demo_url">https://demo.openhab.org:8443/</string>
-    <string name="app_preferences_name">Settings</string>
-    <!-- Main menu items -->
-    <string name="mainmenu_openhab_preferences">Settings</string>
-    <string name="mainmenu_openhab_selectsitemap">Select default sitemap</string>
-    <string name="mainmenu_openhab_writetag">Write NFC tag</string>
-    <string name="mainmenu_openhab_info">openHAB info</string>
-    <string name="mainmenu_openhab_clearcache">Clear images cache</string>
-    <!-- App settings strings -->
-    <string name="settings_title">HABDroid Settings</string>
-    <string name="settings_openhab_url">openHAB URL</string>
-    <string name="settings_openhab_url_summary">Manually configured openHAB URL. Disables autodiscovery if configured.</string>
-    <string name="settings_openhab_alturl">openHAB Remote URL</string>
-    <string name="settings_openhab_alturl_summary">Remote openHAB URL (used when local openHAB is unavailable)</string>
-    <string name="settings_openhab_username">Username</string>
-    <string name="settings_openhab_username_summary">openHAB username</string>
-    <string name="settings_openhab_password">Password</string>
-    <string name="settings_openhab_password_summary">openHAB password</string>
-    <string name="settings_openhab_screentimeroff">Disable display timer</string>
-    <string name="settings_openhab_screentimeroff_summary">Disable display switch off timer when HABDroid is running</string>
-    <string name="settings_openhab_demomode">Demo mode</string>
-    <string name="settings_openhab_demomode_summary">Run HABDroid in demo mode</string>
-    <string name="settings_openhab_theme">HABDroid Theme</string>
-    <string name="settings_openhab_animation">Animation style</string>
-    <string name="settings_openhab_appversion">HABDroid Version</string>
-    <string name="settings_openhab_sslcert">Ignore SSL certificate</string>
-    <string name="settings_openhab_sslcert_summary">Ignore certificate validation during SSL handshake</string>
-    <string name="settings_openhab_sslhost">Ignore SSL hostname</string>
-    <string name="settings_openhab_sslhost_summary">Ignore hostname check during SSL handshake</string>
-    <!-- App messages strings -->
-    <string name="info_demo_mode">HABDroid is running in demo mode. To connect to your openHAB please go to settings menu.</string>
-    <string name="info_conn_url">Connecting to configured URL</string>
-    <string name="info_conn_rem_url">Connecting to remote URL</string>
-    <string name="info_discovery">Discovering openHAB. Please wait...</string>
-    <string name="error_no_url">Please check that openHAB is running or configure openHAB URL or remote URL</string>
-    <string name="error_authentication_failed">Authentication Failed. Please check Username/Password settings</string>
-    <string name="error_empty_sitemap_list">openHAB returned empty sitemap list</string>
-    <string name="error_network_not_available">Network is not available</string>
-    <string name="error_no_uuid">Unable to get openHAB UUID, connection failed</string>
-    <string name="erorr_invalid_url">Please enter a valid URL in a \'protocol://host:port/\' form</string>
-    <string name="erorr_no_wifi_mcast_permission">CHANGE_WIFI_MULTICAST_STATE permission is not granted, openHAB discovery will be disabled!</string>
-    <string name="erorr_no_wifi_state_permission">ACCESS_WIFI_STATE permission is not granted, openHAB discovery will be disabled!</string>
-    <string name="error_connection_failed">Connection to host failed</string>
-    <string name="title_activity_openhabwritetag">Write NFC tag</string>
-    <string name="title_activity_openhabinfo">openHAB Information</string>
-    <string name="info_write_tag">Touch the tag and keep it close until the confirmation message appear</string>
-    <string name="info_write_tag_progress">Writing the tag</string>
-    <string name="info_write_tag_finished">Successfully finished</string>
-    <string name="info_write_failed">Tag write error</string>
-    <string name="info_write_tag_unsupported">This device doesn\'t have NFC support :-(</string>
-    <string name="info_write_tag_disabled">NFC is disabled. Please enable it in device settings menu.</string>
-    <string name="info_openhab_version_label">openHAB Version</string>
-    <string name="info_openhab_uuid_label">openHAB UUID</string>
-    <string name="info_openhab_secret_label">openHAB Secret</string>
-    <string name="action_settings">Settings</string>
-    <string name="nfc_dialog_title">Please select NFC tag action</string>
-    <string name="info_not_set">Not set</string>
-    <!-- Strings for MemorizingTrustManager activity -->
-    <string name="mtm_accept_cert">Accept unknown Certificate?</string>
-    <string name="mtm_decision_always">Always</string>
-    <string name="mtm_decision_once">Once</string>
-    <string name="mtm_decision_abort">Abort</string>
-    <string name="mtm_notification">Certificate verification</string>
-</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
deleted file mode 100644
index 045e125f3d8dad8668061d471dd9869e29e4713a..0000000000000000000000000000000000000000
--- a/res/values/styles.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-</resources>
diff --git a/res/values/themes.xml b/res/values/themes.xml
deleted file mode 100644
index de60b8010b4c0598e036c17f15d89f3863b7ac29..0000000000000000000000000000000000000000
--- a/res/values/themes.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <style name="HABDroid.Dark" parent="android:Theme.Holo">
-        <item name="customMicIcon">@drawable/menu_mic_dark</item>
-        <item name="android:actionBarStyle">@style/HABDroid.Dark.ActionBar</item>
-        <item name="widgetlistItemDivider">?android:dividerHorizontal</item>
-    </style>
-    <style name="HABDroid.Light" parent="android:Theme.Holo.Light">
-        <item name="customMicIcon">@drawable/menu_mic_light</item>
-        <item name="android:actionBarStyle">@style/HABDroid.Light.ActionBar</item>
-        <item name="widgetlistItemDivider">?android:dividerHorizontal</item>
-    </style>
-    <style name="HABDroid.Dark.ActionBar" parent="@android:style/Widget.Holo.ActionBar">
-        <item name="android:icon">@drawable/openhabicon</item>
-    </style>
-    <style name="HABDroid.Light.ActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
-        <item name="android:icon">@drawable/openhabicon_light</item>
-    </style>
-</resources>
diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml
deleted file mode 100644
index 49f7c2e78f02a00964053ec2a1c75bea00577b81..0000000000000000000000000000000000000000
--- a/res/xml/preferences.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
-    <PreferenceCategory android:title="@string/settings_title">
-        <EditTextPreference android:key="default_openhab_url" android:title="@string/settings_openhab_url" android:summary="@string/settings_openhab_url_summary" android:defaultValue="" />
-        <EditTextPreference android:key="default_openhab_alturl" android:title="@string/settings_openhab_alturl" android:summary="@string/settings_openhab_alturl_summary" android:defaultValue="" />
-        <EditTextPreference android:key="default_openhab_username" android:title="@string/settings_openhab_username" android:summary="@string/settings_openhab_username_summary" android:defaultValue="" />
-        <EditTextPreference android:key="default_openhab_password" android:title="@string/settings_openhab_password" android:inputType="textPassword" android:summary="@string/settings_openhab_password_summary" android:defaultValue="" />
-        <CheckBoxPreference android:key="default_openhab_screentimeroff" android:title="@string/settings_openhab_screentimeroff" android:summary="@string/settings_openhab_screentimeroff_summary" android:defaultValue="false" />
-        <CheckBoxPreference android:key="default_openhab_demomode" android:title="@string/settings_openhab_demomode" android:summary="@string/settings_openhab_demomode_summary" android:defaultValue="true" />
-        <ListPreference android:key="default_openhab_theme" android:title="@string/settings_openhab_theme" android:defaultValue="dark" android:entries="@array/themeArray" android:entryValues="@array/themeValues" />
-        <ListPreference android:key="default_openhab_animation" android:title="@string/settings_openhab_animation" android:defaultValue="android" android:entries="@array/animationArray" android:entryValues="@array/animationValues" />
-        <CheckBoxPreference android:key="default_openhab_sslcert" android:title="@string/settings_openhab_sslcert" android:summary="@string/settings_openhab_sslcert_summary" android:defaultValue="false" />
-        <CheckBoxPreference android:key="default_openhab_sslhost" android:title="@string/settings_openhab_sslhost" android:summary="@string/settings_openhab_sslhost_summary" android:defaultValue="true" />
-        <EditTextPreference android:key="default_openhab_appversion" android:title="@string/settings_openhab_appversion" android:persistent="false" android:enabled="false" android:shouldDisableView="false"/>
-    </PreferenceCategory>
-</PreferenceScreen>
diff --git a/src/de/duenndns/ssl/MTMDecision.java b/src/de/duenndns/ssl/MTMDecision.java
deleted file mode 100644
index 40c406fc7254de2202e59e67021d86b18afd4de9..0000000000000000000000000000000000000000
--- a/src/de/duenndns/ssl/MTMDecision.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/* MemorizingTrustManager - a TrustManager which asks the user about invalid
- *  certificates and memorizes their decision.
- *
- * Copyright (c) 2010 Georg Lukas <georg@op-co.de>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-package de.duenndns.ssl;
-
-public class MTMDecision {
-	public final static int DECISION_INVALID	= 0;
-	public final static int DECISION_ABORT		= 1;
-	public final static int DECISION_ONCE		= 2;
-	public final static int DECISION_ALWAYS	= 3;
-
-	int state = DECISION_INVALID;
-}
diff --git a/src/de/duenndns/ssl/MemorizingActivity.java b/src/de/duenndns/ssl/MemorizingActivity.java
deleted file mode 100644
index 67e2969663c10c2b160f1887b0e4628d07b0f59d..0000000000000000000000000000000000000000
--- a/src/de/duenndns/ssl/MemorizingActivity.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/* MemorizingTrustManager - a TrustManager which asks the user about invalid
- *  certificates and memorizes their decision.
- *
- * Copyright (c) 2010 Georg Lukas <georg@op-co.de>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-package de.duenndns.ssl;
-
-
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.content.DialogInterface;
-import android.content.DialogInterface.*;
-import android.content.Intent;
-import android.os.Bundle;
-import android.util.Log;
-
-public class MemorizingActivity extends Activity
-		implements OnClickListener,OnCancelListener {
-	final static String TAG = "MemorizingActivity";
-
-	int decisionId;
-	String app;
-	
-	@Override
-	public void onCreate(Bundle savedInstanceState) {
-		Log.d(TAG, "onCreate");
-		super.onCreate(savedInstanceState);
-	}
-
-	@Override
-	public void onResume() {
-		super.onResume();
-		Intent i = getIntent();
-		app = i.getStringExtra(MemorizingTrustManager.DECISION_INTENT_APP);
-		decisionId = i.getIntExtra(MemorizingTrustManager.DECISION_INTENT_ID, MTMDecision.DECISION_INVALID);
-		String cert = i.getStringExtra(MemorizingTrustManager.DECISION_INTENT_CERT);
-		Log.d(TAG, "onResume with " + i.getExtras() + " decId=" + decisionId);
-		Log.d(TAG, "data: " + i.getData());
-		new AlertDialog.Builder(this).setTitle(getResourceIdByName(this.getPackageName(), "string", "mtm_accept_cert"))
-			.setMessage(cert)
-			.setPositiveButton(getResourceIdByName(this.getPackageName(), "string", "mtm_decision_always"), this)
-			.setNeutralButton(getResourceIdByName(this.getPackageName(), "string", "mtm_decision_once"), this)
-			.setNegativeButton(getResourceIdByName(this.getPackageName(), "string", "mtm_decision_abort"), this)
-			.setOnCancelListener(this)
-			.create().show();
-	}
-
-	void sendDecision(int decision) {
-		Log.d(TAG, "Sending decision to " + app + ": " + decision);
-		Intent i = new Intent(MemorizingTrustManager.DECISION_INTENT + "/" + app);
-		i.putExtra(MemorizingTrustManager.DECISION_INTENT_ID, decisionId);
-		i.putExtra(MemorizingTrustManager.DECISION_INTENT_CHOICE, decision);
-		sendBroadcast(i);
-		finish();
-	}
-	
-	// react on AlertDialog button press
-	public void onClick(DialogInterface dialog, int btnId) {
-		int decision;
-		dialog.dismiss();
-		switch (btnId) {
-		case DialogInterface.BUTTON_POSITIVE:
-			decision = MTMDecision.DECISION_ALWAYS;
-			break;
-		case DialogInterface.BUTTON_NEUTRAL:
-			decision = MTMDecision.DECISION_ONCE;
-			break;
-		default:
-			decision = MTMDecision.DECISION_ABORT;
-		}
-		sendDecision(decision);
-	}
-
-	public void onCancel(DialogInterface dialog) {
-		sendDecision(MTMDecision.DECISION_ABORT);
-	}
-	
-	public static int getResourceIdByName(String packageName, String className, String name) {
-		   Class r = null;
-		   int id = 0;
-		try {
-		    r = Class.forName(packageName + ".R");
-
-		    Class[] classes = r.getClasses();
-		    Class desireClass = null;
-
-		    for (int i = 0; i < classes.length; i++) {
-		        if(classes[i].getName().split("\\$")[1].equals(className)) {
-		            desireClass = classes[i];
-
-		            break;
-		        }
-		    }
-		    if(desireClass != null)
-		        id = desireClass.getField(name).getInt(desireClass);
-		} catch (ClassNotFoundException e) {
-		    e.printStackTrace();
-		} catch (IllegalArgumentException e) {
-		    e.printStackTrace();
-		} catch (SecurityException e) {
-		    e.printStackTrace();
-		} catch (IllegalAccessException e) {
-		    e.printStackTrace();
-		} catch (NoSuchFieldException e) {
-		    e.printStackTrace();
-		}
-		return id;
-	}
-
-}
diff --git a/src/de/duenndns/ssl/MemorizingResponder.java b/src/de/duenndns/ssl/MemorizingResponder.java
deleted file mode 100644
index 06295c0d3a958769d51cbb1b7d000e56a8bf5eb1..0000000000000000000000000000000000000000
--- a/src/de/duenndns/ssl/MemorizingResponder.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package de.duenndns.ssl;
-
-/**
- * Created by belovictor on 6/9/13.
- */
-public interface MemorizingResponder {
-    public void makeDecision(int decisionId, String certMessage);
-}
diff --git a/src/de/duenndns/ssl/MemorizingTrustManager.java b/src/de/duenndns/ssl/MemorizingTrustManager.java
deleted file mode 100644
index f1d110c68a1023a175eb7f41c4de51ad9cc96ae2..0000000000000000000000000000000000000000
--- a/src/de/duenndns/ssl/MemorizingTrustManager.java
+++ /dev/null
@@ -1,496 +0,0 @@
-/* MemorizingTrustManager - a TrustManager which asks the user about invalid
- *  certificates and memorizes their decision.
- *
- * Copyright (c) 2010 Georg Lukas <georg@op-co.de>
- *
- * MemorizingTrustManager.java contains the actual trust manager and interface
- * code to create a MemorizingActivity and obtain the results.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-package de.duenndns.ssl;
-
-import android.app.Activity;
-import android.app.Application;
-import android.app.Notification;
-import android.app.NotificationManager;
-import android.app.Service;
-import android.app.PendingIntent;
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.net.Uri;
-import android.util.Log;
-import android.os.Handler;
-
-import org.openhab.habdroid.R;
-
-import java.io.File;
-import java.security.cert.*;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.MessageDigest;
-import java.util.HashMap;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.TrustManagerFactory;
-import javax.net.ssl.X509TrustManager;
-
-/**
- * A X509 trust manager implementation which asks the user about invalid
- * certificates and memorizes their decision.
- * <p>
- * The certificate validity is checked using the system default X509
- * TrustManager, creating a query Dialog if the check fails.
- * <p>
- * <b>WARNING:</b> This only works if a dedicated thread is used for
- * opening sockets!
- */
-public class MemorizingTrustManager implements X509TrustManager {
-	final static String TAG = "MemorizingTrustManager";
-	public final static String DECISION_INTENT = "de.duenndns.ssl.DECISION";
-	final static String DECISION_INTENT_APP    = DECISION_INTENT + ".app";
-	public final static String DECISION_INTENT_ID     = DECISION_INTENT + ".decisionId";
-	final static String DECISION_INTENT_CERT   = DECISION_INTENT + ".cert";
-	public final static String DECISION_INTENT_CHOICE = DECISION_INTENT + ".decisionChoice";
-	private final static int NOTIFICATION_ID = 100509;
-
-	static String KEYSTORE_DIR = "KeyStore";
-	static String KEYSTORE_FILE = "KeyStore.bks";
-
-	Context master;
-	Activity foregroundAct;
-	NotificationManager notificationManager;
-	private static int decisionId = 0;
-	private static HashMap<Integer, MTMDecision> openDecisions = new HashMap<Integer, MTMDecision>();
-    private static MemorizingResponder mResponder;
-
-	Handler masterHandler;
-	private File keyStoreFile;
-	private KeyStore appKeyStore;
-	private X509TrustManager defaultTrustManager;
-	private X509TrustManager appTrustManager;
-
-	/** Creates an instance of the MemorizingTrustManager class.
-	 *
-	 * You need to supply the application context. This has to be one of:
-	 *    - Application
-	 *    - Activity
-	 *    - Service
-	 *
-	 * The context is used for file management, to display the dialog /
-	 * notification and for obtaining translated strings.
-	 *
-	 * @param m Context for the application.
-	 */
-	public MemorizingTrustManager(Context m) {
-		master = m;
-		masterHandler = new Handler();
-		notificationManager = (NotificationManager)master.getSystemService(Context.NOTIFICATION_SERVICE);
-
-		Application app;
-		if (m instanceof Application) {
-			app = (Application)m;
-		} else if (m instanceof Service) {
-			app = ((Service)m).getApplication();
-		} else if (m instanceof Activity) {
-			app = ((Activity)m).getApplication();
-		} else throw new ClassCastException("MemorizingTrustManager context must be either Activity or Service!");
-
-		File dir = app.getDir(KEYSTORE_DIR, Context.MODE_PRIVATE);
-		keyStoreFile = new File(dir + File.separator + KEYSTORE_FILE);
-
-		appKeyStore = loadAppKeyStore();
-		defaultTrustManager = getTrustManager(null);
-		appTrustManager = getTrustManager(appKeyStore);
-	}
-
-	/**
-	 * Returns a X509TrustManager list containing a new instance of
-	 * TrustManagerFactory.
-	 *
-	 * This function is meant for convenience only. You can use it
-	 * as follows to integrate TrustManagerFactory for HTTPS sockets:
-	 *
-	 * <pre>
-	 *     SSLContext sc = SSLContext.getInstance("TLS");
-	 *     sc.init(null, MemorizingTrustManager.getInstanceList(this),
-	 *         new java.security.SecureRandom());
-	 *     HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
-	 * </pre>
-	 * @param c Activity or Service to show the Dialog / Notification
-	 */
-	public static X509TrustManager[] getInstanceList(Context c) {
-		return new X509TrustManager[] { new MemorizingTrustManager(c) };
-	}
-
-	/**
-	 * Binds an Activity to the MTM for displaying the query dialog.
-	 *
-	 * This is useful if your connection is run from a service that is
-	 * triggered by user interaction -- in such cases the activity is
-	 * visible and the user tends to ignore the service notification.
-	 *
-	 * You should never have a hidden activity bound to MTM! Use this
-	 * function in onResume() and @see unbindDisplayActivity in onPause().
-	 *
-	 * @param act Activity to be bound
-	 */
-	public void bindDisplayActivity(Activity act) {
-		foregroundAct = act;
-	}
-
-	/**
-	 * Removes an Activity from the MTM display stack.
-	 *
-	 * Always call this function when the Activity added with
-	 * bindDisplayActivity is hidden.
-	 *
-	 * @param act Activity to be unbound
-	 */
-	public void unbindDisplayActivity(Activity act) {
-		// do not remove if it was overridden by a different activity
-		if (foregroundAct == act)
-			foregroundAct = null;
-	}
-
-	/**
-	 * Changes the path for the KeyStore file.
-	 *
-	 * The actual filename relative to the app's directory will be
-	 * <code>app_<i>dirname</i>/<i>filename</i></code>.
-	 *
-	 * @param dirname directory to store the KeyStore.
-	 * @param filename file name for the KeyStore.
-	 */
-	public static void setKeyStoreFile(String dirname, String filename) {
-		KEYSTORE_DIR = dirname;
-		KEYSTORE_FILE = filename;
-	}
-
-	X509TrustManager getTrustManager(KeyStore ks) {
-		try {
-			TrustManagerFactory tmf = TrustManagerFactory.getInstance("X509");
-			tmf.init(ks);
-			for (TrustManager t : tmf.getTrustManagers()) {
-				if (t instanceof X509TrustManager) {
-					return (X509TrustManager)t;
-				}
-			}
-		} catch (Exception e) {
-			// Here, we are covering up errors. It might be more useful
-			// however to throw them out of the constructor so the
-			// embedding app knows something went wrong.
-			Log.e(TAG, "getTrustManager(" + ks + ")", e);
-		}
-		return null;
-	}
-
-	KeyStore loadAppKeyStore() {
-		KeyStore ks;
-		try {
-			ks = KeyStore.getInstance(KeyStore.getDefaultType());
-		} catch (KeyStoreException e) {
-			Log.e(TAG, "getAppKeyStore()", e);
-			return null;
-		}
-		try {
-			ks.load(null, null);
-			ks.load(new java.io.FileInputStream(keyStoreFile), "MTM".toCharArray());
-		} catch (java.io.FileNotFoundException e) {
-			Log.i(TAG, "getAppKeyStore(" + keyStoreFile + ") - file does not exist");
-		} catch (Exception e) {
-			Log.e(TAG, "getAppKeyStore(" + keyStoreFile + ")", e);
-		}
-		return ks;
-	}
-
-	void storeCert(X509Certificate[] chain) {
-		// add all certs from chain to appKeyStore
-		try {
-			for (X509Certificate c : chain)
-				appKeyStore.setCertificateEntry(c.getSubjectDN().toString(), c);
-		} catch (KeyStoreException e) {
-			Log.e(TAG, "storeCert(" + chain + ")", e);
-			return;
-		}
-		
-		// reload appTrustManager
-		appTrustManager = getTrustManager(appKeyStore);
-
-		// store KeyStore to file
-		try {
-			java.io.FileOutputStream fos = new java.io.FileOutputStream(keyStoreFile);
-			appKeyStore.store(fos, "MTM".toCharArray());
-			fos.close();
-		} catch (Exception e) {
-			Log.e(TAG, "storeCert(" + keyStoreFile + ")", e);
-		}
-	}
-
-	// if the certificate is stored in the app key store, it is considered "known"
-	private boolean isCertKnown(X509Certificate cert) {
-		try {
-			return appKeyStore.getCertificateAlias(cert) != null;
-		} catch (KeyStoreException e) {
-			return false;
-		}
-	}
-
-	private boolean isExpiredException(Throwable e) {
-		do {
-			if (e instanceof CertificateExpiredException)
-				return true;
-			e = e.getCause();
-		} while (e != null);
-		return false;
-	}
-
-	public void checkCertTrusted(X509Certificate[] chain, String authType, boolean isServer)
-		throws CertificateException
-	{
-		Log.d(TAG, "checkCertTrusted(" + chain + ", " + authType + ", " + isServer + ")");
-		try {
-			Log.d(TAG, "checkCertTrusted: trying appTrustManager");
-			if (isServer)
-				appTrustManager.checkServerTrusted(chain, authType);
-			else
-				appTrustManager.checkClientTrusted(chain, authType);
-		} catch (CertificateException ae) {
-			// if the cert is stored in our appTrustManager, we ignore expiredness
-			ae.printStackTrace();
-			if (isExpiredException(ae)) {
-				Log.i(TAG, "checkCertTrusted: accepting expired certificate from keystore");
-				return;
-			}
-			if (isCertKnown(chain[0])) {
-				Log.i(TAG, "checkCertTrusted: accepting cert already stored in keystore");
-				return;
-			}
-			try {
-				Log.d(TAG, "checkCertTrusted: trying defaultTrustManager");
-				if (isServer)
-					defaultTrustManager.checkServerTrusted(chain, authType);
-				else
-					defaultTrustManager.checkClientTrusted(chain, authType);
-			} catch (CertificateException e) {
-				e.printStackTrace();
-				interact(chain, authType, e);
-			}
-		}
-	}
-
-	public void checkClientTrusted(X509Certificate[] chain, String authType)
-		throws CertificateException
-	{
-		checkCertTrusted(chain, authType, false);
-	}
-
-	public void checkServerTrusted(X509Certificate[] chain, String authType)
-		throws CertificateException
-	{
-		checkCertTrusted(chain, authType, true);
-	}
-
-	public X509Certificate[] getAcceptedIssuers()
-	{
-		Log.d(TAG, "getAcceptedIssuers()");
-		return defaultTrustManager.getAcceptedIssuers();
-	}
-
-	private int createDecisionId(MTMDecision d) {
-		int myId;
-		synchronized(openDecisions) {
-			myId = decisionId;
-			openDecisions.put(myId, d);
-			decisionId += 1;
-		}
-		return myId;
-	}
-
-	private static String hexString(byte[] data) {
-		StringBuffer si = new StringBuffer();
-		for (int i = 0; i < data.length; i++) {
-			si.append(String.format("%02x", data[i]));
-			if (i < data.length - 1)
-				si.append(":");
-		}
-		return si.toString();
-	}
-
-	private static String certHash(final X509Certificate cert, String digest) {
-		try {
-			MessageDigest md = MessageDigest.getInstance(digest);
-			md.update(cert.getEncoded());
-			return hexString(md.digest());
-		} catch (java.security.cert.CertificateEncodingException e) {
-			return e.getMessage();
-		} catch (java.security.NoSuchAlgorithmException e) {
-			return e.getMessage();
-		}
-	}
-
-	private String certChainMessage(final X509Certificate[] chain, CertificateException cause) {
-		Throwable e = cause;
-		Log.d(TAG, "certChainMessage for " + e);
-		StringBuffer si = new StringBuffer();
-		if (e.getCause() != null) {
-			e = e.getCause();
-			si.append(e.getLocalizedMessage());
-			//si.append("\n");
-		}
-		for (X509Certificate c : chain) {
-			si.append("\n\n");
-			si.append(c.getSubjectDN().toString());
-			si.append("\nMD5: ");
-			si.append(certHash(c, "MD5"));
-			si.append("\nSHA1: ");
-			si.append(certHash(c, "SHA-1"));
-			si.append("\nSigned by: ");
-			si.append(c.getIssuerDN().toString());
-		}
-		return si.toString();
-	}
-
-	void startActivityNotification(Intent intent, String certName) {
-		Notification n = new Notification(android.R.drawable.ic_lock_lock,
-				master.getString(R.string.mtm_notification),
-				System.currentTimeMillis());
-		PendingIntent call = PendingIntent.getActivity(master, 0, intent, 0);
-		n.setLatestEventInfo(master.getApplicationContext(),
-				master.getString(R.string.mtm_notification),
-				certName, call);
-		n.flags |= Notification.FLAG_AUTO_CANCEL;
-
-		notificationManager.notify(NOTIFICATION_ID, n);
-	}
-
-	/**
-	 * Returns the top-most entry of the activity stack.
-	 *
-	 * @return the Context of the currently bound UI or the master context if none is bound
-	 */
-	Context getUI() {
-		return (foregroundAct != null) ? foregroundAct : master;
-	}
-
-	void interact(final X509Certificate[] chain, String authType, CertificateException cause)
-		throws CertificateException
-	{
-		/* prepare the MTMDecision blocker object */
-		MTMDecision choice = new MTMDecision();
-		final int myId = createDecisionId(choice);
-		final String certMessage = certChainMessage(chain, cause);
-
-		BroadcastReceiver decisionReceiver = new BroadcastReceiver() {
-			public void onReceive(Context ctx, Intent i) { interactResult(i); }
-		};
-		master.registerReceiver(decisionReceiver, new IntentFilter(DECISION_INTENT + "/" + master.getPackageName()));
-		masterHandler.post(new Runnable() {
-			public void run() {
-				Intent ni = new Intent(master, MemorizingActivity.class);
-				ni.setData(Uri.parse(MemorizingTrustManager.class.getName() + "/" + myId));
-				ni.putExtra(DECISION_INTENT_APP, master.getPackageName());
-				ni.putExtra(DECISION_INTENT_ID, myId);
-				ni.putExtra(DECISION_INTENT_CERT, certMessage);
-
-				// we try to directly start the activity and fall back to
-				// making a notification
-/*				try {
-					getUI().startActivity(ni);
-				} catch (Exception e) {
-					Log.e(TAG, "startActivity: " + e);
-					startActivityNotification(ni, certMessage);
-				}*/
-                if (mResponder != null)
-                    mResponder.makeDecision(myId, certMessage);
-                else {
-                    Log.e(TAG, "No responder for decision!");
-                    interactResult(myId, MTMDecision.DECISION_ABORT);
-                }
-			}
-		});
-
-		Log.d(TAG, "openDecisions: " + openDecisions);
-		Log.d(TAG, "waiting on " + myId);
-		try {
-			synchronized(choice) { choice.wait(); }
-		} catch (InterruptedException e) {
-			e.printStackTrace();
-		}
-		master.unregisterReceiver(decisionReceiver);
-		Log.d(TAG, "finished wait on " + myId + ": " + choice.state);
-		switch (choice.state) {
-		case MTMDecision.DECISION_ALWAYS:
-			storeCert(chain);
-		case MTMDecision.DECISION_ONCE:
-			break;
-		default:
-			throw (cause);
-		}
-	}
-
-    public static void interactResult(int decisionId, int choice) {
-        Log.d(TAG, "interactResult: " + decisionId + " chose " + choice);
-        Log.d(TAG, "openDecisions: " + openDecisions);
-
-        MTMDecision d;
-        synchronized(openDecisions) {
-            d = openDecisions.get(decisionId);
-            openDecisions.remove(decisionId);
-        }
-        if (d == null) {
-            Log.e(TAG, "interactResult: aborting due to stale decision reference!");
-            return;
-        }
-        synchronized(d) {
-            d.state = choice;
-            d.notify();
-        }
-    }
-
-	public static void interactResult(Intent i) {
-		int decisionId = i.getIntExtra(DECISION_INTENT_ID, MTMDecision.DECISION_INVALID);
-		int choice = i.getIntExtra(DECISION_INTENT_CHOICE, MTMDecision.DECISION_INVALID);
-		Log.d(TAG, "interactResult: " + decisionId + " chose " + choice);
-		Log.d(TAG, "openDecisions: " + openDecisions);
-
-		MTMDecision d;
-		synchronized(openDecisions) {
-			 d = openDecisions.get(decisionId);
-			 openDecisions.remove(decisionId);
-		}
-		if (d == null) {
-			Log.e(TAG, "interactResult: aborting due to stale decision reference!");
-			return;
-		}
-		synchronized(d) {
-			d.state = choice;
-			d.notify();
-		}
-	}
-
-    public static MemorizingResponder getResponder() {
-        return mResponder;
-    }
-
-    public static void setResponder(MemorizingResponder responder) {
-        mResponder = responder;
-    }
-}
diff --git a/src/etc/header.txt b/src/etc/header.txt
deleted file mode 100644
index 8dc311825ed1af4e854c333bf030206557db9039..0000000000000000000000000000000000000000
--- a/src/etc/header.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-openHAB, the open Home Automation Bus.
-Copyright (C) 2010-${year}, openHAB.org <admin@openhab.org>
-
-See the contributors.txt file in the distribution for a
-full listing of individual contributors.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as
-published by the Free Software Foundation; either version 3 of the
-License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, see <http://www.gnu.org/licenses>.
-
-Additional permission under GNU GPL version 3 section 7
-
-If you modify this Program, or any covered work, by linking or 
-combining it with Eclipse (or a modified version of that library),
-containing parts covered by the terms of the Eclipse Public License
-(EPL), the licensors of this Program grant you additional permission
-to convey the resulting work.
diff --git a/src/org/openhab/habdroid/core/ConnectivityChangeReceiver.java b/src/org/openhab/habdroid/core/ConnectivityChangeReceiver.java
deleted file mode 100644
index 6ef346e2f3874f05c8356c2083eaebb533b4f539..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/core/ConnectivityChangeReceiver.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.core;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.os.Bundle;
-import android.util.Log;
-
-public class ConnectivityChangeReceiver extends BroadcastReceiver {
-    private static final String TAG = "ConnectivityChangeReceiver";
-
-    @Override
-    public void onReceive(Context context, Intent intent) {
-        Log.d(TAG, "onReceive()");
-        logIntent(intent);
-    }
-
-    private void logIntent(Intent intent) {
-        Log.d(TAG, "action = " + intent.getAction());
-        Log.d(TAG, "component = " + intent.getComponent());
-        Bundle extras = intent.getExtras();
-        if (extras != null) {
-            for (String key: extras.keySet()) {
-                Log.d(TAG, key + " = " + extras.get(key));
-            }
-        } else {
-            Log.d(TAG, "No extras");
-        }
-    }
-}
diff --git a/src/org/openhab/habdroid/core/DocumentHttpResponseHandler.java b/src/org/openhab/habdroid/core/DocumentHttpResponseHandler.java
deleted file mode 100644
index fda6d774ec2c6b961c59e077766403e84677e5b9..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/core/DocumentHttpResponseHandler.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.core;
-
-import android.os.Message;
-import android.util.Log;
-
-import com.loopj.android.http.AsyncHttpResponseHandler;
-
-import org.apache.http.Header;
-import org.w3c.dom.Document;
-import org.xml.sax.SAXException;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-public class DocumentHttpResponseHandler extends AsyncHttpResponseHandler {
-
-    public void onSuccess(Document response) {}
-
-    public void onSuccess(int statusCode, Header[] headers, Document response) {
-        onSuccess(statusCode, response);
-    }
-
-    public void onSuccess(int statusCode, Document response) {
-        onSuccess(response);
-    }
-
-    //
-    // Pre-processing of messages (in original calling thread, typically the UI thread)
-    //
-
-    protected void handleSuccessMessage(int statusCode, Header[] headers, Document response) {
-        onSuccess(statusCode, headers, response);
-    }
-
-    // Methods which emulate android's Handler and Message methods
-    protected void handleMessage(Message msg) {
-        Object[] response;
-
-        switch(msg.what) {
-            case SUCCESS_MESSAGE:
-                response = (Object[])msg.obj;
-                Document responseDocument = null;
-                Log.d("DocumentHttpResponseHandler", String.format("response[%d]", response.length));
-                try {
-                    Log.d("DocumentHttpResponseHandler", "Got response = " + (String) response[2]);
-                    responseDocument = parseResponse((String) response[2]);
-                    handleSuccessMessage(((Integer) response[0]).intValue(), (Header[]) response[1], responseDocument);
-                } catch (ParserConfigurationException e) {
-                    handleFailureMessage(e, (String) response[2]);
-                } catch (IOException e) {
-                    handleFailureMessage(e, (String) response[2]);
-                } catch (SAXException e) {
-                    handleFailureMessage(e, (String) response[2]);
-                }
-                break;
-            case FAILURE_MESSAGE:
-                response = (Object[])msg.obj;
-                handleFailureMessage((Throwable)response[0], (String)response[1]);
-                break;
-            case START_MESSAGE:
-                onStart();
-                break;
-            case FINISH_MESSAGE:
-                onFinish();
-                break;
-        }
-    }
-
-    protected Document parseResponse(String responseBody) throws ParserConfigurationException, IOException, SAXException {
-        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-        Document document;
-        DocumentBuilder builder = factory.newDocumentBuilder();
-        if (responseBody != null) {
-            document = builder.parse(new ByteArrayInputStream(responseBody.getBytes()));
-            return document;
-        } else
-            return null;
-    }
-
-}
diff --git a/src/org/openhab/habdroid/core/GcmBroadcastReceiver.java b/src/org/openhab/habdroid/core/GcmBroadcastReceiver.java
deleted file mode 100644
index 449a12bf6e8f6516f8b64b23e2ef1005eac253ff..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/core/GcmBroadcastReceiver.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.core;
-
-import android.app.Activity;
-import android.app.NotificationManager;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.support.v4.content.WakefulBroadcastReceiver;
-
-public class GcmBroadcastReceiver extends WakefulBroadcastReceiver {
-    private static final String TAG = "GcmBroadcastReceiver";
-    private Context mContext;
-    private NotificationManager mNotificationManager;
-    private static int mNotificationId = 0;
-
-    @Override
-    public void onReceive(Context context, Intent intent) {
-        // Explicitly specify that GcmIntentService will handle the intent.
-        ComponentName comp = new ComponentName(context.getPackageName(),
-                GcmIntentService.class.getName());
-        // Start the service, keeping the device awake while it is launching.
-        startWakefulService(context, (intent.setComponent(comp)));
-        setResultCode(Activity.RESULT_OK);
-    }
-
-/*    @Override
-    public void onReceive(Context context, Intent intent) {
-        mContext = context;
-        GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(context);
-        String messageType = gcm.getMessageType(intent);
-        Log.d(TAG, "Message type = " + messageType);
-        Log.d(TAG, intent.getExtras().keySet().toString());
-        if (GoogleCloudMessaging.MESSAGE_TYPE_SEND_ERROR.equals(messageType)) {
-            Log.d(TAG, "Send error: " + intent.getExtras().toString());
-        } else if (GoogleCloudMessaging.MESSAGE_TYPE_DELETED.equals(messageType)) {
-            Log.d(TAG, "Deleted messages on server: " +
-                    intent.getExtras().toString());
-        } else {
-            Log.d(TAG, "Type: " + intent.getExtras().getString("type"));
-            Log.d(TAG, "From: " + intent.getExtras().getString("from"));
-            Log.d(TAG, "Collapse key: " + intent.getExtras().getString("collapse_key"));
-            Log.d(TAG, "Message: " + intent.getExtras().getString("message"));
-            if (intent.getExtras() != null)
-                if (intent.getExtras().getString("type").equals("notification")) {
-                    sendNotification(intent.getExtras().getString("message"));
-                }
-        }
-        setResultCode(Activity.RESULT_OK);
-    }
-
-    private void sendNotification(String msg) {
-        mNotificationManager = (NotificationManager)
-                mContext.getSystemService(Context.NOTIFICATION_SERVICE);
-        PendingIntent contentIntent = PendingIntent.getActivity(mContext, 0,
-                new Intent(mContext, OpenHABMainActivity.class), 0);
-        Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
-        mNotificationId++;
-        NotificationCompat.Builder mBuilder =
-                new NotificationCompat.Builder(mContext)
-                        .setSmallIcon(R.drawable.openhabicon)
-                        .setContentTitle("openHAB")
-                        .setStyle(new NotificationCompat.BigTextStyle()
-                                .bigText(msg))
-                        .setAutoCancel(true)
-                        .setSound(alarmSound)
-                        .setContentText(msg);
-        mBuilder.setContentIntent(contentIntent);
-        mNotificationManager.notify(mNotificationId, mBuilder.build());
-    }
-*/
-
-}
diff --git a/src/org/openhab/habdroid/core/GcmIntentService.java b/src/org/openhab/habdroid/core/GcmIntentService.java
deleted file mode 100644
index 8a741c1151aa6ab63220178c715180126b6c4e38..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/core/GcmIntentService.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.core;
-
-import android.app.Activity;
-import android.app.IntentService;
-import android.app.NotificationManager;
-import android.app.PendingIntent;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.media.RingtoneManager;
-import android.net.Uri;
-import android.os.Bundle;
-import android.support.v4.app.NotificationCompat;
-import android.util.Log;
-
-import com.google.android.gms.gcm.GoogleCloudMessaging;
-
-import org.openhab.habdroid.R;
-import org.openhab.habdroid.ui.OpenHABMainActivity;
-
-public class GcmIntentService extends IntentService {
-
-    private static final String TAG = "GcmIntentService";
-    private NotificationManager mNotificationManager;
-    // Notification delete receiver
-    private final NotificationDeletedBroadcastReceiver mNotificationDeletedBroadcastReceiver =
-            new NotificationDeletedBroadcastReceiver();;
-
-    public GcmIntentService() {
-        super("GcmIntentService");
-    }
-
-    @Override
-    protected void onHandleIntent(Intent intent) {
-        Bundle extras = intent.getExtras();
-        if (extras == null)
-            return;
-        int notificationId;
-        if (mNotificationManager == null)
-            mNotificationManager = (NotificationManager)
-                    this.getSystemService(Context.NOTIFICATION_SERVICE);
-        GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(this);
-        String messageType = gcm.getMessageType(intent);
-        Log.d(TAG, "Message type = " + messageType);
-        if (!extras.isEmpty()) {
-            if (GoogleCloudMessaging.MESSAGE_TYPE_MESSAGE.equals(messageType)) {
-                // If this is notification, create new one
-                if (!intent.hasExtra("notificationId")) {
-                    notificationId = 1;
-                } else {
-                    notificationId = Integer.parseInt(intent.getExtras().getString("notificationId"));
-                }
-                if (intent.getExtras().getString("type").equals("notification")) {
-                    sendNotification(intent.getExtras().getString("message"), notificationId);
-                // If this is hideNotification, cancel existing notification with it's id
-                } else if (intent.getExtras().getString("type").equals("hideNotification")) {
-                    mNotificationManager.cancel(Integer.parseInt(intent.getExtras().getString("notificationId")));
-                }
-            }
-        }
-        // Release the wake lock provided by the WakefulBroadcastReceiver.
-        GcmBroadcastReceiver.completeWakefulIntent(intent);
-    }
-
-    private void sendNotification(String msg, int notificationId) {
-//        registerReceiver(mNotificationDeletedBroadcastReceiver,
-//                new IntentFilter("org.openhab.notification.deleted"));
-        if (mNotificationManager == null)
-            mNotificationManager = (NotificationManager)
-                    this.getSystemService(Context.NOTIFICATION_SERVICE);
-        Intent notificationIntent = new Intent(this, OpenHABMainActivity.class);
-        notificationIntent.setAction("org.openhab.notification.selected");
-        notificationIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
-        notificationIntent.putExtra("notificationId", notificationId);
-        PendingIntent pendingNotificationIntent = PendingIntent.getActivity(getApplicationContext(), 0,
-                notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
-        Intent deleteIntent = new Intent(getApplicationContext(), NotificationDeletedBroadcastReceiver.class);
-        deleteIntent.setAction("org.openhab.notification.deleted");
-        deleteIntent.putExtra("notificationId", notificationId);
-        PendingIntent pendingDeleteIntent = PendingIntent.getBroadcast(getApplicationContext(), 0,
-                deleteIntent, PendingIntent.FLAG_UPDATE_CURRENT);
-        Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
-        NotificationCompat.Builder mBuilder =
-                new NotificationCompat.Builder(this)
-                        .setSmallIcon(R.drawable.openhabicon)
-                        .setContentTitle("openHAB")
-                        .setStyle(new NotificationCompat.BigTextStyle()
-                                .bigText(msg))
-                        .setAutoCancel(true)
-                        .setSound(alarmSound)
-                        .setContentText(msg);
-        mBuilder.setContentIntent(pendingNotificationIntent);
-        mBuilder.setDeleteIntent(pendingDeleteIntent);
-        mNotificationManager.notify(notificationId, mBuilder.build());
-    }
-}
diff --git a/src/org/openhab/habdroid/core/NotificationDeletedBroadcastReceiver.java b/src/org/openhab/habdroid/core/NotificationDeletedBroadcastReceiver.java
deleted file mode 100644
index 9ab3e24fcd35fc8d16daba78f9a57fb807e4a0e0..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/core/NotificationDeletedBroadcastReceiver.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.core;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.os.AsyncTask;
-import android.os.Bundle;
-import android.util.Log;
-
-import com.google.android.gms.gcm.GoogleCloudMessaging;
-
-import org.openhab.habdroid.ui.OpenHABMainActivity;
-
-import java.io.IOException;
-
-public class NotificationDeletedBroadcastReceiver extends BroadcastReceiver {
-    private final static String TAG = "NotificationDeletedBroadcastReceiver";
-    private GoogleCloudMessaging gcm;
-    private Bundle sendBundle;
-
-    @Override
-    public void onReceive(Context context, Intent intent) {
-        Log.d(TAG, "onReceive()");
-        if (intent.hasExtra("notificationId")) {
-            gcm = GoogleCloudMessaging.getInstance(context);
-            sendBundle = new Bundle();
-            sendBundle.putString("type", "hideNotification");
-            sendBundle.putString("notificationId", String.valueOf(intent.getExtras().getInt("notificationId")));
-            new AsyncTask<Void, Void, Void>() {
-                protected Void doInBackground(Void... params) {
-                    try {
-                        gcm.send(OpenHABMainActivity.GCM_SENDER_ID + "@gcm.googleapis.com",
-                                "1", sendBundle);
-                    } catch (IOException e) {
-                        Log.e(TAG, e.getMessage());
-                    }
-                    return null;
-                }
-            }.execute(null, null, null);
-//            context.unregisterReceiver(this);
-        }
-    }
-}
diff --git a/src/org/openhab/habdroid/core/OpenHABTracker.java b/src/org/openhab/habdroid/core/OpenHABTracker.java
deleted file mode 100644
index 5aca21ceeedd1fb1cccb429dc6e1ffd30626a6f4..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/core/OpenHABTracker.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.core;
-
-import android.app.ProgressDialog;
-import android.content.Context;
-import android.content.IntentFilter;
-import android.content.SharedPreferences;
-import android.net.ConnectivityManager;
-import android.net.NetworkInfo;
-import android.os.AsyncTask;
-import android.preference.PreferenceManager;
-import android.util.Log;
-import android.widget.Toast;
-import org.openhab.habdroid.R;
-import org.openhab.habdroid.util.AsyncServiceResolver;
-import org.openhab.habdroid.util.AsyncServiceResolverListener;
-import org.openhab.habdroid.util.Util;
-
-import javax.jmdns.ServiceInfo;
-
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.net.MalformedURLException;
-import java.net.Socket;
-import java.net.SocketAddress;
-import java.net.URL;
-import java.net.UnknownHostException;
-import java.util.concurrent.ExecutionException;
-
-/**
- * This class provides openHAB discovery and continuous network state tracking to
- * change openHAB connectivity URL during app use if needed
- *
- * @author Victor Belov
- *
- */
-
-public class OpenHABTracker implements AsyncServiceResolverListener {
-    private final static String TAG = "OpenHABTracker";
-    // Context in which openhabtracker is working
-    Context mCtx;
-    // If bonjour discovery is enabled?
-    boolean mDiscoveryEnabled;
-    // receiver for openhabtracker notifications
-    OpenHABTrackerReceiver mReceiver;
-    // openHAB URL
-    String mOpenHABUrl;
-    // Bonjour service resolver
-    AsyncServiceResolver mServiceResolver;
-    // Bonjour openHAB service type
-    String mOpenHABServiceType;
-    // Receiver for connectivity tracking
-    ConnectivityChangeReceiver mConnectivityChangeReceiver;
-
-    public OpenHABTracker(Context ctx, String serviceType, boolean discoveryEnabled) {
-        mCtx = ctx;
-        mDiscoveryEnabled = discoveryEnabled;
-        // If context is implementing our callback interface, set it as a receiver automatically
-        if (ctx instanceof OpenHABTrackerReceiver) {
-            mReceiver = (OpenHABTrackerReceiver)ctx;
-        }
-        // openHAB Bonjour service type
-        mOpenHABServiceType = serviceType;
-        // Create and register receiver for connectivity changes tracking
-        mConnectivityChangeReceiver = new ConnectivityChangeReceiver();
-    }
-
-    /*
-        This method engages tracker to start discovery process
-     */
-
-    public void start() {
-        // Get preferences
-        SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(mCtx);
-//        mCtx.registerReceiver(mConnectivityChangeReceiver,
-//                new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
-        // If demo mode is on, just go for demo server base URL ignoring other settings
-        // Get current network information
-        ConnectivityManager connectivityManager = (ConnectivityManager)mCtx.getSystemService(
-                Context.CONNECTIVITY_SERVICE);
-        NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
-        if (activeNetworkInfo != null) {
-            if (settings.getBoolean("default_openhab_demomode", false)) {
-                mOpenHABUrl = mCtx.getString(R.string.openhab_demo_url);
-                Log.d(TAG, "Demo mode, url = " + mOpenHABUrl);
-                openHABTracked(mOpenHABUrl, mCtx.getString(R.string.info_demo_mode));
-                return;
-            } else {
-                // If we are on a mobile network go directly to remote URL from settings
-                if (activeNetworkInfo.getType() == ConnectivityManager.TYPE_MOBILE) {
-                    mOpenHABUrl = Util.normalizeUrl(settings.getString("default_openhab_alturl", ""));
-                    // If remote URL is configured
-                    if (mOpenHABUrl.length() > 0) {
-                        Log.d(TAG, "Connecting to remote URL " + mOpenHABUrl);
-                        openHABTracked(mOpenHABUrl, mCtx.getString(R.string.info_conn_rem_url));
-                    } else {
-                        openHABError(mCtx.getString(R.string.error_no_url));
-                    }
-                // Else if we are on Wifi or Ethernet network
-                } else if (activeNetworkInfo.getType() == ConnectivityManager.TYPE_WIFI
-                        || activeNetworkInfo.getType() == ConnectivityManager.TYPE_ETHERNET) {
-                    // See if we have a local URL configured in settings
-                    mOpenHABUrl = Util.normalizeUrl(settings.getString("default_openhab_url", ""));
-                    // If local URL is configured
-                    if (mOpenHABUrl.length() > 0) {
-                        // Check if configured local URL is reachable
-                        if (checkUrlReachability(mOpenHABUrl)) {
-                            Log.d(TAG, "Connecting to directly configured URL = " + mOpenHABUrl);
-                            openHABTracked(mOpenHABUrl, mCtx.getString(R.string.info_conn_url));
-                            return;
-                            // If local URL is not reachable go with remote URL
-                        } else {
-                            mOpenHABUrl = Util.normalizeUrl(settings.getString("default_openhab_alturl", ""));
-                            // If remote URL is configured
-                            if (mOpenHABUrl.length() > 0) {
-                                Log.d(TAG, "Connecting to remote URL " + mOpenHABUrl);
-                                openHABTracked(mOpenHABUrl, mCtx.getString(R.string.info_conn_rem_url));
-                            } else {
-                                openHABError(mCtx.getString(R.string.error_no_url));
-                            }
-                        }
-                    // If no local URL is configured
-                    } else {
-                        // Start service discovery
-                        mServiceResolver = new AsyncServiceResolver(mCtx, this, mOpenHABServiceType);
-                        bonjourDiscoveryStarted();
-                        mServiceResolver.start();
-                    }
-                // Else we treat other networks types as unsupported
-                } else {
-                    Log.e(TAG, "Network type (" + activeNetworkInfo.getTypeName() + ") is unsupported");
-                    openHABError("Network type (" + activeNetworkInfo.getTypeName() + ") is unsupported");
-                }
-            }
-        } else {
-            Log.e(TAG, "Network is not available");
-            openHABError(mCtx.getString(R.string.error_network_not_available));
-        }
-    }
-
-    public void stop() {
-        try {
-            mCtx.unregisterReceiver(mConnectivityChangeReceiver);
-        } catch (RuntimeException e) {
-            Log.d(TAG, e.getMessage());
-        }
-    }
-
-    public void onServiceResolved(ServiceInfo serviceInfo) {
-        bonjourDiscoveryFinished();
-        Log.d(TAG, "Service resolved: "
-                + serviceInfo.getHostAddresses()[0]
-                + " port:" + serviceInfo.getPort());
-        mOpenHABUrl = "https://" + serviceInfo.getHostAddresses()[0] + ":" +
-                String.valueOf(serviceInfo.getPort()) + "/";
-        openHABTracked(mOpenHABUrl, null);
-    }
-
-    public void onServiceResolveFailed() {
-        bonjourDiscoveryFinished();
-        Log.i(TAG, "Service resolve failed, switching to remote URL");
-        SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(mCtx);
-        mOpenHABUrl = Util.normalizeUrl(settings.getString("default_openhab_alturl", ""));
-        // If remote URL is configured
-        if (mOpenHABUrl.length() > 0) {
-            Log.d(TAG, "Connecting to remote URL " + mOpenHABUrl);
-            openHABTracked(mOpenHABUrl, mCtx.getString(R.string.info_conn_rem_url));
-        } else {
-            openHABError(mCtx.getString(R.string.error_no_url));
-        }
-    }
-
-    private boolean checkUrlReachability(String urlString) {
-        Log.d(TAG, "Checking reachability of " + urlString);
-        try {
-            return new AsyncTask<String, Void, Boolean>() {
-                @Override
-                protected Boolean doInBackground(String... strings) {
-                    try {
-                        URL url = new URL(strings[0]);
-                        int checkPort = url.getPort();
-                        if (url.getProtocol().equals("http") && checkPort == -1)
-                            checkPort = 80;
-                        if (url.getProtocol().equals("https") && checkPort == -1)
-                            checkPort = 443;
-                        Socket s = new Socket();
-                        s.connect(new InetSocketAddress(url.getHost(), checkPort), 1000);
-                        Log.d(TAG, "Socket connected");
-                        s.close();
-                        return true;
-                    } catch (MalformedURLException e) {
-                        Log.e(TAG, e.getMessage());
-                        return false;
-                    } catch (IOException e) {
-                        Log.e(TAG, e.getMessage());
-                        return false;
-                    }
-                }
-            }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, urlString).get();
-        } catch (InterruptedException e) {
-            Log.e(TAG, e.getMessage());
-            return false;
-        } catch (ExecutionException e) {
-            Log.e(TAG, e.getMessage());
-            return false;
-        }
-    }
-
-    private void openHABError(String error) {
-        if (mReceiver != null)
-            mReceiver.onError(error);
-    }
-
-    private void openHABTracked(String openHABUrl, String message) {
-        if (mReceiver != null)
-            mReceiver.onOpenHABTracked(mOpenHABUrl, message);
-    }
-
-    private void bonjourDiscoveryStarted() {
-        if (mReceiver != null)
-            mReceiver.onBonjourDiscoveryStarted();
-    }
-
-    private void bonjourDiscoveryFinished() {
-        if (mReceiver != null)
-            mReceiver.onBonjourDiscoveryFinished();
-    }
-}
diff --git a/src/org/openhab/habdroid/core/OpenHABTrackerReceiver.java b/src/org/openhab/habdroid/core/OpenHABTrackerReceiver.java
deleted file mode 100644
index efa0008faba34de652acf43654578fafeb22c4df..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/core/OpenHABTrackerReceiver.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.core;
-
-public interface OpenHABTrackerReceiver {
-    public void onOpenHABTracked(String baseUrl, String message);
-    public void onError(String error);
-    public void onBonjourDiscoveryStarted();
-    public void onBonjourDiscoveryFinished();
-}
diff --git a/src/org/openhab/habdroid/model/OpenHABItem.java b/src/org/openhab/habdroid/model/OpenHABItem.java
deleted file mode 100644
index a530bdf793eb3e9f3c1dd4df5735d03bbc86e94c..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/model/OpenHABItem.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.model;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import android.graphics.Color;
-
-/**
- * This is a class to hold basic information about openHAB Item.
- */
-
-public class OpenHABItem {
-	private String name;
-	private String type;
-	private String state = "";
-	private String link;
-
-	public OpenHABItem(Node startNode) {
-		if (startNode.hasChildNodes()) {
-			NodeList childNodes = startNode.getChildNodes();
-			for (int i = 0; i < childNodes.getLength(); i ++) {
-				Node childNode = childNodes.item(i);
-				if (childNode.getNodeName().equals("type")) {
-					this.setType(childNode.getTextContent());
-				} else if (childNode.getNodeName().equals("name")) {
-					this.setName(childNode.getTextContent());
-				} else if (childNode.getNodeName().equals("state")) {
-					if (childNode.getTextContent().equals("Uninitialized")) {
-						this.setState("0");
-					} else {
-						this.setState(childNode.getTextContent());
-					}
-				} else if (childNode.getNodeName().equals("link")) {					
-					this.setLink(childNode.getTextContent());
-				}
-			}
-		}
-	}
-	
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	public String getType() {
-		return type;
-	}
-
-	public void setType(String type) {
-		this.type = type;
-	}
-
-	public String getState() {
-		return state;
-	}
-
-	public void setState(String state) {
-		this.state = state;
-	}
-	
-	public boolean getStateAsBoolean() {
-		// If state is ON for switches return True
-		if (state.equals("ON")) {
-			return true;
-		}
-		// If decimal value and it is >0 return True
-		try {
-			int decimalValue = Integer.valueOf(state);
-			if (decimalValue > 0)
-				return true;
-		} catch (NumberFormatException e) {
-			return false;
-		}
-		// Else return False
-		return false;
-	}
-	
-	public Float getStateAsFloat() {
-		return Float.parseFloat(state);
-	}
-
-	public float[] getStateAsHSV() {
-		String[] stateSplit = state.split(",");
-		if (stateSplit.length == 3) { // We need exactly 3 numbers to operate this
-			float[] result = {Float.parseFloat(stateSplit[0]), Float.parseFloat(stateSplit[1])/100, Float.parseFloat(stateSplit[2])/100};
-			return result;
-		} else {
-			float[] result = {0, 0, 0};
-			return result;
-		}
-	}
-
-	public int getStateAsColor() {
-		return Color.HSVToColor(getStateAsHSV());
-	}
-
-	public String getLink() {
-		return link;
-	}
-
-	public void setLink(String link) {
-		this.link = link;
-	}
-	
-}
diff --git a/src/org/openhab/habdroid/model/OpenHABLinkedPage.java b/src/org/openhab/habdroid/model/OpenHABLinkedPage.java
deleted file mode 100644
index 171e31302270dad4e1c784059129d25d4c3099c9..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/model/OpenHABLinkedPage.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.model;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * This is a class to hold information about openHAB linked page.
- */
-
-public class OpenHABLinkedPage {
-	private String id;
-	private String title;
-	private String icon;
-	private String link;
-	private static final String TAG = "OpenHABLinkedPage";
-	
-	public OpenHABLinkedPage(Node startNode) {
-		if (startNode.hasChildNodes()) {
-			NodeList childNodes = startNode.getChildNodes();
-			for (int i = 0; i < childNodes.getLength(); i ++) {
-				Node childNode = childNodes.item(i);
-				if (childNode.getNodeName().equals("id")) {
-					this.setId(childNode.getTextContent());
-				} else if (childNode.getNodeName().equals("title")) {
-					this.setTitle(childNode.getTextContent());
-				} else if (childNode.getNodeName().equals("icon")) {
-					this.setIcon(childNode.getTextContent());
-				} else if (childNode.getNodeName().equals("link")) {
-					this.setLink(childNode.getTextContent());
-				}
-			}
-		}
-	}
-
-	public String getId() {
-		return id;
-	}
-
-	public void setId(String id) {
-		this.id = id;
-	}
-
-	public String getTitle() {
-        if (title.indexOf('[') > 0) {
-            return title.substring(0, title.indexOf('['));
-        }
-		return title;
-	}
-
-	public void setTitle(String title) {
-		this.title = title;
-	}
-
-	public String getIcon() {
-		return icon;
-	}
-
-	public void setIcon(String icon) {
-		this.icon = icon;
-	}
-
-	public String getLink() {
-		return link;
-	}
-
-	public void setLink(String link) {
-		this.link = link;
-	}
-
-	public static String getTag() {
-		return TAG;
-	}
-	
-}
diff --git a/src/org/openhab/habdroid/model/OpenHABNFCActionList.java b/src/org/openhab/habdroid/model/OpenHABNFCActionList.java
deleted file mode 100644
index fa38c597eef74d990b0084f5711b183bbed2c9e9..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/model/OpenHABNFCActionList.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.model;
-
-import java.util.ArrayList;
-
-public class OpenHABNFCActionList {
-	private ArrayList<String> actionNames;
-	private ArrayList<String> actionCommands;
-
-	public OpenHABNFCActionList(OpenHABWidget openHABWidget) {
-		actionNames = new ArrayList<String>();
-		actionCommands = new ArrayList<String>();
-		if (openHABWidget.getItem() != null) {
-			// If widget have mappings, we will populate names and commands with values
-			// from this mappings
-			if (openHABWidget.hasMappings()) {
-			// Else we only can do it for Switch widget with On/Off/Toggle commands
-				for (int i = 0; i < openHABWidget.getMappings().size(); i++) {
-					actionNames.add(openHABWidget.getMappings().get(i).getLabel());
-					actionCommands.add(openHABWidget.getMappings().get(i).getCommand());
-				}
-			} else if (openHABWidget.getType().equals("Switch")) {
-				if (openHABWidget.getItem().getType().equals("SwitchItem")) {
-					actionNames.add("On");
-					actionCommands.add("ON");
-					actionNames.add("Off");
-					actionCommands.add("OFF");
-					actionNames.add("Toggle");
-					actionCommands.add("TOGGLE");
-				} else if (openHABWidget.getItem().getType().equals("RollershutterItem")) {
-					actionNames.add("Up");
-					actionCommands.add("UP");
-					actionNames.add("Down");
-					actionCommands.add("DOWN");					
-					actionNames.add("Toggle");
-					actionCommands.add("TOGGLE");					
-				}
-			} else if (openHABWidget.getType().equals("Colorpicker")) {
-				actionNames.add("On");
-				actionCommands.add("ON");
-				actionNames.add("Off");
-				actionCommands.add("OFF");
-				actionNames.add("Toggle");
-				actionCommands.add("TOGGLE");
-				if (openHABWidget.getItem() != null) {
-					actionNames.add("Current Color");
-					actionCommands.add(openHABWidget.getItem().getState());
-				}
-			}
-		}
-	}
-	
-	public String[] getNames() {
-		return this.actionNames.toArray(new String[this.actionNames.size()]);
-	}
-	
-	public String[] getCommands() {
-		return this.actionCommands.toArray(new String[this.actionCommands.size()]);
-	}
-
-}
diff --git a/src/org/openhab/habdroid/model/OpenHABSitemap.java b/src/org/openhab/habdroid/model/OpenHABSitemap.java
deleted file mode 100644
index b68706d2f6506d3a16ba653e6acabdbd62cf0202..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/model/OpenHABSitemap.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.model;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class OpenHABSitemap {
-	private String name;
-    private String label;
-	private String link;
-    private String icon;
-	private String homepageLink;
-    private boolean leaf = false;
-	
-	public OpenHABSitemap(Node startNode) {
-		if (startNode.hasChildNodes()) {
-			NodeList childNodes = startNode.getChildNodes();
-			for (int i = 0; i < childNodes.getLength(); i ++) {
-				Node childNode = childNodes.item(i);
-				if (childNode.getNodeName().equals("name")) {
-					this.setName(childNode.getTextContent());
-                } else if (childNode.getNodeName().equals("label")) {
-                    this.setLabel(childNode.getTextContent());
-				} else if (childNode.getNodeName().equals("link")) {
-					this.setLink(childNode.getTextContent());
-                } else if (childNode.getNodeName().equals("icon")) {
-                    this.setIcon(childNode.getTextContent());
-				} else if (childNode.getNodeName().equals("homepage")) {
-					if (childNode.hasChildNodes()) {
-						NodeList homepageNodes = childNode.getChildNodes();
-						for (int j = 0; j < homepageNodes.getLength(); j++) {
-							Node homepageChildNode = homepageNodes.item(j);
-							if (homepageChildNode.getNodeName().equals("link")) {
-								this.setHomepageLink(homepageChildNode.getTextContent());
-							} else if (homepageChildNode.getNodeName().equals("leaf")) {
-                                if (homepageChildNode.getTextContent().equals("true")) {
-                                    setLeaf(true);
-                                } else {
-                                    setLeaf(false);
-                                }
-                            }
-						}
-					}
-				}
-			}
-		}
-	}
-	
-	public String getName() {
-		return name;
-	}
-	public void setName(String name) {
-		this.name = name;
-	}
-	public String getLink() {
-		return link;
-	}
-	public void setLink(String link) {
-		this.link = link;
-	}
-	public String getHomepageLink() {
-		return homepageLink;
-	}
-	public void setHomepageLink(String homepageLink) {
-		this.homepageLink = homepageLink;
-	}
-    public String getIcon() {
-        return icon;
-    }
-    public void setIcon(String icon) {
-        this.icon = icon;
-    }
-
-    public String getLabel() {
-        return label;
-    }
-
-    public void setLabel(String label) {
-        this.label = label;
-    }
-
-    public boolean isLeaf() {
-        return leaf;
-    }
-
-    public void setLeaf(boolean isLeaf) {
-        leaf = isLeaf;
-    }
-}
diff --git a/src/org/openhab/habdroid/model/OpenHABWidget.java b/src/org/openhab/habdroid/model/OpenHABWidget.java
deleted file mode 100644
index 245bc4032f6a72ed92b15a7f9bea4505fd91ebb1..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/model/OpenHABWidget.java
+++ /dev/null
@@ -1,358 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.model;
-
-import android.graphics.Color;
-import android.text.TextUtils;
-import android.util.Log;
-
-import java.util.ArrayList;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * This is a class to hold basic information about openHAB widget.
- */
-
-public class OpenHABWidget {
-	private String id;
-	private String label;
-	private String icon;
-	private String type;
-	private String url;
-	private String period = "";
-    private String service = "";
-	private float minValue =0;
-	private float maxValue = 100;
-	private float step = 1;
-	private int refresh = 0;
-	private int height = 0;
-	private OpenHABWidget parent;
-	private OpenHABItem item;
-	private OpenHABLinkedPage linkedPage;
-	private ArrayList<OpenHABWidget> children;
-	private ArrayList<OpenHABWidgetMapping> mappings;
-    private boolean mChildrenHasLinkedPages = false;
-    private Integer iconcolor;
-    private Integer labelcolor;
-    private Integer valuecolor;
-    private String encoding;
-
-	public OpenHABWidget() {
-		this.children = new ArrayList<OpenHABWidget>();
-		this.mappings = new ArrayList<OpenHABWidgetMapping>();
-	}
-	
-	public OpenHABWidget(OpenHABWidget parent, Node startNode) {
-		this.parent = parent;
-		this.children = new ArrayList<OpenHABWidget>();
-		this.mappings = new ArrayList<OpenHABWidgetMapping>();
-		if (startNode.hasChildNodes()) {
-			NodeList childNodes = startNode.getChildNodes();
-			for (int i = 0; i < childNodes.getLength(); i ++) {
-				Node childNode = childNodes.item(i);
-				if (childNode.getNodeName().equals("item")) {
-					this.setItem(new OpenHABItem(childNode));
-				} else if (childNode.getNodeName().equals("linkedPage")) {					
-					this.setLinkedPage(new OpenHABLinkedPage(childNode));
-				} else if (childNode.getNodeName().equals("widget")) {
-					new OpenHABWidget(this, childNode);
-				} else {
-					if (childNode.getNodeName().equals("type")) {
-						this.setType(childNode.getTextContent());
-					} else if (childNode.getNodeName().equals("widgetId")) {
-						this.setId(childNode.getTextContent());
-					} else if (childNode.getNodeName().equals("label")) {
-						this.setLabel(childNode.getTextContent());
-					} else if (childNode.getNodeName().equals("icon")) {
-						this.setIcon(childNode.getTextContent());
-					} else if (childNode.getNodeName().equals("url")) {
-						this.setUrl(childNode.getTextContent());
-					} else if (childNode.getNodeName().equals("minValue")) {
-						setMinValue(Float.valueOf(childNode.getTextContent()).floatValue());
-					} else if (childNode.getNodeName().equals("maxValue")) {
-						setMaxValue(Float.valueOf(childNode.getTextContent()).floatValue());
-					} else if (childNode.getNodeName().equals("step")) {
-						setStep(Float.valueOf(childNode.getTextContent()).floatValue());
-					} else if (childNode.getNodeName().equals("refresh")) {
-						setRefresh(Integer.valueOf(childNode.getTextContent()).intValue());
-					} else if (childNode.getNodeName().equals("period")) {
-						setPeriod(childNode.getTextContent());
-                    } else if (childNode.getNodeName().equals("service")) {
-                        setService(childNode.getTextContent());
-                    } else if (childNode.getNodeName().equals("height")) {
-						setHeight(Integer.valueOf(childNode.getTextContent()));
-					} else if (childNode.getNodeName().equals("mapping")) {
-						NodeList mappingChildNodes = childNode.getChildNodes();
-						String mappingCommand = "";
-						String mappingLabel = "";
-						for (int k = 0; k < mappingChildNodes.getLength(); k++) {
-							if (mappingChildNodes.item(k).getNodeName().equals("command"))
-								mappingCommand = mappingChildNodes.item(k).getTextContent();
-							if (mappingChildNodes.item(k).getNodeName().equals("label"))
-								mappingLabel = mappingChildNodes.item(k).getTextContent();
-						}
-						OpenHABWidgetMapping mapping = new OpenHABWidgetMapping(mappingCommand, mappingLabel);
-						mappings.add(mapping);
-					} else if (childNode.getNodeName().equals("iconcolor")) {
-                        setIconColor(childNode.getTextContent());
-                    } else if (childNode.getNodeName().equals("labelcolor")) {
-                        setLabelColor(childNode.getTextContent());
-                    } else if (childNode.getNodeName().equals("valuecolor")) {
-                        setValueColor(childNode.getTextContent());
-                    } else if (childNode.getNodeName().equals("encoding")) {
-                        setEncoding(childNode.getTextContent());
-                    }
-				}
-			}
-		}
-		this.parent.addChildWidget(this);
-	}
-	
-	public void addChildWidget(OpenHABWidget child) {
-		if (child != null) {
-			this.children.add(child);
-		}
-	}
-
-	public boolean hasChildren() {
-		if (this.children.size() > 0) {
-			return true;
-		} else {
-			return false;
-		}
-	}
-	
-	public ArrayList<OpenHABWidget> getChildren() {
-		return this.children;
-	}
-	
-	public boolean hasItem() {
-		if (this.getItem() != null) {
-			return true;
-		} else {
-			return false;
-		}
-	}
-	
-	public boolean hasLinkedPage() {
-		if (this.linkedPage != null) {
-			return true;
-		} else {
-			return false;
-		}
-	}
-	
-	public String getType() {
-		return type;
-	}
-
-	public void setType(String type) {
-		this.type = type;
-	}
-
-	public OpenHABItem getItem() {
-		return item;
-	}
-
-	public void setItem(OpenHABItem item) {
-		this.item = item;
-	}
-
-	public String getLabel() {
-		return label;
-	}
-
-	public void setLabel(String label) {
-		this.label = label;
-	}
-
-	public String getIcon() {
-		return icon;
-	}
-
-	public void setIcon(String icon) {
-		this.icon = icon;
-	}
-
-	public OpenHABLinkedPage getLinkedPage() {
-		return linkedPage;
-	}
-
-	public void setLinkedPage(OpenHABLinkedPage linkedPage) {
-		this.linkedPage = linkedPage;
-	}
-
-	public String getUrl() {
-		return url;
-	}
-
-	public void setUrl(String url) {
-		this.url = url;
-	}
-	
-	public boolean hasMappings() {
-		if (mappings.size() > 0) {
-			return true;
-		}
-		return false;
-	}
-	
-	public OpenHABWidgetMapping getMapping(int index) {
-		return mappings.get(index);
-	}
-	
-	public ArrayList<OpenHABWidgetMapping> getMappings() {
-		return mappings;
-	}
-
-	public float getMinValue() {
-		return minValue;
-	}
-
-	public void setMinValue(float minValue) {
-		this.minValue = minValue;
-	}
-
-	public float getMaxValue() {
-		return maxValue;
-	}
-
-	public void setMaxValue(float maxValue) {
-		this.maxValue = maxValue;
-	}
-
-	public float getStep() {
-		return step;
-	}
-
-	public void setStep(float step) {
-		this.step = step;
-	}
-
-	public int getRefresh() {
-		return refresh;
-	}
-
-	public void setRefresh(int refresh) {
-		this.refresh = refresh;
-	}
-
-	public String getPeriod() {
-		if (period.length() == 0) {
-			return "D";
-		}
-		return period;
-	}
-
-	public void setPeriod(String period) {
-		this.period = period;
-	}
-
-    public String getService() { return service; }
-
-    public void setService(String service) { this.service = service; }
-
-	public int getHeight() {
-		return height;
-	}
-
-	public void setHeight(int height) {
-		this.height = height;
-	}
-
-	public String getId() {
-		return id;
-	}
-
-	public void setId(String id) {
-		this.id = id;
-	}
-
-    public boolean childrenHasLinkedPages() {
-        if (this.hasChildren()) {
-            for (OpenHABWidget w : this.getChildren()) {
-                if (w.hasLinkedPage())
-                    return true;
-            }
-        }
-        return false;
-    }
-
-    public boolean childrenHasNonlinkedPages() {
-        if (this.hasChildren()) {
-            for (OpenHABWidget w : this.getChildren()) {
-                if (!w.hasLinkedPage())
-                    return true;
-            }
-        }
-        return false;
-    }
-
-    public Integer getLabelColor() {
-        return labelcolor;
-    }
-
-    public void setLabelColor(String color) {
-        try {
-            this.labelcolor = new Integer(Color.parseColor(fixColorName(color)));
-        } catch(IllegalArgumentException e) {
-            Log.e("OpenHABWidget", "Color was " + color);
-            Log.e("OpenHABWidget", e.getMessage());
-            this.labelcolor = null;
-        }
-    }
-
-    public Integer getValueColor() {
-        return valuecolor;
-    }
-
-    public void setValueColor(String color) {
-        try {
-            this.valuecolor = new Integer(Color.parseColor(fixColorName(color)));
-        } catch(IllegalArgumentException e) {
-            Log.e("OpenHABWidget", "Color was " + color);
-            Log.e("OpenHABWidget", e.getMessage());
-            this.valuecolor = null;
-        }
-    }
-
-    public Integer getIconColor() {
-        return iconcolor;
-    }
-
-    public void setIconColor(String color) {
-        try {
-            this.iconcolor = new Integer(Color.parseColor(fixColorName(color)));
-        } catch(IllegalArgumentException e) {
-            Log.e("OpenHABWidget", "Color was " + color);
-            Log.e("OpenHABWidget", e.getMessage());
-            this.iconcolor = null;
-        }
-    }
-
-    private String fixColorName(String colorName) {
-        if (colorName.equals("orange"))
-            return "#FFA500";
-        return colorName;
-    }
-
-    public String getEncoding() {
-        return encoding;
-    }
-
-    public void setEncoding(String encoding) {
-        this.encoding = encoding;
-    }
-}
diff --git a/src/org/openhab/habdroid/model/OpenHABWidgetDataSource.java b/src/org/openhab/habdroid/model/OpenHABWidgetDataSource.java
deleted file mode 100644
index 164ffd3c17bb689ccf0eab09e5538f1bfd8030e8..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/model/OpenHABWidgetDataSource.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.model;
-
-import java.util.ArrayList;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import android.util.Log;
-
-/**
- * This class provides datasource for openHAB widgets from sitemap page.
- * It uses a sitemap page XML document to create a list of widgets
- */
-
-public class OpenHABWidgetDataSource {
-	private static final String TAG = "OpenHABWidgetDataSource";
-	private OpenHABWidget rootWidget;
-	private String title;
-	private String id;
-	private String icon;
-	private String link;
-
-	public OpenHABWidgetDataSource() {
-		
-	}
-	
-	public OpenHABWidgetDataSource(Node rootNode) {
-		setSourceNode(rootNode);
-	}
-	
-	public void setSourceNode(Node rootNode) {
-		Log.i(TAG, "Loading new data");
-        if (rootNode == null)
-            return;
-		rootWidget = new OpenHABWidget();
-		rootWidget.setType("root");
-		if (rootNode.hasChildNodes()) {
-			NodeList childNodes = rootNode.getChildNodes();
-			for (int i = 0; i < childNodes.getLength(); i ++) {
-				Node childNode = childNodes.item(i);
-				if (childNode.getNodeName().equals("widget")) {
-					new OpenHABWidget(rootWidget, childNode);
-				} else if (childNode.getNodeName().equals("title")) {
-					this.setTitle(childNode.getTextContent());
-				} else if (childNode.getNodeName().equals("id")) {
-					this.setId(childNode.getTextContent());
-				} else if (childNode.getNodeName().equals("icon")) {
-					this.setIcon(childNode.getTextContent());
-				} else if (childNode.getNodeName().equals("link")) {
-					this.setLink(childNode.getTextContent());
-				}
-			}
-		}
-	}
-	
-	public OpenHABWidget getRootWidget() {
-		return this.rootWidget;
-	}
-
-	public OpenHABWidget getWidgetById(String widgetId) {
-		ArrayList<OpenHABWidget> widgets = this.getWidgets();
-		for (int i = 0; i < widgets.size(); i++) {
-			if (widgets.get(i).getId().equals(widgetId))
-				return widgets.get(i);
-		}
-		return null;
-	}
-	
-	public ArrayList<OpenHABWidget> getWidgets() {
-		ArrayList<OpenHABWidget> result = new ArrayList<OpenHABWidget>();
-		if (rootWidget != null)
-		if (this.rootWidget.hasChildren()) {
-			for (int i = 0; i < rootWidget.getChildren().size(); i++) {
-				OpenHABWidget openHABWidget = this.rootWidget.getChildren().get(i);
-				result.add(openHABWidget);
-				if (openHABWidget.hasChildren()) {
-					for (int j = 0; j < openHABWidget.getChildren().size(); j++) {
-						result.add(openHABWidget.getChildren().get(j));
-					}
-				}
-			}
-		}
-		return result;
-	}
-
-    public ArrayList<OpenHABWidget> getLinkWidgets() {
-        ArrayList<OpenHABWidget> result = new ArrayList<OpenHABWidget>();
-        if (rootWidget != null)
-            if (this.rootWidget.hasChildren()) {
-                for (int i = 0; i < rootWidget.getChildren().size(); i++) {
-                    OpenHABWidget openHABWidget = this.rootWidget.getChildren().get(i);
-                    if (openHABWidget.hasLinkedPage() || openHABWidget.childrenHasLinkedPages())
-                    result.add(openHABWidget);
-                    if (openHABWidget.hasChildren()) {
-                        for (int j = 0; j < openHABWidget.getChildren().size(); j++) {
-                            if (openHABWidget.getChildren().get(j).hasLinkedPage())
-                                result.add(openHABWidget.getChildren().get(j));
-                        }
-                    }
-                }
-            }
-        return result;
-    }
-
-    public ArrayList<OpenHABWidget> getNonlinkWidgets() {
-        ArrayList<OpenHABWidget> result = new ArrayList<OpenHABWidget>();
-        if (rootWidget != null)
-            if (this.rootWidget.hasChildren()) {
-                for (int i = 0; i < rootWidget.getChildren().size(); i++) {
-                    OpenHABWidget openHABWidget = this.rootWidget.getChildren().get(i);
-                    if ((openHABWidget.getType().equals("Frame") && openHABWidget.childrenHasNonlinkedPages()) ||
-                            (!openHABWidget.getType().equals("Frame") && !openHABWidget.hasLinkedPage()))
-                        result.add(openHABWidget);
-                    if (openHABWidget.hasChildren()) {
-                        for (int j = 0; j < openHABWidget.getChildren().size(); j++) {
-                            if (!openHABWidget.getChildren().get(j).hasLinkedPage())
-                                result.add(openHABWidget.getChildren().get(j));
-                        }
-                    }
-                }
-            }
-        return result;
-    }
-
-
-    public void logWidget(OpenHABWidget widget) {
-		Log.i(TAG, "Widget <" + widget.getLabel() + "> (" + widget.getType() + ")");
-		if (widget.hasChildren()) {
-			for (int i = 0; i < widget.getChildren().size(); i++) {
-				logWidget(widget.getChildren().get(i));
-			}
-		}
-	}
-
-	public String getTitle() {
-		String[] splitString;
-        if (title != null) {
-    		splitString = title.split("\\[|\\]");
-            if (splitString.length>0) {
-                return splitString[0];
-            } else {
-                return title;
-            }
-        }
-        return "";
-	}
-
-	public void setTitle(String title) {
-		this.title = title;
-	}
-
-	public String getId() {
-		return id;
-	}
-
-	public void setId(String id) {
-		this.id = id;
-	}
-
-	public String getIcon() {
-		return icon;
-	}
-
-	public void setIcon(String icon) {
-		this.icon = icon;
-	}
-
-	public String getLink() {
-		return link;
-	}
-
-	public void setLink(String link) {
-		this.link = link;
-	}
-	
-}
diff --git a/src/org/openhab/habdroid/model/OpenHABWidgetMapping.java b/src/org/openhab/habdroid/model/OpenHABWidgetMapping.java
deleted file mode 100644
index 8b8ec959f89e969418753c69a0a8ed1a8b274777..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/model/OpenHABWidgetMapping.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.model;
-
-public class OpenHABWidgetMapping {
-	private String command;
-	private String label;
-	
-	public OpenHABWidgetMapping(String command, String label) {
-		this.command = command;
-		this.label = label;
-	}
-	public String getCommand() {
-		return command;
-	}
-	public void setCommand(String command) {
-		this.command = command;
-	}
-	public String getLabel() {
-		return label;
-	}
-	public void setLabel(String label) {
-		this.label = label;
-	}
-}
diff --git a/src/org/openhab/habdroid/ui/OnWidgetSelectedListener.java b/src/org/openhab/habdroid/ui/OnWidgetSelectedListener.java
deleted file mode 100644
index e1227a97df5b21aa046c700308934b5a560d4710..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/ui/OnWidgetSelectedListener.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.ui;
-
-import org.openhab.habdroid.model.OpenHABLinkedPage;
-
-/**
- * Created by belovictor on 5/22/13.
- */
-public interface OnWidgetSelectedListener {
-    public void onWidgetSelectedListener(OpenHABLinkedPage widgetLink, OpenHABWidgetListFragment source);
-}
diff --git a/src/org/openhab/habdroid/ui/OpenHABFragmentPagerAdapter.java b/src/org/openhab/habdroid/ui/OpenHABFragmentPagerAdapter.java
deleted file mode 100644
index 957720757fbca57835147d0c642f458c12ce3e6a..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/ui/OpenHABFragmentPagerAdapter.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.ui;
-
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentManager;
-import android.support.v4.app.FragmentStatePagerAdapter;
-import android.support.v4.view.ViewPager;
-import android.util.Log;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class OpenHABFragmentPagerAdapter extends FragmentStatePagerAdapter implements ViewPager.OnPageChangeListener {
-
-    private static final String TAG = "OpenHABFragmentPagerAdapter";
-    private List<OpenHABWidgetListFragment> fragmentList;
-    private FragmentManager fragmentManager;
-    private boolean notifyDataSetChangedPending = false;
-    private int columnsNumber = 1;
-    private String openHABBaseUrl;
-    private String sitemapRootUrl;
-    private String openHABUsername;
-    private String openHABPassword;
-    private boolean actualColumnCountChanged = false;
-    private int mSelectedPage;
-
-    public OpenHABFragmentPagerAdapter(FragmentManager fm) {
-        super(fm);
-        fragmentManager = fm;
-        fragmentList = new ArrayList<OpenHABWidgetListFragment>(0);
-    }
-
-    @Override
-    public Fragment getItem(int position) {
-        Log.d(TAG, String.format("getItem(%d)", position));
-//        OpenHABWidgetListFragment fragment = fragmentList.get(position);
-//        return fragment;
-        return fragmentList.get(position);
-    }
-
-    @Override
-    public int getCount() {
-        return fragmentList.size();
-    }
-
-    @Override
-    public int getItemPosition(Object object) {
-        Log.d(TAG, "getItemPosition");
-        if (columnsNumber == 1 && fragmentList.contains(object)) {
-            return fragmentList.indexOf(object);
-        } else {
-            return POSITION_NONE;
-        }
-    }
-
-    public List<OpenHABWidgetListFragment> getFragmentList() {
-        return fragmentList;
-    }
-
-    public void setFragmentList(List<OpenHABWidgetListFragment>fragments) {
-        fragmentList = fragments;
-        notifyDataSetChanged();
-    }
-
-    public void clearFragmentList() {
-        fragmentList.clear();
-        notifyDataSetChanged();
-    }
-
-    public OpenHABWidgetListFragment getFragment(int position) {
-        if (position < fragmentList.size()) {
-            return fragmentList.get(position);
-        }
-        return null;
-    }
-
-    public int getPositionByUrl(String pageUrl) {
-        for (int i = 0; i < fragmentList.size(); i++) {
-            if (fragmentList.get(i).getDisplayPageUrl().equals(pageUrl)) {
-                return i;
-            }
-        }
-        return -1;
-    }
-
-    public int getPosition(OpenHABWidgetListFragment fragment) {
-        if (fragmentList.contains(fragment)) {
-            return fragmentList.indexOf(fragment);
-        }
-        return -1;
-    }
-
-    @Override
-    public float getPageWidth(int position) {
-        float pageWidth;
-/*        pageWidth = 1.0f / getActualColumnsNumber();*/
-        if (getActualColumnsNumber() > 1) {
-            if (position == fragmentList.size()-1) { // Last fragment
-                pageWidth = 0.67f;
-            } else {
-                pageWidth = 0.33f;
-            }
-        } else {
-            pageWidth = 1.0f;
-        }
-        Log.d(TAG, String.format("getPageWidth(%d) returned %f", position, pageWidth));
-        return  pageWidth;
-    }
-
-    public int getActualColumnsNumber() {
-        if (mSelectedPage + 1 < columnsNumber && fragmentList.size() > 0) {
-            return fragmentList.size();
-        }
-        return columnsNumber;
-    }
-
-    public void openPage(String pageUrl) {
-        Log.d(TAG, "openPage(" + pageUrl + ")");
-        OpenHABWidgetListFragment fragment = OpenHABWidgetListFragment.withPage(pageUrl, openHABBaseUrl,
-                sitemapRootUrl, openHABUsername, openHABPassword, fragmentList.size());
-        fragmentList.add(fragment);
-        notifyDataSetChanged();
-    }
-
-    public void openPage(String pageUrl, int position) {
-        Log.d(TAG, "openPage(" + pageUrl + ")");
-        int oldColumnCount = getActualColumnsNumber();
-        if (position < fragmentList.size()) {
-            for (int i=fragmentList.size()-1; i>=position; i--) {
-                fragmentList.remove(i);
-                Log.d(TAG, String.format("Removing fragment at position %d", i));
-            }
-            notifyDataSetChanged();
-        }
-        OpenHABWidgetListFragment fragment = OpenHABWidgetListFragment.withPage(pageUrl, openHABBaseUrl,
-                sitemapRootUrl, openHABUsername, openHABPassword, position);
-        fragmentList.add(fragment);
-        Log.d(TAG, String.format("Old columns = %d, new columns = %d", oldColumnCount, getActualColumnsNumber()));
-//        if (getActualColumnsNumber() != oldColumnCount)
-            actualColumnCountChanged = true;
-        Log.d(TAG, "Before notifyDataSetChanged");
-        notifyDataSetChanged();
-        Log.d(TAG, "After notifyDataSetChanged");
-        actualColumnCountChanged = false;
-    }
-
-    public void onPageScrolled(int i, float v, int i2) {
-
-    }
-
-    public void onPageSelected(int pageSelected) {
-        Log.d(TAG, String.format("onPageSelected(%d)", pageSelected));
-        mSelectedPage = pageSelected;
-        int oldColumnCount = getActualColumnsNumber();
-        if (pageSelected < fragmentList.size() - 1) {
-            Log.d(TAG, "new position is less then current");
-            if (columnsNumber > 1) { // In multicolumn we will modify fragment list immediately
-                fragmentList.get(pageSelected).clearSelection();
-                for(int i=fragmentList.size()-1; i>mSelectedPage; i--) {
-                    Log.d(TAG, String.format("Removing page %d", i));
-                    fragmentList.remove(i);
-                }
-                notifyDataSetChanged();
-            } else { // In single column we will set a flag to do that after scroll finishes
-                notifyDataSetChangedPending = true;
-            }
-        }
-    }
-
-    public void onPageScrollStateChanged(int state) {
-        Log.d(TAG, String.format("onPageScrollStateChanged(%d)", state));
-        // If scroll was finished and there is a flag to notify pager pending
-        if (state == ViewPager.SCROLL_STATE_IDLE && notifyDataSetChangedPending) {
-            Log.d(TAG, "Scrolling finished");
-            if (mSelectedPage < fragmentList.size() - 1) {
-                Log.d(TAG, "new position is less then current");
-                for(int i=fragmentList.size()-1; i>mSelectedPage; i--) {
-                    fragmentList.remove(i);
-                }
-            }
-            notifyDataSetChanged();
-            notifyDataSetChangedPending = false;
-        }
-
-    }
-
-    @Override
-    public CharSequence getPageTitle(int position) {
-        Log.d(TAG, String.format("getPageTitle(%d)", position));
-        return fragmentList.get(position).getTitle();
-    }
-
-    public int getColumnsNumber() {
-        return columnsNumber;
-    }
-
-    public void setColumnsNumber(int columnsNumber) {
-        this.columnsNumber = columnsNumber;
-    }
-
-    public String getOpenHABBaseUrl() {
-        return openHABBaseUrl;
-    }
-
-    public void setOpenHABBaseUrl(String openHABBaseUrl) {
-        this.openHABBaseUrl = openHABBaseUrl;
-    }
-
-    public String getSitemapRootUrl() {
-        return sitemapRootUrl;
-    }
-
-    public void setSitemapRootUrl(String sitemapRootUrl) {
-        this.sitemapRootUrl = sitemapRootUrl;
-    }
-
-    public String getOpenHABUsername() {
-        return openHABUsername;
-    }
-
-    public void setOpenHABUsername(String openHABUsername) {
-        this.openHABUsername = openHABUsername;
-    }
-
-    public String getOpenHABPassword() {
-        return openHABPassword;
-    }
-
-    public void setOpenHABPassword(String openHABPassword) {
-        this.openHABPassword = openHABPassword;
-    }
-}
diff --git a/src/org/openhab/habdroid/ui/OpenHABInfoActivity.java b/src/org/openhab/habdroid/ui/OpenHABInfoActivity.java
deleted file mode 100644
index 57819d7cc763521c43ff565b13794dcec3949160..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/ui/OpenHABInfoActivity.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.ui;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.util.Log;
-import android.view.View;
-import android.widget.TextView;
-
-import com.loopj.android.http.AsyncHttpResponseHandler;
-
-import org.openhab.habdroid.R;
-import org.openhab.habdroid.util.MyAsyncHttpClient;
-import org.openhab.habdroid.util.Util;
-
-public class OpenHABInfoActivity extends Activity {
-
-    private static final String TAG = "OpenHABInfoActivity";
-    private TextView mOpenHABVersionText;
-    private TextView mOpenHABUUIDText;
-    private TextView mOpenHABSecretText;
-    private TextView mOpenHABSecretLabel;
-    private String mOpenHABBaseUrl;
-    private String mUsername;
-    private String mPassword;
-    private static MyAsyncHttpClient mAsyncHttpClient;
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        Log.d(TAG, "onCreate()");
-        Util.setActivityTheme(this);
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.openhabinfo);
-        mAsyncHttpClient = new MyAsyncHttpClient(this);
-        mOpenHABVersionText = (TextView)findViewById(R.id.openhab_version);
-        mOpenHABUUIDText = (TextView)findViewById(R.id.openhab_uuid);
-        mOpenHABSecretText = (TextView)findViewById(R.id.openhab_secret);
-        mOpenHABSecretLabel = (TextView)findViewById(R.id.openhab_secret_label);
-        if (getIntent().hasExtra("openHABBaseUrl")) {
-            mOpenHABBaseUrl = getIntent().getStringExtra("openHABBaseUrl");
-            mUsername = getIntent().getStringExtra("username");
-            mPassword = getIntent().getStringExtra("password");
-            mAsyncHttpClient.setBasicAuth(mUsername, mPassword);
-        } else {
-            Log.e(TAG, "No openHABBaseURl parameter passed, can't fetch openHAB info from nowhere");
-            finish();
-        }
-    }
-
-    @Override
-    public void onResume() {
-        Log.d(TAG, "onResume()");
-        super.onResume();
-        Log.d(TAG, "url = " + mOpenHABBaseUrl + "static/version");
-        mAsyncHttpClient.get(mOpenHABBaseUrl + "static/version", new AsyncHttpResponseHandler() {
-            @Override
-            public void onSuccess(String content) {
-                Log.d(TAG, "Got version = " + content);
-                mOpenHABVersionText.setText(content);
-            }
-
-            @Override
-            public void onFailure(Throwable error, String content) {
-                mOpenHABVersionText.setText("Unknown");
-                Log.e(TAG, error.getMessage());
-            }
-        });
-        mAsyncHttpClient.get(mOpenHABBaseUrl + "static/uuid", new AsyncHttpResponseHandler() {
-            @Override
-            public void onSuccess(String content) {
-                Log.d(TAG, "Got uuid = " + content);
-                mOpenHABUUIDText.setText(content);
-            }
-
-            @Override
-            public void onFailure(Throwable error, String content) {
-                mOpenHABUUIDText.setText("Unknown");
-                if (error.getMessage() != null)
-                    Log.e(TAG, error.getMessage());
-            }
-        });
-        mAsyncHttpClient.get(mOpenHABBaseUrl + "static/secret", new AsyncHttpResponseHandler() {
-            @Override
-            public void onSuccess(String content) {
-                Log.d(TAG, "Got secret = " + content);
-                mOpenHABSecretText.setVisibility(View.VISIBLE);
-                mOpenHABSecretLabel.setVisibility(View.VISIBLE);
-                mOpenHABSecretText.setText(content);
-            }
-
-            @Override
-            public void onFailure(Throwable error, String content) {
-                mOpenHABSecretText.setVisibility(View.GONE);
-                mOpenHABSecretLabel.setVisibility(View.GONE);
-                Log.e(TAG, error.getMessage());
-            }
-        });
-    }
-
-        @Override
-    public void finish() {
-        super.finish();
-        Util.overridePendingTransition(this, true);
-    }
-}
diff --git a/src/org/openhab/habdroid/ui/OpenHABMainActivity.java b/src/org/openhab/habdroid/ui/OpenHABMainActivity.java
deleted file mode 100644
index 55a603b2f6f991073bc878086320b3ac5961dd20..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/ui/OpenHABMainActivity.java
+++ /dev/null
@@ -1,943 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.ui;
-
-import android.Manifest;
-import android.app.AlertDialog;
-import android.app.PendingIntent;
-import android.app.ProgressDialog;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.content.SharedPreferences;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
-import android.content.res.Configuration;
-import android.net.Uri;
-import android.nfc.NfcAdapter;
-import android.os.AsyncTask;
-import android.os.Build;
-import android.os.Bundle;
-import android.preference.PreferenceManager;
-import android.provider.Settings;
-import android.speech.RecognizerIntent;
-import android.support.v4.app.ActionBarDrawerToggle;
-import android.support.v4.app.FragmentActivity;
-import android.support.v4.app.FragmentManager;
-import android.support.v4.widget.DrawerLayout;
-import android.text.TextUtils;
-import android.util.Log;
-import android.view.*;
-import android.widget.AdapterView;
-import android.widget.ArrayAdapter;
-import android.widget.ListView;
-import android.widget.Toast;
-import com.crittercism.app.Crittercism;
-import com.google.analytics.tracking.android.EasyTracker;
-import com.google.android.gms.gcm.GoogleCloudMessaging;
-import com.google.android.gms.location.LocationClient;
-import com.loopj.android.http.AsyncHttpResponseHandler;
-import com.loopj.android.image.WebImageCache;
-
-import org.apache.http.client.HttpResponseException;
-import org.apache.http.entity.ByteArrayEntity;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.protocol.HTTP;
-import org.openhab.habdroid.R;
-import org.openhab.habdroid.core.DocumentHttpResponseHandler;
-import org.openhab.habdroid.core.NotificationDeletedBroadcastReceiver;
-import org.openhab.habdroid.core.OpenHABTracker;
-import org.openhab.habdroid.core.OpenHABTrackerReceiver;
-import org.openhab.habdroid.model.OpenHABLinkedPage;
-import org.openhab.habdroid.model.OpenHABSitemap;
-import org.openhab.habdroid.ui.drawer.OpenHABDrawerAdapter;
-import org.openhab.habdroid.util.MyAsyncHttpClient;
-import org.openhab.habdroid.util.Util;
-import org.w3c.dom.Document;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.util.ArrayList;
-import java.util.List;
-import de.duenndns.ssl.MTMDecision;
-import de.duenndns.ssl.MemorizingResponder;
-import de.duenndns.ssl.MemorizingTrustManager;
-
-public class OpenHABMainActivity extends FragmentActivity implements OnWidgetSelectedListener,
-        OpenHABTrackerReceiver, MemorizingResponder {
-    // Logging TAG
-    private static final String TAG = "MainActivity";
-    // Activities request codes
-    private static final int VOICE_RECOGNITION_REQUEST_CODE = 1001;
-    private static final int SETTINGS_REQUEST_CODE = 1002;
-    private static final int WRITE_NFC_TAG_REQUEST_CODE = 1003;
-    private static final int INFO_REQUEST_CODE = 1004;
-    public static final String GCM_SENDER_ID = "737820980945";
-    // Base URL of current openHAB connection
-    private String openHABBaseUrl = "https://demo.openhab.org:8443/";
-    // openHAB username
-    private String openHABUsername = "";
-    // openHAB password
-    private String openHABPassword = "";
-    // openHAB Bonjour service name
-    private String openHABServiceType;
-    // view pager for widgetlist fragments
-    private OpenHABViewPager pager;
-    // view pager adapter for widgetlist fragments
-    private OpenHABFragmentPagerAdapter pagerAdapter;
-    // root URL of the current sitemap
-    private String sitemapRootUrl;
-    // A fragment which retains it's state through configuration changes to keep the current state of the app
-    private StateRetainFragment stateFragment;
-    // Enable/disable development mode
-    private boolean isDeveloper;
-    // preferences
-    private SharedPreferences mSettings;
-    // OpenHAB tracker
-    private OpenHABTracker mOpenHABTracker;
-    // Progress dialog
-    private ProgressDialog mProgressDialog;
-    // If Voice Recognition is enabled
-    private boolean mVoiceRecognitionEnabled = false;
-    // If openHAB discovery is enabled
-    private boolean mServiceDiscoveryEnabled = true;
-    // Loopj
-    private static MyAsyncHttpClient mAsyncHttpClient;
-    // NFC Launch data
-    private String mNfcData;
-    // Pending NFC page
-    private String mPendingNfcPage;
-    // Drawer Layout
-    private DrawerLayout mDrawerLayout;
-    // Drawer Toggler
-    private ActionBarDrawerToggle mDrawerToggle;
-    // GCM Registration expiration
-    public static final long REGISTRATION_EXPIRY_TIME_MS = 1000 * 3600 * 24 * 7;
-    // Google Cloud Messaging
-    private GoogleCloudMessaging mGcm;
-    private OpenHABDrawerAdapter mDrawerAdapter;
-    private String[] mDrawerTitles = {"First floor", "Seconf floor", "Cellar", "Garage"};
-    private ListView mDrawerList;
-    private List<OpenHABSitemap> mSitemapList;
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        Log.d(TAG, "onCreate()");
-        // Check if we are in development mode
-        isDeveloper = false;
-        // Set default values, false means do it one time during the very first launch
-        PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
-        // Set non-persistent HABDroid version preference to current version from application package
-        try {
-            PreferenceManager.getDefaultSharedPreferences(this).edit().putString("default_openhab_appversion",
-                    getPackageManager().getPackageInfo(getPackageName(), 0).versionName).commit();
-        } catch (PackageManager.NameNotFoundException e1) {
-            if (e1 != null)
-                Log.d(TAG, e1.getMessage());
-        }
-        checkDiscoveryPermissions();
-        checkVoiceRecognition();
-        // initialize loopj async http client
-        mAsyncHttpClient = new MyAsyncHttpClient(this);
-        // Set the theme to one from preferences
-        Util.setActivityTheme(this);
-        mSettings = PreferenceManager.getDefaultSharedPreferences(this);
-        // Disable screen timeout if set in preferences
-        if (mSettings.getBoolean("default_openhab_screentimeroff", false)) {
-            getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
-        }
-        // Fetch openHAB service type name from strings.xml
-        openHABServiceType = getString(R.string.openhab_service_type);
-        // Get username/password from preferences
-        openHABUsername = mSettings.getString("default_openhab_username", null);
-        openHABPassword = mSettings.getString("default_openhab_password", null);
-        mAsyncHttpClient.setBasicAuth(openHABUsername, openHABPassword);
-        mAsyncHttpClient.addHeader("Accept", "application/xml");
-        mAsyncHttpClient.setTimeout(30000);
-        requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
-        requestWindowFeature(Window.FEATURE_PROGRESS);
-        setProgressBarIndeterminateVisibility(true);
-        if (!isDeveloper)
-            Util.initCrittercism(getApplicationContext(), "5117659f59e1bd4ba9000004");
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_main);
-        gcmRegisterBackground();
-        // Enable app icon in action bar work as 'home'
-//        this.getActionBar().setHomeButtonEnabled(true);
-        pager = (OpenHABViewPager)findViewById(R.id.pager);
-        pager.setScrollDurationFactor(2.5);
-        pager.setOffscreenPageLimit(1);
-        pagerAdapter = new OpenHABFragmentPagerAdapter(getSupportFragmentManager());
-        pagerAdapter.setColumnsNumber(getResources().getInteger(R.integer.pager_columns));
-        pagerAdapter.setOpenHABUsername(openHABUsername);
-        pagerAdapter.setOpenHABPassword(openHABPassword);
-        pager.setAdapter(pagerAdapter);
-        pager.setOnPageChangeListener(pagerAdapter);
-        MemorizingTrustManager.setResponder(this);
-//        pager.setPageMargin(1);
-//        pager.setPageMarginDrawable(android.R.color.darker_gray);
-        // Check if we have openHAB page url in saved instance state?
-        mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
-        mDrawerList = (ListView) findViewById(R.id.left_drawer);
-        mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.drawable.ic_navigation_drawer,
-                R.string.app_name, R.string.app_name) {
-            public void onDrawerClosed(View view) {
-                Log.d(TAG, "onDrawerClosed");
-            }
-            public void onDrawerOpened(View drawerView) {
-                Log.d(TAG, "onDrawerOpened");
-            }
-        };
-        mDrawerLayout.setDrawerListener(mDrawerToggle);
-        if (savedInstanceState != null) {
-            openHABBaseUrl = savedInstanceState.getString("openHABBaseUrl");
-            sitemapRootUrl = savedInstanceState.getString("sitemapRootUrl");
-        }
-        mSitemapList = new ArrayList<OpenHABSitemap>();
-        mDrawerAdapter = new OpenHABDrawerAdapter(this, R.layout.openhabdrawer_item, mSitemapList);
-        mDrawerAdapter.setOpenHABUsername(openHABUsername);
-        mDrawerAdapter.setOpenHABPassword(openHABPassword);
-        mDrawerList.setAdapter(mDrawerAdapter);
-        mDrawerList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
-            @Override
-            public void onItemClick(AdapterView<?> adapterView, View view, int item, long l) {
-                Log.d(TAG, "Drawer selected item " + String.valueOf(item));
-                if (mSitemapList != null) {
-                    Log.d(TAG, "This is sitemap " + mSitemapList.get(item).getLink());
-                    mDrawerLayout.closeDrawers();
-                    openSitemap(mSitemapList.get(item).getHomepageLink());
-                }
-            }
-        });
-//        mDrawerList.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, mDrawerTitles));
-        getActionBar().setDisplayHomeAsUpEnabled(true);
-        getActionBar().setHomeButtonEnabled(true);
-        if (getIntent() != null) {
-            Log.d(TAG, "Intent != null");
-            if (getIntent().getAction() != null) {
-                Log.d(TAG, "Intent action = " + getIntent().getAction());
-                if (getIntent().getAction().equals("android.nfc.action.NDEF_DISCOVERED")) {
-                    Log.d(TAG, "This is NFC action");
-                    if (getIntent().getDataString() != null) {
-
-
-
-
-                        Log.d(TAG, "NFC data = " + getIntent().getDataString());
-                        mNfcData = getIntent().getDataString();
-                    }
-                } else if (getIntent().getAction().equals("org.openhab.notification.selected")) {
-                    onNotificationSelected(getIntent());
-                }
-            }
-        }
-    }
-
-    @Override
-    protected void onPostCreate(Bundle savedInstanceState) {
-        super.onPostCreate(savedInstanceState);
-        // Sync the toggle state after onRestoreInstanceState has occurred.
-        mDrawerToggle.syncState();
-    }
-
-    @Override
-    public void onConfigurationChanged(Configuration newConfig) {
-        super.onConfigurationChanged(newConfig);
-        mDrawerToggle.onConfigurationChanged(newConfig);
-    }
-
-    @Override
-    public void onResume() {
-        Log.d(TAG, "onResume()");
-        super.onResume();
-        PendingIntent pendingIntent = PendingIntent.getActivity(
-                this, 0, new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0);
-        if (NfcAdapter.getDefaultAdapter(this) != null)
-            NfcAdapter.getDefaultAdapter(this).enableForegroundDispatch(this, pendingIntent, null, null);
-        if (!TextUtils.isEmpty(mNfcData)) {
-            Log.d(TAG, "We have NFC data from launch");
-        }
-        pagerAdapter.setColumnsNumber(getResources().getInteger(R.integer.pager_columns));
-        FragmentManager fm = getSupportFragmentManager();
-        stateFragment = (StateRetainFragment)fm.findFragmentByTag("stateFragment");
-        if (stateFragment == null) {
-            stateFragment = new StateRetainFragment();
-            fm.beginTransaction().add(stateFragment, "stateFragment").commit();
-            mOpenHABTracker = new OpenHABTracker(this, openHABServiceType, mServiceDiscoveryEnabled);
-            mOpenHABTracker.start();
-        } else {
-            Log.d(TAG, "State fragment found");
-            pagerAdapter.setFragmentList(stateFragment.getFragmentList());
-            Log.d(TAG, String.format("Loaded %d fragments", stateFragment.getFragmentList().size()));
-            pager.setCurrentItem(stateFragment.getCurrentPage());
-            Log.d(TAG, String.format("Loaded current page = %d", stateFragment.getCurrentPage()));
-        }
-        if (!TextUtils.isEmpty(mPendingNfcPage)) {
-            openNFCPageIfPending();
-        }
-    }
-
-    public void openNFCPageIfPending() {
-        int possiblePosition = pagerAdapter.getPositionByUrl(mPendingNfcPage);
-        // If yes, then just switch to this page
-        if (possiblePosition >= 0) {
-            pager.setCurrentItem(possiblePosition);
-            // If not, then open this page as new one
-        } else {
-            pagerAdapter.openPage(mPendingNfcPage);
-            pager.setCurrentItem(pagerAdapter.getCount()-1);
-        }
-        mPendingNfcPage = null;
-    }
-
-    public void onOpenHABTracked(String baseUrl, String message) {
-        if (message != null)
-        Toast.makeText(getApplicationContext(), message,
-                Toast.LENGTH_LONG).show();
-        openHABBaseUrl = baseUrl;
-        mDrawerAdapter.setOpenHABBaseUrl(openHABBaseUrl);
-        pagerAdapter.setOpenHABBaseUrl(openHABBaseUrl);
-        if (!TextUtils.isEmpty(mNfcData)) {
-            onNfcTag(mNfcData);
-            openNFCPageIfPending();
-        } else {
-            selectSitemap(baseUrl, false);
-        }
-    }
-
-    public void onError(String error) {
-        Toast.makeText(getApplicationContext(), error,
-                Toast.LENGTH_LONG).show();
-    }
-
-    public void onBonjourDiscoveryStarted() {
-        mProgressDialog = ProgressDialog.show(this, "",
-                getString(R.string.info_discovery), true);
-    }
-
-    public void onBonjourDiscoveryFinished() {
-        try {
-            mProgressDialog.dismiss();
-            mProgressDialog = null;
-        } catch (Exception e) {
-            // This is to catch "java.lang.IllegalArgumentException: View not attached to window manager"
-            // exception which happens if user quited app during discovery
-        }
-    }
-
-    /**
-     * Get sitemaps from openHAB, if user already configured preffered sitemap
-     * just open it. If no preffered sitemap is configured - let user select one.
-     *
-     * @param  baseUrl  an absolute base URL of openHAB to open
-     * @return      void
-     */
-
-    private void selectSitemap(final String baseUrl, final boolean forceSelect) {
-        Log.d(TAG, "Loading sitemap list from " + baseUrl + "rest/sitemaps");
-        startProgressIndicator();
-        mAsyncHttpClient.get(baseUrl + "rest/sitemaps", new DocumentHttpResponseHandler() {
-            @Override
-            public void onSuccess(Document document) {
-                stopProgressIndicator();
-                Log.d(TAG, "Response: " +  document.toString());
-                mSitemapList.clear();
-                mSitemapList.addAll(Util.parseSitemapList(document));
-                if (mSitemapList.size() == 0) {
-                    // Got an empty sitemap list!
-                    Log.e(TAG, "openHAB returned empty sitemap list");
-                    showAlertDialog(getString(R.string.error_empty_sitemap_list));
-                    return;
-                }
-                mDrawerAdapter.notifyDataSetChanged();
-                // If we are forced to do selection, just open selection dialog
-                if (forceSelect) {
-                    showSitemapSelectionDialog(mSitemapList);
-                } else {
-                    // Check if we have a sitemap configured to use
-                    SharedPreferences settings =
-                            PreferenceManager.getDefaultSharedPreferences(OpenHABMainActivity.this);
-                    String configuredSitemap = settings.getString("default_openhab_sitemap", "");
-                    // If we have sitemap configured
-                    if (configuredSitemap.length() > 0) {
-                        // Configured sitemap is on the list we got, open it!
-                        if (Util.sitemapExists(mSitemapList, configuredSitemap)) {
-                            Log.d(TAG, "Configured sitemap is on the list");
-                            OpenHABSitemap selectedSitemap = Util.getSitemapByName(mSitemapList, configuredSitemap);
-                            openSitemap(selectedSitemap.getHomepageLink());
-                            // Configured sitemap is not on the list we got!
-                        } else {
-                            Log.d(TAG, "Configured sitemap is not on the list");
-                            if (mSitemapList.size() == 1) {
-                                Log.d(TAG, "Got only one sitemap");
-                                SharedPreferences.Editor preferencesEditor = settings.edit();
-                                preferencesEditor.putString("default_openhab_sitemap", mSitemapList.get(0).getName());
-                                preferencesEditor.commit();
-                                openSitemap(mSitemapList.get(0).getHomepageLink());
-                            } else {
-                                Log.d(TAG, "Got multiply sitemaps, user have to select one");
-                                showSitemapSelectionDialog(mSitemapList);
-                            }
-                        }
-                        // No sitemap is configured to use
-                    } else {
-                        // We got only one single sitemap from openHAB, use it
-                        if (mSitemapList.size() == 1) {
-                            Log.d(TAG, "Got only one sitemap");
-                            SharedPreferences.Editor preferencesEditor = settings.edit();
-                            preferencesEditor.putString("default_openhab_sitemap", mSitemapList.get(0).getName());
-                            preferencesEditor.commit();
-                            openSitemap(mSitemapList.get(0).getHomepageLink());
-                        } else {
-                            Log.d(TAG, "Got multiply sitemaps, user have to select one");
-                            showSitemapSelectionDialog(mSitemapList);
-                        }
-                    }
-                }
-            }
-            @Override
-            public void onFailure(Throwable error, String content) {
-                stopProgressIndicator();
-                if (error instanceof HttpResponseException) {
-                    switch (((HttpResponseException) error).getStatusCode()) {
-                        case 401:
-                            showAlertDialog(getString(R.string.error_authentication_failed));
-                            break;
-                        default:
-                            Log.e(TAG, String.format("Http code = %d", ((HttpResponseException) error).getStatusCode()));
-                            break;
-                    }
-                } else if (error instanceof org.apache.http.conn.HttpHostConnectException) {
-                    Log.e(TAG, "Error connecting to host");
-                    if (error.getMessage() != null) {
-                        Log.e(TAG, error.getMessage());
-                        showAlertDialog(error.getMessage());
-                    } else {
-                        showAlertDialog(getString(R.string.error_connection_failed));
-                    }
-                } else if (error instanceof java.net.UnknownHostException) {
-                    Log.e(TAG, "Unable to resolve hostname");
-                    if (error.getMessage() != null) {
-                        Log.e(TAG, error.getMessage());
-                        showAlertDialog(error.getMessage());
-                    } else {
-                        showAlertDialog(getString(R.string.error_connection_failed));
-                    }
-                } else {
-                    Log.e(TAG, error.getClass().toString());
-                }
-            }
-        });
-
-    }
-
-    private void showSitemapSelectionDialog(final List<OpenHABSitemap> sitemapList) {
-        Log.d(TAG, "Opening sitemap selection dialog");
-        final List<String> sitemapNameList = new ArrayList<String>();;
-        for (int i=0; i<sitemapList.size(); i++) {
-            sitemapNameList.add(sitemapList.get(i).getName());
-        }
-        AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(OpenHABMainActivity.this);
-        dialogBuilder.setTitle(getString(R.string.mainmenu_openhab_selectsitemap));
-        try {
-            dialogBuilder.setItems(sitemapNameList.toArray(new CharSequence[sitemapNameList.size()]),
-                    new DialogInterface.OnClickListener() {
-                        public void onClick(DialogInterface dialog, int item) {
-                            Log.d(TAG, "Selected sitemap " + sitemapNameList.get(item));
-                            SharedPreferences settings =
-                                    PreferenceManager.getDefaultSharedPreferences(OpenHABMainActivity.this);
-                            SharedPreferences.Editor preferencesEditor = settings.edit();
-                            preferencesEditor.putString("default_openhab_sitemap", sitemapList.get(item).getName());
-                            preferencesEditor.commit();
-                            openSitemap(sitemapList.get(item).getHomepageLink());
-                        }
-                    }).show();
-        } catch (WindowManager.BadTokenException e) {
-            Crittercism.logHandledException(e);
-        }
-    }
-
-    private void openSitemap(String sitemapUrl) {
-        Log.i(TAG, "Opening sitemap at " + sitemapUrl);
-        sitemapRootUrl = sitemapUrl;
-        pagerAdapter.clearFragmentList();
-        pagerAdapter.openPage(sitemapRootUrl);
-        pager.setCurrentItem(0);
-    }
-
-    @Override
-    public boolean onCreateOptionsMenu(Menu menu) {
-        MenuInflater inflater = getMenuInflater();
-        inflater.inflate(R.menu.main_menu, menu);
-        return true;
-    }
-
-    @Override
-    public boolean onPrepareOptionsMenu(Menu menu) {
-        menu.findItem(R.id.mainmenu_voice_recognition).setVisible(mVoiceRecognitionEnabled);
-        return true;
-    }
-
-    @Override
-    public boolean onOptionsItemSelected(MenuItem item) {
-        switch (item.getItemId()) {
-            case R.id.mainmenu_openhab_preferences:
-                Intent settingsIntent = new Intent(this.getApplicationContext(), OpenHABPreferencesActivity.class);
-                startActivityForResult(settingsIntent, SETTINGS_REQUEST_CODE);
-                Util.overridePendingTransition(this, false);
-                return true;
-            case R.id.mainmenu_openhab_selectsitemap:
-                SharedPreferences settings =
-                        PreferenceManager.getDefaultSharedPreferences(OpenHABMainActivity.this);
-                SharedPreferences.Editor preferencesEditor = settings.edit();
-                preferencesEditor.putString("default_openhab_sitemap", "");
-                preferencesEditor.commit();
-                selectSitemap(openHABBaseUrl, true);
-                return true;
-            case android.R.id.home:
-                Log.d(TAG, "Home selected");
-                if (pager.getCurrentItem() > 0) {
-                    pager.setCurrentItem(0);
-                }
-                return true;
-            case R.id.mainmenu_openhab_clearcache:
-                Log.d(TAG, "Restarting");
-                // Get launch intent for application
-                Intent restartIntent = getBaseContext().getPackageManager()
-                        .getLaunchIntentForPackage( getBaseContext().getPackageName() );
-                restartIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
-                // Finish current activity
-                finish();
-                WebImageCache cache = new WebImageCache(getBaseContext());
-                cache.clear();
-                // Start launch activity
-                startActivity(restartIntent);
-                // Start launch activity
-                return true;
-            case R.id.mainmenu_openhab_writetag:
-                Intent writeTagIntent = new Intent(this.getApplicationContext(), OpenHABWriteTagActivity.class);
-                // TODO: get current display page url, which? how? :-/
-                OpenHABWidgetListFragment currentFragment = pagerAdapter.getFragment(pager.getCurrentItem());
-                if (currentFragment != null) {
-                    writeTagIntent.putExtra("sitemapPage", currentFragment.getDisplayPageUrl());
-                    startActivityForResult(writeTagIntent, WRITE_NFC_TAG_REQUEST_CODE);
-                    Util.overridePendingTransition(this, false);
-                }
-                return true;
-            case R.id.mainmenu_openhab_info:
-                Intent infoIntent = new Intent(this.getApplicationContext(), OpenHABInfoActivity.class);
-                infoIntent.putExtra("openHABBaseUrl", openHABBaseUrl);
-                infoIntent.putExtra("username", openHABUsername);
-                infoIntent.putExtra("password", openHABPassword);
-                startActivityForResult(infoIntent, INFO_REQUEST_CODE);
-                Util.overridePendingTransition(this, false);
-                return true;
-            case R.id.mainmenu_voice_recognition:
-                launchVoiceRecognition();
-                return true;
-            default:
-                return super.onOptionsItemSelected(item);
-        }
-    }
-
-    @Override
-    public void onActivityResult(int requestCode, int resultCode, Intent data) {
-        Log.d(TAG, String.format("onActivityResult requestCode = %d, resultCode = %d", requestCode, resultCode));
-        switch (requestCode) {
-            case SETTINGS_REQUEST_CODE:
-                // Restart app after preferences
-                Log.d(TAG, "Restarting after settings");
-                // Get launch intent for application
-                Intent restartIntent = getBaseContext().getPackageManager()
-                        .getLaunchIntentForPackage( getBaseContext().getPackageName() );
-                restartIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
-                // Finish current activity
-                finish();
-                // Start launch activity
-                startActivity(restartIntent);
-                break;
-            case WRITE_NFC_TAG_REQUEST_CODE:
-                Log.d(TAG, "Got back from Write NFC tag");
-                break;
-            case VOICE_RECOGNITION_REQUEST_CODE:
-                Log.d(TAG, "Got back from Voice recognition");
-                setProgressBarIndeterminateVisibility(false);
-                if(resultCode == RESULT_OK) {
-                    ArrayList<String> textMatchList = data
-                            .getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
-                    if (!textMatchList.isEmpty()) {
-                        Log.d(TAG, textMatchList.get(0));
-                        Log.d(TAG, "Recognized text: " + textMatchList.get(0));
-                        Toast.makeText(this, "I recognized: " + textMatchList.get(0),
-                                Toast.LENGTH_LONG).show();
-                        sendItemCommand("VoiceCommand", textMatchList.get(0));
-                    } else {
-                        Log.d(TAG, "Voice recognition returned empty set");
-                        Toast.makeText(this, "I can't read you!",
-                                Toast.LENGTH_LONG).show();
-                    }
-                } else {
-                    Log.d(TAG, "A voice recognition error occured");
-                    Toast.makeText(this, "A voice recognition error occured",
-                            Toast.LENGTH_LONG).show();
-                }
-                break;
-            default:
-        }
-    }
-
-    @Override
-    public void onSaveInstanceState(Bundle savedInstanceState) {
-        Log.d(TAG, "onSaveInstanceState");
-
-        // Save UI state changes to the savedInstanceState.
-        // This bundle will be passed to onCreate if the process is
-        // killed and restarted.
-        savedInstanceState.putString("openHABBaseUrl", openHABBaseUrl);
-        savedInstanceState.putString("sitemapRootUrl", sitemapRootUrl);
-        savedInstanceState.putInt("currentFragment", pager.getCurrentItem());
-        super.onSaveInstanceState(savedInstanceState);
-    }
-
-    /**
-     * Overriding onStart to enable Google Analytics stats collection
-     */
-    @Override
-    public void onStart() {
-        super.onStart();
-        // Start activity tracking via Google Analytics
-        if (!isDeveloper)
-            EasyTracker.getInstance().activityStart(this);
-    }
-
-    /**
-     * Overriding onStop to enable Google Analytics stats collection
-     */
-    @Override
-    public void onStop() {
-        Log.d(TAG, "onStop()");
-        super.onStop();
-        // Stop activity tracking via Google Analytics
-        if (!isDeveloper)
-            EasyTracker.getInstance().activityStop(this);
-        if (mOpenHABTracker != null)
-            mOpenHABTracker.stop();
-    }
-
-    @Override
-    public void onPause() {
-        Log.d(TAG, "onPause()");
-        super.onPause();
-        Log.d(TAG, String.format("Saving %d fragments", pagerAdapter.getFragmentList().size()));
-        Log.d(TAG, String.format("Saving current page = %d", pager.getCurrentItem()));
-        stateFragment.setFragmentList(pagerAdapter.getFragmentList());
-        stateFragment.setCurrentPage(pager.getCurrentItem());
-//        Runnable can = new Runnable() {
-//            public void run() {
-//                mAsyncHttpClient.cancelRequests(OpenHABMainActivity.this, true);
-//            }
-//        };
-//        new Thread(can).start();
-    }
-
-    /**
-     * This method is called when activity receives a new intent while running
-     */
-    @Override
-    public void onNewIntent(Intent newIntent) {
-        if (newIntent.getAction() != null) {
-            Log.d(TAG, "New intent received = " + newIntent.getAction());
-            if (newIntent.getAction().equals("android.nfc.action.NDEF_DISCOVERED")) {
-                Log.d(TAG, "This is NFC action");
-                if (newIntent.getDataString() != null) {
-                    Log.d(TAG, "Action data = " + newIntent.getDataString());
-                    onNfcTag(newIntent.getDataString());
-                }
-            } else if (newIntent.getAction().equals("org.openhab.notification.selected")) {
-                onNotificationSelected(newIntent);
-            }
-        }
-    }
-
-    private void onNotificationSelected(Intent intent) {
-        Log.d(TAG, "Notification was selected");
-        if (intent.hasExtra("notificationId")) {
-            Log.d(TAG, String.format("Notification id = %d",
-                    intent.getExtras().getInt("notificationId")));
-            // Make a fake broadcast intent to hide intent on other devices
-            Intent deleteIntent = new Intent(this, NotificationDeletedBroadcastReceiver.class);
-            deleteIntent.setAction("org.openhab.notification.deleted");
-            deleteIntent.putExtra("notificationId", intent.getExtras().getInt("notificationId"));
-            sendBroadcast(deleteIntent);
-        }
-    }
-
-    /**
-     * This method processes new intents generated by NFC subsystem
-     * @param nfcData - a data which NFC subsystem got from the NFC tag
-     */
-    public void onNfcTag(String nfcData) {
-        Log.d(TAG, "onNfcTag()");
-        Uri openHABURI = Uri.parse(nfcData);
-        Log.d(TAG, "NFC Scheme = " + openHABURI.getScheme());
-        Log.d(TAG, "NFC Host = " + openHABURI.getHost());
-        Log.d(TAG, "NFC Path = " + openHABURI.getPath());
-        String nfcItem = openHABURI.getQueryParameter("item");
-        String nfcCommand = openHABURI.getQueryParameter("command");
-        String nfcItemType = openHABURI.getQueryParameter("itemType");
-        // If there is no item parameter it means tag contains only sitemap page url
-        if (TextUtils.isEmpty(nfcItem)) {
-            Log.d(TAG, "This is a sitemap tag without parameters");
-            // Form the new sitemap page url
-            String newPageUrl = openHABBaseUrl + "rest/sitemaps" + openHABURI.getPath();
-            // Check if we have this page in stack?
-            mPendingNfcPage = newPageUrl;
-        } else {
-            Log.d(TAG, "Target item = " + nfcItem);
-            sendItemCommand(nfcItem, nfcCommand);
-            // if mNfcData is not empty, this means we were launched with NFC touch
-            // and thus need to autoexit after an item action
-            if (!TextUtils.isEmpty(mNfcData))
-                finish();
-        }
-        mNfcData = "";
-    }
-
-    public void sendItemCommand(String itemName, String command) {
-        try {
-            StringEntity se = new StringEntity(command, "UTF-8");
-            mAsyncHttpClient.post(this, openHABBaseUrl + "rest/items/" + itemName, se, "text/plain;charset=UTF-8", new AsyncHttpResponseHandler() {
-                @Override
-                public void onSuccess(String response) {
-                    Log.d(TAG, "Command was sent successfully");
-                }
-                @Override
-                public void onFailure(Throwable error, String errorResponse) {
-                    Log.e(TAG, "Got command error " + error.getMessage());
-                    if (errorResponse != null)
-                        Log.e(TAG, "Error response = " + errorResponse);
-                }
-            });
-        } catch (UnsupportedEncodingException e) {
-            if (e.getMessage() != null)
-                Log.e(TAG, e.getMessage());
-        }
-    }
-
-    public void onWidgetSelectedListener(OpenHABLinkedPage linkedPage, OpenHABWidgetListFragment source) {
-        Log.i(TAG, "Got widget link = " + linkedPage.getLink());
-        Log.i(TAG, String.format("Link came from fragment on position %d", source.getPosition()));
-        pagerAdapter.openPage(linkedPage.getLink(), source.getPosition() + 1);
-        pager.setCurrentItem(pagerAdapter.getCount()-1);
-        setTitle(linkedPage.getTitle());
-    }
-
-    @Override
-    public void onBackPressed() {
-        Log.d(TAG, String.format("onBackPressed() I'm at the %d page", pager.getCurrentItem()));
-        if (pager.getCurrentItem() == 0) {
-            super.onBackPressed();
-        } else {
-            pager.setCurrentItem(pager.getCurrentItem() - 1, true);
-            setTitle(pagerAdapter.getPageTitle(pager.getCurrentItem()));
-        }
-    }
-
-    public void startProgressIndicator() {
-        setProgressBarIndeterminateVisibility(true);
-    }
-
-    public void stopProgressIndicator() {
-        setProgressBarIndeterminateVisibility(false);
-    }
-
-    private void launchVoiceRecognition() {
-        Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
-        // Specify the calling package to identify your application
-        intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, getClass().getPackage().getName());
-        // Display an hint to the user about what he should say.
-        intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "openHAB, at your command!");
-        intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
-        intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 1);
-        startActivityForResult(intent, VOICE_RECOGNITION_REQUEST_CODE);
-    }
-
-
-    private void showAlertDialog(String alertMessage) {
-        if (this.isFinishing())
-            return;
-        AlertDialog.Builder builder = new AlertDialog.Builder(OpenHABMainActivity.this);
-        builder.setMessage(alertMessage)
-                .setPositiveButton("OK", new DialogInterface.OnClickListener() {
-                    public void onClick(DialogInterface dialog, int id) {
-                    }
-                });
-        AlertDialog alert = builder.create();
-        alert.show();
-    }
-
-    private void showCertificateDialog(final int decisionId, String certMessage) {
-        if (this.isFinishing())
-            return;
-        AlertDialog.Builder builder = new AlertDialog.Builder(OpenHABMainActivity.this);
-        builder.setMessage(certMessage)
-                .setTitle(R.string.mtm_accept_cert);
-        builder.setPositiveButton(R.string.mtm_decision_always, new DialogInterface.OnClickListener() {
-            public void onClick(DialogInterface dialogInterface, int i) {
-                Log.d(TAG, "User decided to always accept unknown certificate");
-//                MemorizingTrustManager.interactResult(decisionId, MTMDecision.DECISION_ALWAYS);
-                sendMTMDecision(decisionId, MTMDecision.DECISION_ALWAYS);
-            }
-        });
-        builder.setNeutralButton(R.string.mtm_decision_once, new DialogInterface.OnClickListener() {
-            public void onClick(DialogInterface dialogInterface, int i) {
-                Log.d(TAG, "User decided to accept unknown certificate once");
-//                MemorizingTrustManager.interactResult(decisionId, MTMDecision.DECISION_ONCE);
-                sendMTMDecision(decisionId, MTMDecision.DECISION_ONCE);
-            }
-        });
-        builder.setNegativeButton(R.string.mtm_decision_abort, new DialogInterface.OnClickListener() {
-            public void onClick(DialogInterface dialogInterface, int i) {
-                Log.d(TAG, "User decided to abort unknown certificate");
-//                MemorizingTrustManager.interactResult(decisionId, MTMDecision.DECISION_ABORT);
-                sendMTMDecision(decisionId, MTMDecision.DECISION_ABORT);
-            }
-        });
-        AlertDialog certAlert = builder.create();
-        certAlert.show();
-    }
-
-    void sendMTMDecision(int decisionId, int decision) {
-        Log.d(TAG, "Sending decision to MTM");
-        Intent i = new Intent(MemorizingTrustManager.DECISION_INTENT + "/" + getPackageName());
-        i.putExtra(MemorizingTrustManager.DECISION_INTENT_ID, decisionId);
-        i.putExtra(MemorizingTrustManager.DECISION_INTENT_CHOICE, decision);
-        sendBroadcast(i);
-    }
-
-
-    public void checkVoiceRecognition() {
-        // Check if voice recognition is present
-        PackageManager pm = getPackageManager();
-        List<ResolveInfo> activities = pm.queryIntentActivities(new Intent(
-                RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0);
-        if (activities.size() == 0) {
-//            speakButton.setEnabled(false);
-//            speakButton.setText("Voice recognizer not present");
-            Toast.makeText(this, "Voice recognizer not present, voice recognition disabled",
-                    Toast.LENGTH_SHORT).show();
-        } else {
-            mVoiceRecognitionEnabled = true;
-        }
-    }
-
-    public void checkDiscoveryPermissions() {
-        // Check if we got all needed permissions
-        PackageManager pm = getPackageManager();
-        if (!(pm.checkPermission(Manifest.permission.CHANGE_WIFI_MULTICAST_STATE, getPackageName()) == PackageManager.PERMISSION_GRANTED)) {
-            showAlertDialog(getString(R.string.erorr_no_wifi_mcast_permission));
-            mServiceDiscoveryEnabled = false;
-        }
-        if (!(pm.checkPermission(Manifest.permission.ACCESS_WIFI_STATE, getPackageName()) == PackageManager.PERMISSION_GRANTED)) {
-            showAlertDialog(getString(R.string.erorr_no_wifi_state_permission));
-            mServiceDiscoveryEnabled = false;
-        }
-
-    }
-
-    public void makeDecision(int decisionId, String certMessage) {
-        Log.d(TAG, String.format("MTM is asking for decision on id = %d", decisionId));
-        if (mSettings.getBoolean("default_openhab_sslcert", false))
-            MemorizingTrustManager.interactResult(decisionId, MTMDecision.DECISION_ONCE);
-        else
-            showCertificateDialog(decisionId, certMessage);
-    }
-
-    public String getOpenHABBaseUrl() {
-        return openHABBaseUrl;
-    }
-
-    public void setOpenHABBaseUrl(String openHABBaseUrl) {
-        this.openHABBaseUrl = openHABBaseUrl;
-    }
-
-    public String getOpenHABUsername() {
-        return openHABUsername;
-    }
-
-    public void setOpenHABUsername(String openHABUsername) {
-        this.openHABUsername = openHABUsername;
-    }
-
-    public String getOpenHABPassword() {
-        return openHABPassword;
-    }
-
-    public void setOpenHABPassword(String openHABPassword) {
-        this.openHABPassword = openHABPassword;
-    }
-
-    public static MyAsyncHttpClient getAsyncHttpClient() {
-        return mAsyncHttpClient;
-    }
-
-    private void gcmRegisterBackground() {
-        // We need settings
-        if (mSettings == null)
-            return;
-        // We need remote URL
-        String remoteUrl = mSettings.getString("default_openhab_alturl", null);
-        if (TextUtils.isEmpty(remoteUrl))
-            return;
-        // We need it to be my.oh
-        if (!remoteUrl.toLowerCase().startsWith("https://my.openhab.org"))
-            return;
-        // Finally, all sanity is done
-        Crittercism.setUsername(openHABUsername);
-        if (mGcm == null)
-            mGcm = GoogleCloudMessaging.getInstance(getApplicationContext());
-        new AsyncTask<Void, Void, String>() {
-            @Override
-            protected String doInBackground(Void... params) {
-                String regId = null;
-                try {
-                    regId = mGcm.register(GCM_SENDER_ID);
-                    String deviceModel = URLEncoder.encode(Build.MODEL, "UTF-8");
-                    String deviceId = Settings.Secure.getString(getContentResolver(),Settings.Secure.ANDROID_ID);
-                    String regUrl = "https://my.openhab.org/addAndroidRegistration?deviceId=" + deviceId +
-                            "&deviceModel=" + deviceModel + "&regId=" + regId;
-                    mAsyncHttpClient.get(getApplicationContext(), regUrl, new AsyncHttpResponseHandler() {
-                        @Override
-                        public void onSuccess(String response) {
-                            Log.d(TAG, "GCM reg id success");
-                        }
-                        @Override
-                        public void onFailure(Throwable error, String errorResponse) {
-                            Log.e(TAG, "GCM reg id error: " + error.getMessage());
-                            if (errorResponse != null)
-                                Log.e(TAG, "Error response = " + errorResponse);
-                        }
-                    });
-                } catch (IOException e) {
-                    e.printStackTrace();
-                    Log.e(TAG, e.getMessage());
-                }
-                return regId;
-            }
-            @Override
-            protected void onPostExecute(String regId) {
-            }
-        }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,null, null, null);
-    }
-}
diff --git a/src/org/openhab/habdroid/ui/OpenHABPreferencesActivity.java b/src/org/openhab/habdroid/ui/OpenHABPreferencesActivity.java
deleted file mode 100644
index 21267f6cb8bc6a094bec49afeef25dce421372fb..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/ui/OpenHABPreferencesActivity.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.ui;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.openhab.habdroid.R;
-import org.openhab.habdroid.util.Util;
-
-import com.google.analytics.tracking.android.EasyTracker;
-
-import android.preference.ListPreference;
-import android.preference.Preference;
-import android.preference.Preference.OnPreferenceChangeListener;
-import android.preference.PreferenceActivity;
-import android.util.Log;
-import android.app.AlertDialog;
-import android.content.DialogInterface;
-import android.os.Bundle;
-
-/**
- * This is a class to provide preferences activity for application.
- */
-
-public class OpenHABPreferencesActivity extends PreferenceActivity {
-	@SuppressWarnings("deprecation")
-
-	@Override
-	public void onStart() {
-		super.onStart();
-		EasyTracker.getInstance().activityStart(this);
-	}
-	
-	@Override
-	public void onStop() {
-		super.onStop();
-		EasyTracker.getInstance().activityStop(this);
-	}
-
-	@Override
-	public void onCreate(Bundle savedInstanceState) {
-		Util.setActivityTheme(this);
-	    super.onCreate(savedInstanceState);
-	    addPreferencesFromResource(R.xml.preferences);
-	    Preference urlPreference = getPreferenceScreen().findPreference("default_openhab_url");
-	    Preference altUrlPreference = getPreferenceScreen().findPreference("default_openhab_alturl");
-	    Preference usernamePreference = getPreferenceScreen().findPreference("default_openhab_username");
-	    Preference passwordPreference = getPreferenceScreen().findPreference("default_openhab_password");
-	    ListPreference themePreference = (ListPreference)getPreferenceScreen().findPreference("default_openhab_theme");
-	    ListPreference animationPreference = (ListPreference)getPreferenceScreen().findPreference("default_openhab_animation");
-	    Preference versionPreference = getPreferenceScreen().findPreference("default_openhab_appversion");
-	    urlPreference.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
-			@Override
-			public boolean onPreferenceChange(Preference preference, Object newValue) {
-				Log.d("OpenHABPreferencesActivity", "Validating new url = " + (String)newValue);
-				String newUrl = (String)newValue;
-				if (newUrl.length() == 0 || urlIsValid(newUrl)) {
-					updateTextPreferenceSummary(preference, (String)newValue);
-					return true;
-				}
-				showAlertDialog(getString(R.string.erorr_invalid_url));
-				return false;
-			}
-	    });
-	    updateTextPreferenceSummary(urlPreference, null);
-	    altUrlPreference.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
-			@Override
-			public boolean onPreferenceChange(Preference preference, Object newValue) {
-				String newUrl = (String)newValue;
-				if (newUrl.length() == 0 || urlIsValid(newUrl)) {
-					updateTextPreferenceSummary(preference, (String)newValue);
-					return true;
-				}
-				showAlertDialog(getString(R.string.erorr_invalid_url));
-				return false;
-			}
-	    });
-	    updateTextPreferenceSummary(altUrlPreference, null);
-	    usernamePreference.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
-			@Override
-			public boolean onPreferenceChange(Preference preference, Object newValue) {
-				updateTextPreferenceSummary(preference, (String)newValue);
-				return true;
-			}
-	    });
-	    updateTextPreferenceSummary(usernamePreference, null);
-	    passwordPreference.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
-			@Override
-			public boolean onPreferenceChange(Preference preference, Object newValue) {
-				updatePasswordPreferenceSummary(preference, (String)newValue);
-				return true;
-			}
-	    });
-	    updatePasswordPreferenceSummary(passwordPreference, null);
-	    themePreference.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
-			@Override
-			public boolean onPreferenceChange(Preference preference, Object newValue) {
-				ListPreference listPreference = (ListPreference)preference;
-				listPreference.setSummary(listPreference.getEntries()[listPreference.findIndexOfValue((String)newValue)]);
-				return true;
-			}
-	    });
-	    themePreference.setSummary(themePreference.getEntry());
-	    animationPreference.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
-			@Override
-			public boolean onPreferenceChange(Preference preference, Object newValue) {
-				ListPreference listPreference = (ListPreference)preference;
-				listPreference.setSummary(listPreference.getEntries()[listPreference.findIndexOfValue((String)newValue)]);
-				return true;
-			}
-	    });
-	    animationPreference.setSummary(animationPreference.getEntry());
-	    updateTextPreferenceSummary(versionPreference, null);
-	    setResult(RESULT_OK);
-	}
-	
-	private void updateTextPreferenceSummary(Preference textPreference, String newValue) {
-		if (newValue == null) {
-			if (textPreference.getSharedPreferences().getString(textPreference.getKey(), "").length() > 0)
-		    	textPreference.setSummary(textPreference.getSharedPreferences().getString(textPreference.getKey(), ""));
-		    else
-		    	textPreference.setSummary(this.getResources().getString(R.string.info_not_set));
-		} else {
-			if (newValue.length() > 0)
-				textPreference.setSummary(newValue);
-			else
-				textPreference.setSummary(this.getResources().getString(R.string.info_not_set));
-		}
-	}
-	
-	private void updatePasswordPreferenceSummary(Preference passwordPreference, String newValue) {
-		if (newValue == null) {
-			if (passwordPreference.getSharedPreferences().getString(passwordPreference.getKey(), "").length() > 0)
-				passwordPreference.setSummary("******");
-			else
-				passwordPreference.setSummary(this.getResources().getString(R.string.info_not_set));
-		} else {
-			if (newValue.length() > 0)
-				passwordPreference.setSummary("******");
-			else
-				passwordPreference.setSummary(this.getResources().getString(R.string.info_not_set));
-		}
-	}
-	
-	private boolean urlIsValid(String url) {
-		// As we accept an empty URL, which means it is not configured, length==0 is ok
-		if (url.length() == 0)
-			return true;
-		if (url.contains("\n") || url.contains(" "))
-			return false;
-		try {
-			URL testURL = new URL(url);
-		} catch (MalformedURLException e) {
-			return false;
-		}
-		return true;
-	}
-		
-	private void showAlertDialog(String alertMessage) {
-		AlertDialog.Builder builder = new AlertDialog.Builder(OpenHABPreferencesActivity.this);
-		builder.setMessage(alertMessage)
-			.setPositiveButton("OK", new DialogInterface.OnClickListener() {
-				public void onClick(DialogInterface dialog, int id) {
-				}
-		});
-		AlertDialog alert = builder.create();
-		alert.show();		
-	}
-	
-	@Override
-	public void finish() {
-		super.finish();
-		Util.overridePendingTransition(this, true);		
-	}
-}
diff --git a/src/org/openhab/habdroid/ui/OpenHABViewPager.java b/src/org/openhab/habdroid/ui/OpenHABViewPager.java
deleted file mode 100644
index c202e2f1348ef58bac37aacce4b03b1cf9850703..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/ui/OpenHABViewPager.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.ui;
-
-import android.content.Context;
-import android.support.v4.view.ViewPager;
-import android.util.AttributeSet;
-import android.view.MotionEvent;
-import android.view.View;
-import android.view.animation.Interpolator;
-
-import java.lang.reflect.Field;
-
-public class OpenHABViewPager extends ViewPager {
-
-    // Disable page swiping by default
-    private boolean mSwipeEnabled = false;
-    // A custom scroller to lower the scroll speed a little bit
-    private ScrollerCustomDuration mScroller = null;
-
-    public OpenHABViewPager(Context context) {
-        super(context);
-        postInitViewPager();
-    }
-
-    public OpenHABViewPager(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        postInitViewPager();
-    }
-
-    /**
-     * Override the Scroller instance with our own class so we can change the
-     * duration
-     */
-
-    private void postInitViewPager() {
-        try {
-            Class<?> viewpager = ViewPager.class;
-            Field scroller = viewpager.getDeclaredField("mScroller");
-            scroller.setAccessible(true);
-            Field interpolator = viewpager.getDeclaredField("sInterpolator");
-            interpolator.setAccessible(true);
-
-            mScroller = new ScrollerCustomDuration(getContext(),
-                    (Interpolator) interpolator.get(null));
-            scroller.set(this, mScroller);
-        } catch (Exception e) {
-        }
-    }
-
-    /**
-     * Set the factor by which the duration will change
-     */
-    public void setScrollDurationFactor(double scrollFactor) {
-        mScroller.setScrollDurationFactor(scrollFactor);
-    }
-
-    /*
-        onTouchEvent and onInterceptTouchEvent are needed to prevent swiping
-        sitemap pages (OpenHABWidgetListFragments) to keep navigation as usual
-        (press item to drill down, press 'back' to get to previous page)
-     */
-
-    @Override
-    public boolean onTouchEvent(MotionEvent event) {
-        if (this.mSwipeEnabled) {
-            return super.onTouchEvent(event);
-        }
-
-        return false;
-    }
-
-    @Override
-    public boolean onInterceptTouchEvent(MotionEvent event) {
-        if (this.mSwipeEnabled) {
-            return super.onInterceptTouchEvent(event);
-        }
-
-        return false;
-    }
-
-    /*
-        For flexibility or future use you can enable swiping pages (disabled by default)
-     */
-
-    public void setSwipeEnabled(boolean swipe) {
-        mSwipeEnabled = swipe;
-    }
-}
diff --git a/src/org/openhab/habdroid/ui/OpenHABWidgetAdapter.java b/src/org/openhab/habdroid/ui/OpenHABWidgetAdapter.java
deleted file mode 100644
index ce9d6c3acfd4b59daf91abcd3226e72847a6cffd..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/ui/OpenHABWidgetAdapter.java
+++ /dev/null
@@ -1,835 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.ui;
-
-import java.io.UnsupportedEncodingException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Random;
-
-import org.apache.http.entity.StringEntity;
-import org.openhab.habdroid.R;
-import org.openhab.habdroid.model.OpenHABItem;
-import org.openhab.habdroid.model.OpenHABWidget;
-import org.openhab.habdroid.model.OpenHABWidgetMapping;
-import org.openhab.habdroid.ui.widget.ColorPickerDialog;
-import org.openhab.habdroid.ui.widget.OnColorChangedListener;
-import org.openhab.habdroid.util.MjpegStreamer;
-import org.openhab.habdroid.util.MyAsyncHttpClient;
-import org.openhab.habdroid.util.MySmartImageView;
-import android.content.Context;
-import android.net.Uri;
-import android.text.TextUtils;
-import android.util.Log;
-import android.view.LayoutInflater;
-import android.view.MotionEvent;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.view.View.OnTouchListener;
-import android.view.ViewGroup;
-import android.view.WindowManager;
-import android.webkit.WebView;
-import android.webkit.WebViewClient;
-import android.widget.AdapterView;
-import android.widget.AdapterView.OnItemSelectedListener;
-import android.widget.ArrayAdapter;
-import android.widget.Button;
-import android.widget.ImageButton;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.RadioGroup;
-import android.widget.RadioGroup.OnCheckedChangeListener;
-import android.widget.RelativeLayout;
-import android.widget.SeekBar;
-import android.widget.SeekBar.OnSeekBarChangeListener;
-import android.widget.Spinner;
-import android.widget.Switch;
-import android.widget.TextView;
-import android.widget.VideoView;
-import org.openhab.habdroid.ui.widget.SegmentedControlButton;
-
-import com.crittercism.app.Crittercism;
-import com.loopj.android.http.AsyncHttpResponseHandler;
-
-/**
- * This class provides openHAB widgets adapter for list view.
- */
-
-public class OpenHABWidgetAdapter extends ArrayAdapter<OpenHABWidget> {
-	public static final int TYPE_GENERICITEM = 0;
-	public static final int TYPE_FRAME = 1;
-	public static final int TYPE_GROUP = 2;
-	public static final int TYPE_SWITCH = 3;
-	public static final int TYPE_TEXT = 4;
-	public static final int TYPE_SLIDER = 5;
-	public static final int TYPE_IMAGE = 6;
-	public static final int TYPE_SELECTION = 7;
-	public static final int TYPE_SECTIONSWITCH = 8;
-	public static final int TYPE_ROLLERSHUTTER = 9;
-	public static final int TYPE_SETPOINT = 10;
-	public static final int TYPE_CHART = 11;
-	public static final int TYPE_VIDEO = 12;
-	public static final int TYPE_WEB = 13;
-	public static final int TYPE_COLOR = 14;
-    public static final int TYPE_VIDEO_MJPEG = 15;
-	public static final int TYPES_COUNT = 16;
-	private static final String TAG = "OpenHABWidgetAdapter";
-	private String openHABBaseUrl = "http://demo.openhab.org:8080/";
-	private String openHABUsername = "";
-	private String openHABPassword = "";
-	private ArrayList<VideoView> videoWidgetList;
-	private ArrayList<MySmartImageView> refreshImageList;
-    private ArrayList<MjpegStreamer> mjpegWidgetList;
-    private MyAsyncHttpClient mAsyncHttpClient;
-
-	public OpenHABWidgetAdapter(Context context, int resource,
-			List<OpenHABWidget> objects) {
-		super(context, resource, objects);
-		// Initialize video view array
-		videoWidgetList = new ArrayList<VideoView>();
-		refreshImageList = new ArrayList<MySmartImageView>();
-        mjpegWidgetList = new ArrayList<MjpegStreamer>();
-	}
-
-    @SuppressWarnings("deprecation")
-	@Override
-    public View getView(int position, View convertView, ViewGroup parent) {
-    	/* TODO: This definitely needs some huge refactoring */
-    	final RelativeLayout widgetView;
-		TextView labelTextView;
-		TextView valueTextView;
-    	int widgetLayout;
-    	String[] splitString;
-    	OpenHABWidget openHABWidget = getItem(position);
-    	int screenWidth = ((WindowManager)getContext().getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getWidth();
-    	switch (this.getItemViewType(position)) {
-    	case TYPE_FRAME:
-    		widgetLayout = R.layout.openhabwidgetlist_frameitem;
-    		break;
-    	case TYPE_GROUP:
-    		widgetLayout = R.layout.openhabwidgetlist_groupitem;
-    		break;
-    	case TYPE_SECTIONSWITCH:
-    		widgetLayout = R.layout.openhabwidgetlist_sectionswitchitem;
-    		break;
-    	case TYPE_SWITCH:
-    		widgetLayout = R.layout.openhabwidgetlist_switchitem;
-    		break;
-    	case TYPE_ROLLERSHUTTER:
-    		widgetLayout = R.layout.openhabwidgetlist_rollershutteritem;
-    		break;
-    	case TYPE_TEXT:
-    		widgetLayout = R.layout.openhabwidgetlist_textitem;
-    		break;
-    	case TYPE_SLIDER:
-    		widgetLayout = R.layout.openhabwidgetlist_slideritem;
-    		break;
-    	case TYPE_IMAGE:
-    		widgetLayout = R.layout.openhabwidgetlist_imageitem;
-    		break;
-    	case TYPE_SELECTION:
-    		widgetLayout = R.layout.openhabwidgetlist_selectionitem;
-    		break;
-    	case TYPE_SETPOINT:
-    		widgetLayout = R.layout.openhabwidgetlist_setpointitem;
-    		break;
-    	case TYPE_CHART:
-    		widgetLayout = R.layout.openhabwidgetlist_chartitem;
-    		break;
-    	case TYPE_VIDEO:
-    		widgetLayout = R.layout.openhabwidgetlist_videoitem;
-    		break;
-        case TYPE_VIDEO_MJPEG:
-            widgetLayout = R.layout.openhabwidgetlist_videomjpegitem;
-            break;
-    	case TYPE_WEB:
-    		widgetLayout = R.layout.openhabwidgetlist_webitem;
-    		break;
-    	case TYPE_COLOR:
-    		widgetLayout = R.layout.openhabwidgetlist_coloritem;
-    		break;
-    	default:
-    		widgetLayout = R.layout.openhabwidgetlist_genericitem;
-    		break;
-    	}
-    	if (convertView == null) {
-    		widgetView = new RelativeLayout(getContext());
-    		String inflater = Context.LAYOUT_INFLATER_SERVICE;
-    		LayoutInflater vi;
-    		vi = (LayoutInflater)getContext().getSystemService(inflater);
-    		vi.inflate(widgetLayout, widgetView, true);
-    	} else {
-    		widgetView = (RelativeLayout) convertView;
-    	}
-
-        // Process the colour attributes
-        Integer iconColor = openHABWidget.getIconColor();
-        Integer labelColor = openHABWidget.getLabelColor();
-        Integer valueColor = openHABWidget.getValueColor();
-
-        // Process widgets icon image
-        MySmartImageView widgetImage = (MySmartImageView)widgetView.findViewById(R.id.widgetimage);
-        // Some of widgets, for example Frame doesnt' have an icon, so...
-        if (widgetImage != null) {
-            if (openHABWidget.getIcon() != null) {
-                // This is needed to escape possible spaces and everything according to rfc2396
-                String iconUrl = openHABBaseUrl + "images/" + Uri.encode(openHABWidget.getIcon() + ".png");
-//                Log.d(TAG, "Will try to load icon from " + iconUrl);
-                // Now set image URL
-                widgetImage.setImageUrl(iconUrl, R.drawable.blank_icon,
-                        openHABUsername, openHABPassword);
-                if(iconColor != null)
-                    widgetImage.setColorFilter(iconColor);
-                else
-                    widgetImage.clearColorFilter();
-            }
-        }
-        TextView defaultTextView = new TextView(widgetView.getContext());
-        // Get TextView for widget label and set it's color
-        labelTextView = (TextView)widgetView.findViewById(R.id.widgetlabel);
-        if(labelColor != null && labelTextView != null) {
-            Log.d(TAG, String.format("Setting label color to %d", labelColor));
-            labelTextView.setTextColor(labelColor);
-        } else if (labelTextView != null)
-            labelTextView.setTextColor(defaultTextView.getTextColors().getDefaultColor());
-        // Get TextView for widget value and set it's color
-        valueTextView = (TextView)widgetView.findViewById(R.id.widgetvalue);
-        if (valueColor != null && valueTextView != null) {
-            Log.d(TAG, String.format("Setting value color to %d", valueColor));
-            valueTextView.setTextColor(valueColor);
-        } else if (valueTextView != null)
-            valueTextView.setTextColor(defaultTextView.getTextColors().getDefaultColor());
-        defaultTextView = null;
-    	switch (getItemViewType(position)) {
-    	case TYPE_FRAME:
-    		if (labelTextView != null)
-    			labelTextView.setText(openHABWidget.getLabel());
-    		widgetView.setClickable(false);
-    		if (openHABWidget.getLabel().length() > 0) { // hide empty frames
-    			widgetView.setVisibility(View.VISIBLE);
-    			labelTextView.setVisibility(View.VISIBLE);
-    		} else {
-    			widgetView.setVisibility(View.GONE);
-    			labelTextView.setVisibility(View.GONE);
-    		}
-    		break;
-    	case TYPE_GROUP:
-    		if (labelTextView != null && valueTextView != null) {
-    			splitString = openHABWidget.getLabel().split("\\[|\\]");
-    			labelTextView.setText(splitString[0]);
-    			if (splitString.length > 1) { // We have some value
-    				valueTextView.setText(splitString[1]);
-    			} else {
-    				// This is needed to clean up cached TextViews
-    				valueTextView.setText("");
-    			}
-    		}
-    		break;
-    	case TYPE_SECTIONSWITCH:
-			splitString = openHABWidget.getLabel().split("\\[|\\]");
-			if (labelTextView != null)
-				labelTextView.setText(splitString[0]);
-			if (splitString.length > 1 && valueTextView != null) { // We have some value
-				valueTextView.setText(splitString[1]);
-			} else {
-				// This is needed to clean up cached TextViews
-				valueTextView.setText("");
-			}
-    		RadioGroup sectionSwitchRadioGroup = (RadioGroup)widgetView.findViewById(R.id.sectionswitchradiogroup);
-    		// As we create buttons in this radio in runtime, we need to remove all
-    		// exiting buttons first
-    		sectionSwitchRadioGroup.removeAllViews();
-    		sectionSwitchRadioGroup.setTag(openHABWidget);
-    		Iterator<OpenHABWidgetMapping> sectionMappingIterator = openHABWidget.getMappings().iterator();
-    		while (sectionMappingIterator.hasNext()) {
-    			OpenHABWidgetMapping widgetMapping = sectionMappingIterator.next();
-    			SegmentedControlButton segmentedControlButton = 
-    					(SegmentedControlButton)LayoutInflater.from(sectionSwitchRadioGroup.getContext()).inflate(
-    							R.layout.openhabwidgetlist_sectionswitchitem_button, sectionSwitchRadioGroup, false);
-    			segmentedControlButton.setText(widgetMapping.getLabel());
-    			segmentedControlButton.setTag(widgetMapping.getCommand());
-    			if (openHABWidget.getItem() != null && widgetMapping.getCommand() != null) {
-	    			if (widgetMapping.getCommand().equals(openHABWidget.getItem().getState())) {
-	    				segmentedControlButton.setChecked(true);
-	    			} else {
-	    				segmentedControlButton.setChecked(false);
-	    			}
-    			} else {
-    				segmentedControlButton.setChecked(false);
-    			}
-                segmentedControlButton.setOnClickListener(new OnClickListener() {
-                    @Override
-                    public void onClick(View view) {
-                        Log.i(TAG, "Button clicked");
-                        RadioGroup group = (RadioGroup)view.getParent();
-                        if (group.getTag() != null) {
-                            OpenHABWidget radioWidget = (OpenHABWidget)group.getTag();
-                            SegmentedControlButton selectedButton = (SegmentedControlButton)view;
-                            if (selectedButton.getTag() != null) {
-                                sendItemCommand(radioWidget.getItem(), (String)selectedButton.getTag());
-                            }
-                        }
-                    }
-                });
-    			sectionSwitchRadioGroup.addView(segmentedControlButton);
-    		}
-
-
-    		sectionSwitchRadioGroup.setOnCheckedChangeListener(new OnCheckedChangeListener() {
-				public void onCheckedChanged(RadioGroup group, int checkedId) {
-					OpenHABWidget radioWidget = (OpenHABWidget)group.getTag();
-					SegmentedControlButton selectedButton = (SegmentedControlButton)group.findViewById(checkedId);
-					if (selectedButton != null) {
-						Log.d(TAG, "Selected " + selectedButton.getText());
-						Log.d(TAG, "Command = " + (String)selectedButton.getTag());
-//						radioWidget.getItem().sendCommand((String)selectedButton.getTag());
-						sendItemCommand(radioWidget.getItem(), (String)selectedButton.getTag());
-					}
-				}
-    		});
-    		break;
-    	case TYPE_SWITCH:
-    		if (labelTextView != null)
-    			labelTextView.setText(openHABWidget.getLabel());
-    		Switch switchSwitch = (Switch)widgetView.findViewById(R.id.switchswitch);
-    		if (openHABWidget.hasItem()) {
-    			if (openHABWidget.getItem().getStateAsBoolean()) {
-    				switchSwitch.setChecked(true);
-    			} else {
-    				switchSwitch.setChecked(false);
-    			}
-    		}
-    		switchSwitch.setTag(openHABWidget.getItem());
-    		switchSwitch.setOnTouchListener(new OnTouchListener() {
-				public boolean onTouch(View v, MotionEvent motionEvent) {
-					Switch switchSwitch = (Switch)v;
-					OpenHABItem linkedItem = (OpenHABItem)switchSwitch.getTag();
-					if (motionEvent.getActionMasked() == MotionEvent.ACTION_UP)
-						if (!switchSwitch.isChecked()) {
-							sendItemCommand(linkedItem, "ON");
-						} else {
-							sendItemCommand(linkedItem, "OFF");
-						}
-					return false;
-				}
-                		});
-    		break;
-    	case TYPE_COLOR:
-    		if (labelTextView != null)
-    			labelTextView.setText(openHABWidget.getLabel());
-    		ImageButton colorUpButton = (ImageButton)widgetView.findViewById(R.id.colorbutton_up);
-    		ImageButton colorDownButton = (ImageButton)widgetView.findViewById(R.id.colorbutton_down);
-    		ImageButton colorColorButton = (ImageButton)widgetView.findViewById(R.id.colorbutton_color);
-    		colorUpButton.setTag(openHABWidget.getItem());
-    		colorDownButton.setTag(openHABWidget.getItem());
-    		colorColorButton.setTag(openHABWidget.getItem());
-    		colorUpButton.setOnTouchListener(new OnTouchListener() {
-				public boolean onTouch(View v, MotionEvent motionEvent) {
-					ImageButton colorButton = (ImageButton)v;
-					OpenHABItem colorItem = (OpenHABItem)colorButton.getTag();
-					if (motionEvent.getActionMasked() == MotionEvent.ACTION_UP)
-						sendItemCommand(colorItem, "ON");
-					return false;
-				}
-            });
-    		colorDownButton.setOnTouchListener(new OnTouchListener() {
-				public boolean onTouch(View v, MotionEvent motionEvent) {
-					ImageButton colorButton = (ImageButton)v;
-					OpenHABItem colorItem = (OpenHABItem)colorButton.getTag();
-					if (motionEvent.getActionMasked() == MotionEvent.ACTION_UP)
-						sendItemCommand(colorItem, "OFF");
-					return false;
-				}
-                		});
-    		colorColorButton.setOnTouchListener(new OnTouchListener() {
-				public boolean onTouch(View v, MotionEvent motionEvent) {
-					ImageButton colorButton = (ImageButton)v;
-					OpenHABItem colorItem = (OpenHABItem)colorButton.getTag();
-					if (motionEvent.getActionMasked() == MotionEvent.ACTION_UP) {
-						Log.d(TAG, "Time to launch color picker!");
-						ColorPickerDialog colorDialog = new ColorPickerDialog(widgetView.getContext(), new OnColorChangedListener() {
-							public void colorChanged(float[] hsv, View v) {
-								Log.d(TAG, "New color HSV = " + hsv[0] + ", " + hsv[1] + ", " +
-										hsv[2]);
-								String newColor = String.valueOf(hsv[0]) + "," + String.valueOf(hsv[1]*100) + "," + String.valueOf(hsv[2]*100);
-								OpenHABItem colorItem = (OpenHABItem) v.getTag();
-								sendItemCommand(colorItem, newColor);
-							}
-						}, colorItem.getStateAsHSV());
-						colorDialog.setTag(colorItem);
-						colorDialog.show();
-					}
-					return false;
-				}
-                		});
-    		break;
-    	case TYPE_ROLLERSHUTTER:
-    		if (labelTextView != null)
-    			labelTextView.setText(openHABWidget.getLabel());
-    		ImageButton rollershutterUpButton = (ImageButton)widgetView.findViewById(R.id.rollershutterbutton_up);
-    		ImageButton rollershutterStopButton = (ImageButton)widgetView.findViewById(R.id.rollershutterbutton_stop);
-    		ImageButton rollershutterDownButton = (ImageButton)widgetView.findViewById(R.id.rollershutterbutton_down);
-    		rollershutterUpButton.setTag(openHABWidget.getItem());
-    		rollershutterStopButton.setTag(openHABWidget.getItem());
-    		rollershutterDownButton.setTag(openHABWidget.getItem());
-    		rollershutterUpButton.setOnTouchListener(new OnTouchListener() {
-				public boolean onTouch(View v, MotionEvent motionEvent) {
-					ImageButton rollershutterButton = (ImageButton)v;
-					OpenHABItem rollershutterItem = (OpenHABItem)rollershutterButton.getTag();
-					if (motionEvent.getActionMasked() == MotionEvent.ACTION_UP)
-						sendItemCommand(rollershutterItem, "UP");
-					return false;
-				}
-                		});
-    		rollershutterStopButton.setOnTouchListener(new OnTouchListener() {
-				public boolean onTouch(View v, MotionEvent motionEvent) {
-					ImageButton rollershutterButton = (ImageButton)v;
-					OpenHABItem rollershutterItem = (OpenHABItem)rollershutterButton.getTag();
-					if (motionEvent.getActionMasked() == MotionEvent.ACTION_UP)
-						sendItemCommand(rollershutterItem, "STOP");
-					return false;
-				}
-                		});
-    		rollershutterDownButton.setOnTouchListener(new OnTouchListener() {
-				public boolean onTouch(View v, MotionEvent motionEvent) {
-					ImageButton rollershutterButton = (ImageButton)v;
-					OpenHABItem rollershutterItem = (OpenHABItem)rollershutterButton.getTag();
-					if (motionEvent.getActionMasked() == MotionEvent.ACTION_UP)
-						sendItemCommand(rollershutterItem, "DOWN");
-					return false;
-				}
-                		});
-    		break;
-    	case TYPE_TEXT:
-    		splitString = openHABWidget.getLabel().split("\\[|\\]");
-    		if (labelTextView != null)
-    			if (splitString.length > 0) {
-    				labelTextView.setText(splitString[0]);
-    			} else {
-    				labelTextView.setText(openHABWidget.getLabel());
-    			}
-    		if (valueTextView != null)
-    			if (splitString.length > 1) {
-    				// If value is not empty, show TextView
-    				valueTextView.setVisibility(View.VISIBLE);
-    				valueTextView.setText(splitString[1]);
-    			} else {
-    				// If value is empty, hide TextView to fix vertical alignment of label
-    				valueTextView.setVisibility(View.GONE);
-    				valueTextView.setText("");
-    			}
-    		break;
-    	case TYPE_SLIDER:
-    		splitString = openHABWidget.getLabel().split("\\[|\\]");
-    		if (labelTextView != null)
-    			labelTextView.setText(splitString[0]);
-    		SeekBar sliderSeekBar = (SeekBar)widgetView.findViewById(R.id.sliderseekbar);
-    		if (openHABWidget.hasItem()) {
-    			sliderSeekBar.setTag(openHABWidget.getItem());
-    			int sliderState = 0;
-    			try {
-    				sliderState = (int)Float.parseFloat(openHABWidget.getItem().getState());
-    			} catch (NumberFormatException e) {
-    				if (e != null) {
-    					Crittercism.logHandledException(e);
-    					Log.e(TAG, e.getMessage());
-    				}
-    				if (openHABWidget.getItem().getState().equals("OFF")) {
-    					sliderState = 0;
-    				} else if (openHABWidget.getItem().getState().equals("ON")) {
-    					sliderState = 100;
-    				}
-    			}
-    			sliderSeekBar.setProgress(sliderState);
-    			sliderSeekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
-						public void onProgressChanged(SeekBar seekBar,
-								int progress, boolean fromUser) {
-						}
-						public void onStartTrackingTouch(SeekBar seekBar) {
-							Log.d(TAG, "onStartTrackingTouch position = " + seekBar.getProgress());
-						}
-						public void onStopTrackingTouch(SeekBar seekBar) {
-							Log.d(TAG, "onStopTrackingTouch position = " + seekBar.getProgress());
-							OpenHABItem sliderItem = (OpenHABItem)seekBar.getTag();
-//							sliderItem.sendCommand(String.valueOf(seekBar.getProgress()));
-							if (sliderItem != null && seekBar != null)
-								sendItemCommand(sliderItem, String.valueOf(seekBar.getProgress()));
-						}
-    			});
-    		}
-    		break;
-    	case TYPE_IMAGE:
-    		MySmartImageView imageImage = (MySmartImageView)widgetView.findViewById(R.id.imageimage);
-    		imageImage.setImageUrl(ensureAbsoluteURL(openHABBaseUrl, openHABWidget.getUrl()), false, 
-    				openHABUsername, openHABPassword);
-//    		ViewGroup.LayoutParams imageLayoutParams = imageImage.getLayoutParams();
-//    		float imageRatio = imageImage.getDrawable().getIntrinsicWidth()/imageImage.getDrawable().getIntrinsicHeight();
-//    		imageLayoutParams.height = (int) (screenWidth/imageRatio);
-//    		imageImage.setLayoutParams(imageLayoutParams);
-    		if (openHABWidget.getRefresh() > 0) {
-    			imageImage.setRefreshRate(openHABWidget.getRefresh());
-    			refreshImageList.add(imageImage);
-    		}
-   		break;
-    	case TYPE_CHART:
-    		MySmartImageView chartImage = (MySmartImageView)widgetView.findViewById(R.id.chartimage);
-    		OpenHABItem chartItem = openHABWidget.getItem();
-    		Random random = new Random();
-    		String chartUrl = "";
-    		if (chartItem != null) {
-	    		if (chartItem.getType().equals("GroupItem")) {
-	    			chartUrl = openHABBaseUrl + "chart?groups=" + chartItem.getName() +
-	    					"&period=" + openHABWidget.getPeriod() + "&random=" +
-	    					String.valueOf(random.nextInt());
-	    		} else {
-                    chartUrl = openHABBaseUrl + "chart?items=" + chartItem.getName() +
-                            "&period=" + openHABWidget.getPeriod() + "&random=" +
-                            String.valueOf(random.nextInt());
-                }
-                if (openHABWidget.getService() != null && openHABWidget.getService().length() > 0) {
-                    chartUrl += "&service=" + openHABWidget.getService();
-                }
-    		}
-    		Log.d(TAG, "Chart url = " + chartUrl);
-    		if (chartImage == null)
-    			Log.e(TAG, "chartImage == null !!!");
-//    		if (openHABUsername != null && openHABPassword != null)
-   			chartImage.setImageUrl(chartUrl, false, openHABUsername, openHABPassword);
-//    		else
-//    			chartImage.setImageUrl(chartUrl, false);
-    		// TODO: This is quite dirty fix to make charts look full screen width on all displays
-    		ViewGroup.LayoutParams chartLayoutParams = chartImage.getLayoutParams();
-    		chartLayoutParams.height = (int) (screenWidth/1.88);
-    		chartImage.setLayoutParams(chartLayoutParams);
-    		if (openHABWidget.getRefresh() > 0) {
-    			chartImage.setRefreshRate(openHABWidget.getRefresh());
-    			refreshImageList.add(chartImage);
-    		}
-    		Log.d(TAG, "chart size = " + chartLayoutParams.width + " " + chartLayoutParams.height);
-    	break;
-    	case TYPE_VIDEO:
-            VideoView videoVideo = (VideoView)widgetView.findViewById(R.id.videovideo);
-            Log.d(TAG, "Opening video at " + openHABWidget.getUrl());
-            // TODO: This is quite dirty fix to make video look maximum available size on all screens
-            WindowManager wm = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE);
-            ViewGroup.LayoutParams videoLayoutParams = videoVideo.getLayoutParams();
-            videoLayoutParams.height = (int)(wm.getDefaultDisplay().getWidth()/1.77);
-            videoVideo.setLayoutParams(videoLayoutParams);
-            // We don't have any event handler to know if the VideoView is on the screen
-            // so we manage an array of all videos to stop them when user leaves the page
-            if (!videoWidgetList.contains(videoVideo))
-                videoWidgetList.add(videoVideo);
-            // Start video
-            if (!videoVideo.isPlaying()) {
-                videoVideo.setVideoURI(Uri.parse(openHABWidget.getUrl()));
-                videoVideo.start();
-            }
-            Log.d(TAG, "Video height is " + videoVideo.getHeight());
-    	break;
-        case TYPE_VIDEO_MJPEG:
-            Log.d(TAG, "Video is mjpeg");
-            ImageView mjpegImage = (ImageView)widgetView.findViewById(R.id.mjpegimage);
-            MjpegStreamer mjpegStreamer = new MjpegStreamer(openHABWidget.getUrl(), this.openHABUsername, this.openHABPassword, this.getContext());
-            mjpegStreamer.setTargetImageView(mjpegImage);
-            mjpegStreamer.start();
-            if (!mjpegWidgetList.contains(mjpegStreamer))
-                mjpegWidgetList.add(mjpegStreamer);
-        break;
-    	case TYPE_WEB:
-    		WebView webWeb = (WebView)widgetView.findViewById(R.id.webweb);
-    		if (openHABWidget.getHeight() > 0) {
-    			ViewGroup.LayoutParams webLayoutParams = webWeb.getLayoutParams();
-    			webLayoutParams.height = openHABWidget.getHeight() * 80;
-    			webWeb.setLayoutParams(webLayoutParams);
-    		}
-    		webWeb.setWebViewClient(new WebViewClient());
-            webWeb.getSettings().setJavaScriptEnabled(true);
-    		webWeb.loadUrl(openHABWidget.getUrl());
-    	break;
-    	case TYPE_SELECTION:
-    		int spinnerSelectedIndex = -1;
-    		if (labelTextView != null)
-    			labelTextView.setText(openHABWidget.getLabel());
-    		Spinner selectionSpinner = (Spinner)widgetView.findViewById(R.id.selectionspinner);
-    		ArrayList<String> spinnerArray = new ArrayList<String>();
-    		Iterator<OpenHABWidgetMapping> mappingIterator = openHABWidget.getMappings().iterator();
-    		while (mappingIterator.hasNext()) {
-    			OpenHABWidgetMapping openHABWidgetMapping = mappingIterator.next();
-    			spinnerArray.add(openHABWidgetMapping.getLabel());
-                if (openHABWidgetMapping.getCommand() != null && openHABWidget.getItem() != null)
-                    if (openHABWidgetMapping.getCommand().equals(openHABWidget.getItem().getState())) {
-                        spinnerSelectedIndex = spinnerArray.size() - 1;
-                    }
-    		}
-    		ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<String>(this.getContext() ,
-    				android.R.layout.simple_spinner_item, spinnerArray);
-    		spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
-    		selectionSpinner.setAdapter(spinnerAdapter);
-    		selectionSpinner.setTag(openHABWidget);
-    		if (spinnerSelectedIndex >= 0)
-    			selectionSpinner.setSelection(spinnerSelectedIndex);
-    		
-    		selectionSpinner.setOnItemSelectedListener(new OnItemSelectedListener() {
-				public void onItemSelected(AdapterView<?> parent, View view,
-						int index, long id) {
-					Log.d(TAG, "Spinner item click on index " + index);
-					Spinner spinner = (Spinner)parent;
-					String selectedLabel = (String)spinner.getAdapter().getItem(index);
-					Log.d(TAG, "Spinner onItemSelected selected label = " + selectedLabel);
-					OpenHABWidget openHABWidget = (OpenHABWidget)parent.getTag();
-					if (openHABWidget != null) {
-						Log.d(TAG, "Label selected = " + openHABWidget.getMapping(index).getLabel());
-						Iterator<OpenHABWidgetMapping> mappingIterator = openHABWidget.getMappings().iterator();
-						while (mappingIterator.hasNext()) {
-							OpenHABWidgetMapping openHABWidgetMapping = mappingIterator.next();
-							if (openHABWidgetMapping.getLabel().equals(selectedLabel)) {
-								Log.d(TAG, "Spinner onItemSelected found match with " + openHABWidgetMapping.getCommand());
-                                if (openHABWidget.getItem().getState() != null)
-                                    if (!openHABWidget.getItem().getState().equals(openHABWidgetMapping.getCommand())) {
-                                        Log.d(TAG, "Spinner onItemSelected selected label command != current item state");
-                                        sendItemCommand(openHABWidget.getItem(), openHABWidgetMapping.getCommand());
-                                    }
-							}
-						}
-					}
-//					if (!openHABWidget.getItem().getState().equals(openHABWidget.getMapping(index).getCommand()))
-//						sendItemCommand(openHABWidget.getItem(),
-//								openHABWidget.getMapping(index).getCommand());
-				}
-
-				public void onNothingSelected(AdapterView<?> arg0) {
-				}    			
-    		});
-    		break;
-    	case TYPE_SETPOINT:
-    		splitString = openHABWidget.getLabel().split("\\[|\\]");
-    		if (labelTextView != null)
-    			labelTextView.setText(splitString[0]);
-    		if (valueTextView != null)
-    			if (splitString.length > 1) {
-    				// If value is not empty, show TextView
-    				valueTextView.setVisibility(View.VISIBLE);
-    				valueTextView.setText(splitString[1]);
-    			}
-    		Button setPointMinusButton = (Button)widgetView.findViewById(R.id.setpointbutton_minus);
-    		Button setPointPlusButton = (Button)widgetView.findViewById(R.id.setpointbutton_plus);
-    		setPointMinusButton.setTag(openHABWidget);
-    		setPointPlusButton.setTag(openHABWidget);
-    		setPointMinusButton.setOnClickListener(new OnClickListener() {
-				public void onClick(View v) {
-					Log.d(TAG, "Minus");
-					OpenHABWidget setPointWidget = (OpenHABWidget)v.getTag();
-					float currentValue = Float.valueOf(setPointWidget.getItem().getState()).floatValue();
-					currentValue = currentValue - setPointWidget.getStep();
-					if (currentValue < setPointWidget.getMinValue())
-						currentValue = setPointWidget.getMinValue();
-                    if (currentValue > setPointWidget.getMaxValue())
-                        currentValue = setPointWidget.getMaxValue();
-					sendItemCommand(setPointWidget.getItem(), String.valueOf(currentValue));
-
-				}
-                		});
-    		setPointPlusButton.setOnClickListener(new OnClickListener() {
-				public void onClick(View v) {
-					Log.d(TAG,"Plus");
-					OpenHABWidget setPointWidget = (OpenHABWidget)v.getTag();
-					float currentValue = Float.valueOf(setPointWidget.getItem().getState()).floatValue();
-					currentValue = currentValue + setPointWidget.getStep();
-                    if (currentValue < setPointWidget.getMinValue())
-                        currentValue = setPointWidget.getMinValue();
-					if (currentValue > setPointWidget.getMaxValue())
-						currentValue = setPointWidget.getMaxValue();
-					sendItemCommand(setPointWidget.getItem(), String.valueOf(currentValue));
-				}
-                		});
-    		break;
-    	default:
-    		if (labelTextView != null)
-    			labelTextView.setText(openHABWidget.getLabel());
-    		break;
-    	}
-    	LinearLayout dividerLayout = (LinearLayout)widgetView.findViewById(R.id.listdivider);
-    	if (dividerLayout != null) {
-    		if (position < this.getCount()-1) {
-    			if (this.getItemViewType(position + 1) == TYPE_FRAME) {
-        			dividerLayout.setVisibility(View.GONE); // hide dividers before frame widgets
-    			} else {
-    				dividerLayout.setVisibility(View.VISIBLE); // show dividers for all others
-    			}
-    		} else { // last widget in the list, hide divider
-    			dividerLayout.setVisibility(View.GONE);
-    		}
-    	}
-    	return widgetView;
-    }
-    
-    @Override
-    public int getViewTypeCount() {
-        return TYPES_COUNT;
-    }
-    
-    @Override
-    public int getItemViewType(int position) {
-    	OpenHABWidget openHABWidget = getItem(position);
-    	if (openHABWidget.getType().equals("Frame")) {
-    		return TYPE_FRAME;
-    	} else if (openHABWidget.getType().equals("Group")) {
-    		return TYPE_GROUP;
-    	} else if (openHABWidget.getType().equals("Switch")) {
-    		if (openHABWidget.hasMappings()) {
-    			return TYPE_SECTIONSWITCH;
-    		} else if (openHABWidget.getItem() != null) {
-    			if (openHABWidget.getItem().getType()!= null) {
-	    			if (openHABWidget.getItem().getType().equals("RollershutterItem"))
-	    				return TYPE_ROLLERSHUTTER;
-	    			else
-	    				return TYPE_SWITCH;
-    			} else
-    				return TYPE_SWITCH;
-    		} else {
-    			return TYPE_SWITCH;
-    		}
-    	} else if (openHABWidget.getType().equals("Text")) {
-    		return TYPE_TEXT;
-    	} else if (openHABWidget.getType().equals("Slider")) {
-    		return TYPE_SLIDER;
-    	} else if (openHABWidget.getType().equals("Image")) {
-    		return TYPE_IMAGE;
-    	} else if (openHABWidget.getType().equals("Selection")) {
-    		return TYPE_SELECTION;
-    	} else if (openHABWidget.getType().equals("Setpoint")) {
-    		return TYPE_SETPOINT;
-    	} else if (openHABWidget.getType().equals("Chart")) {
-    		return TYPE_CHART;
-    	} else if (openHABWidget.getType().equals("Video")) {
-            if (openHABWidget.getEncoding() != null) {
-                if (openHABWidget.getEncoding().equals("mjpeg")) {
-                    return TYPE_VIDEO_MJPEG;
-                } else {
-                    return TYPE_VIDEO;
-                }
-            } else {
-        		return TYPE_VIDEO;
-            }
-    	} else if (openHABWidget.getType().equals("Webview")) {
-    		return TYPE_WEB;
-    	} else if (openHABWidget.getType().equals("Colorpicker")) {
-    		return TYPE_COLOR;
-    	} else {
-    		return TYPE_GENERICITEM;
-    	}
-    }
-	
-    public void setOpenHABBaseUrl(String baseUrl) {
-    	openHABBaseUrl = baseUrl;
-    }
-    
-    private String ensureAbsoluteURL(String base, String maybeRelative) {
-        if (maybeRelative.startsWith("http")) {
-            return maybeRelative;
-        } else {
-            try {
-               return new URL(new URL(base), maybeRelative).toExternalForm();
-            } catch (MalformedURLException e) {
-               return "";
-            }
-        }
-    }
-    
-    public void sendItemCommand(OpenHABItem item, String command) {
-        try {
-            if (item != null && command != null) {
-                StringEntity se = new StringEntity(command);
-                mAsyncHttpClient.post(getContext(), item.getLink(), se, "text/plain", new AsyncHttpResponseHandler() {
-                    @Override
-                    public void onSuccess(String response) {
-                        Log.d(TAG, "Command was sent successfully");
-                    }
-                    @Override
-                    public void onFailure(Throwable error, String errorResponse) {
-                        Log.e(TAG, "Got command error " + error.getMessage());
-                        if (errorResponse != null)
-                            Log.e(TAG, "Error response = " + errorResponse);
-                    }
-                });
-            }
-        } catch (UnsupportedEncodingException e) {
-            if (e != null)
-            Log.e(TAG, e.getMessage());
-        }
-    }
-
-	public String getOpenHABUsername() {
-		return openHABUsername;
-	}
-
-	public void setOpenHABUsername(String openHABUsername) {
-		this.openHABUsername = openHABUsername;
-	}
-
-	public String getOpenHABPassword() {
-		return openHABPassword;
-	}
-
-	public void setOpenHABPassword(String openHABPassword) {
-		this.openHABPassword = openHABPassword;
-	}
-	
-	public void stopVideoWidgets() {
-		Log.d(TAG, "Stopping video for " + videoWidgetList.size() + " widgets");
-		for (int i=0; i<videoWidgetList.size(); i++) {
-			if (videoWidgetList.get(i) != null)
-				videoWidgetList.get(i).stopPlayback();
-		}
-		videoWidgetList.clear();
-        for (int i=0; i<mjpegWidgetList.size(); i++) {
-            if (mjpegWidgetList.get(i) != null)
-                mjpegWidgetList.get(i).stop();
-        }
-        mjpegWidgetList.clear();
-	}
-
-
-	public void stopImageRefresh() {
-		Log.d(TAG, "Stopping image refresh for " + refreshImageList.size() + " widgets");
-		for (int i=0; i<refreshImageList.size(); i++) {
-			if (refreshImageList.get(i) != null)
-				refreshImageList.get(i).cancelRefresh();
-		}
-		refreshImageList.clear();
-	}
-
-    public MyAsyncHttpClient getAsyncHttpClient() {
-        return mAsyncHttpClient;
-    }
-
-    public void setAsyncHttpClient(MyAsyncHttpClient asyncHttpClient) {
-        mAsyncHttpClient = asyncHttpClient;
-    }
-
-    public boolean areAllItemsEnabled() {
-        return false;
-    }
-
-    public boolean isEnabled(int position) {
-        OpenHABWidget openHABWidget = getItem(position);
-        if (openHABWidget.getType().equals("Frame"))
-            return false;
-        return true;
-    }
-
-}
diff --git a/src/org/openhab/habdroid/ui/OpenHABWidgetListActivity.java b/src/org/openhab/habdroid/ui/OpenHABWidgetListActivity.java
deleted file mode 100644
index dd2487de20a46aca9b6f8b4b9fd4af4060f4c8aa..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/ui/OpenHABWidgetListActivity.java
+++ /dev/null
@@ -1,996 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.ui;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import javax.jmdns.ServiceInfo;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import android.view.*;
-import org.json.JSONException;
-import org.json.JSONObject;
-import org.openhab.habdroid.R;
-import org.openhab.habdroid.model.OpenHABItem;
-import org.openhab.habdroid.model.OpenHABNFCActionList;
-import org.openhab.habdroid.model.OpenHABSitemap;
-import org.openhab.habdroid.model.OpenHABWidget;
-import org.openhab.habdroid.model.OpenHABWidgetDataSource;
-import org.openhab.habdroid.util.AsyncServiceResolver;
-import org.openhab.habdroid.util.AsyncServiceResolverListener;
-import org.openhab.habdroid.util.MyAsyncHttpClient;
-import org.openhab.habdroid.util.Util;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-import com.crittercism.app.Crittercism;
-import com.google.analytics.tracking.android.EasyTracker;
-import com.loopj.android.http.AsyncHttpClient;
-import com.loopj.android.http.AsyncHttpResponseHandler;
-import com.loopj.android.image.WebImageCache;
-
-import android.Manifest.permission;
-import android.app.AlertDialog;
-import android.app.ListActivity;
-import android.app.PendingIntent;
-import android.app.ProgressDialog;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.content.SharedPreferences;
-import android.content.SharedPreferences.Editor;
-import android.content.pm.PackageManager;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.net.ConnectivityManager;
-import android.net.NetworkInfo;
-import android.net.Uri;
-import android.nfc.NfcAdapter;
-import android.os.Bundle;
-import android.preference.PreferenceManager;
-import android.util.Log;
-import android.view.WindowManager.BadTokenException;
-import android.widget.AdapterView;
-import android.widget.AdapterView.OnItemLongClickListener;
-import android.widget.Toast;
-import android.widget.AdapterView.OnItemClickListener;
-
-/**
- * This class is apps' main activity which runs startup sequence and displays list of openHAB
- * widgets from sitemap page with further navigation through sitemap and everything else!
- */
-
-public class OpenHABWidgetListActivity extends ListActivity implements AsyncServiceResolverListener {
-	// Logging TAG
-	private static final String TAG = "OpenHABWidgetListActivity";
-	// Datasource, providing list of openHAB widgets
-	private OpenHABWidgetDataSource openHABWidgetDataSource;
-	// List adapter for list view of openHAB widgets
-	private OpenHABWidgetAdapter openHABWidgetAdapter;
-	// Url of current sitemap page displayed
-	private String displayPageUrl ="";
-	// sitemap root url
-	private String sitemapRootUrl = "";
-	// async http client
-	private static AsyncHttpClient pageAsyncHttpClient;
-	// openHAB base url
-	private String openHABBaseUrl = "https://demo.openhab.org:8443/";
-	// List of widgets to display
-	private ArrayList<OpenHABWidget> widgetList = new ArrayList<OpenHABWidget>();
-	// Username/password for authentication
-	private String openHABUsername;
-	private String openHABPassword;
-	// openHAB Bonjour service name
-	private String openHABServiceType;
-	// openHAB page url from NFC tag
-	private String nfcTagData = "";
-	// Progress dialog
-	private ProgressDialog progressDialog;
-	// selected openhab widget
-	private OpenHABWidget selectedOpenHABWidget;
-	// widget Id which we got from nfc tag
-	private String nfcWidgetId;
-	// widget command which we got from nfc tag
-	private String nfcCommand;
-	// auto close app after nfc action is complete
-	private boolean nfcAutoClose = false;
-	// Service resolver for Bonjour
-	private AsyncServiceResolver serviceResolver;
-	// Enable/disable openHAB discovery
-	private boolean serviceDiscoveryEnabled = true;
-
-	/**
-	 * Overriding onStart to enable Google Analytics stats collection
-	 */
-	@Override
-	public void onStart() {
-		super.onStart();
-		// Start activity tracking via Google Analytics
-		EasyTracker.getInstance().activityStart(this);
-	}
-	
-	/**
-	 * Overriding onStop to enable Google Analytics stats collection
-	 */
-	@Override
-	public void onStop() {
-		super.onStop();
-		// Stop activity tracking via Google Analytics
-		EasyTracker.getInstance().activityStop(this);
-	}
-
-	/**
-	 * This is called when activity is created. Initializes the state, performs network
-	 * state based selection for app initialization and starts the widget list
-	 */
-	@Override
-	public void onCreate(Bundle savedInstanceState) {
-		Log.d("OpenHABWidgetListActivity", "onCreate");
-		// Set default values, false means do it one time during the very first launch
-		PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
-		// Set non-persistant HABDroid version preference to current version from application package
-		try {
-			PreferenceManager.getDefaultSharedPreferences(this).edit().putString("default_openhab_appversion",
-					getPackageManager().getPackageInfo(getPackageName(), 0).versionName).commit();
-		} catch (NameNotFoundException e1) {
-            if (e1 != null)
-                Log.d(TAG, e1.getMessage());
-		}
-		// Set the theme to one from preferences
-		Util.setActivityTheme(this);
-		// Fetch openHAB service type name from strings.xml
-		openHABServiceType = getString(R.string.openhab_service_type);
-		// Enable progress ring bar
-		requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
-		requestWindowFeature(Window.FEATURE_PROGRESS);
-		setProgressBarIndeterminateVisibility(true);
-		// Initialize crittercism reporting
-		JSONObject crittercismConfig = new JSONObject();
-		try {
-			crittercismConfig.put("shouldCollectLogcat", true);
-		} catch (JSONException e) {
-			if (e.getMessage() != null)
-				Log.e(TAG, e.getMessage());
-			else
-				Log.e(TAG, "Crittercism JSON exception");
-		}
-		Crittercism.init(getApplicationContext(), "5117659f59e1bd4ba9000004", crittercismConfig);
-		// Initialize activity view
-		super.onCreate(savedInstanceState);
-		setContentView(R.layout.openhabwidgetlist);
-		// Disable screen timeout if set in preferences
-		SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);
-		if (settings.getBoolean("default_openhab_screentimeroff", false)) {
-			getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
-		}
-		// Check if we got all needed permissions
-		PackageManager pm = getPackageManager();
-		if (!(pm.checkPermission(permission.CHANGE_WIFI_MULTICAST_STATE, getPackageName()) == PackageManager.PERMISSION_GRANTED)) {
-			showAlertDialog(getString(R.string.erorr_no_wifi_mcast_permission));
-			serviceDiscoveryEnabled = false;
-		}
-		if (!(pm.checkPermission(permission.ACCESS_WIFI_STATE, getPackageName()) == PackageManager.PERMISSION_GRANTED)) {
-			showAlertDialog(getString(R.string.erorr_no_wifi_state_permission));
-			serviceDiscoveryEnabled = false;
-		}
-		// Get username/password from preferences
-		openHABUsername = settings.getString("default_openhab_username", null);
-		openHABPassword = settings.getString("default_openhab_password", null);
-		// Create new data source and adapter and set it to list view
-		openHABWidgetDataSource = new OpenHABWidgetDataSource();
-		openHABWidgetAdapter = new OpenHABWidgetAdapter(OpenHABWidgetListActivity.this,
-				R.layout.openhabwidgetlist_genericitem, widgetList);
-		getListView().setAdapter(openHABWidgetAdapter);
-		// Set adapter parameters
-		openHABWidgetAdapter.setOpenHABUsername(openHABUsername);
-		openHABWidgetAdapter.setOpenHABPassword(openHABPassword);
-		// Enable app logo as home button
-		this.getActionBar().setHomeButtonEnabled(true);
-		// Check if we have openHAB page url in saved instance state?
-		if (savedInstanceState != null) {
-			displayPageUrl = savedInstanceState.getString("displayPageUrl");
-			openHABBaseUrl = savedInstanceState.getString("openHABBaseUrl");
-			sitemapRootUrl = savedInstanceState.getString("sitemapRootUrl");
-			openHABWidgetAdapter.setOpenHABBaseUrl(openHABBaseUrl);
-		}
-		// Check if this is a launch from myself (drill down navigation)
-		if (getIntent() != null) {
-            if (getIntent().getAction() != null) {
-                if (getIntent().getAction().equals("org.openhab.habdroid.ui.OpwnHABWidgetListActivity")) {
-                    displayPageUrl = getIntent().getExtras().getString("displayPageUrl");
-                    openHABBaseUrl = getIntent().getExtras().getString("openHABBaseUrl");
-                    sitemapRootUrl = getIntent().getExtras().getString("sitemapRootUrl");
-                    this.setTitle(getIntent().getExtras().getString("pageTitle"));
-                    openHABWidgetAdapter.setOpenHABBaseUrl(openHABBaseUrl);
-                }
-            }
-		}
-		// If yes, then just go to it (means restore activity from it's saved state)
-		if (displayPageUrl.length() > 0) {
-			Log.d(TAG, "displayPageUrl = " + displayPageUrl);
-			showPage(displayPageUrl, false);
-		// If not means it is a clean start
-		} else {
-			if (getIntent() != null) {
-				Log.i(TAG, "Launch intent = " + getIntent().getAction());
-				// If this is a launch through NFC tag reading
-                if (getIntent().getAction() != null) {
-                    if (getIntent().getAction().equals("android.nfc.action.NDEF_DISCOVERED")) {
-                        // Save url which we got from NFC tag
-                        nfcTagData = getIntent().getDataString();
-                    }
-                }
-			}
-			// If we are in demo mode, ignore all settings and use demo url from strings
-			if (settings.getBoolean("default_openhab_demomode", false)) {
-				openHABBaseUrl = getString(R.string.openhab_demo_url);
-				Log.i(TAG, "Demo mode, connecting to " + openHABBaseUrl);
-				Toast.makeText(getApplicationContext(), getString(R.string.info_demo_mode),
-					Toast.LENGTH_LONG).show();
-				showTime();
-			} else {
-				openHABBaseUrl = normalizeUrl(settings.getString("default_openhab_url", ""));
-				// Check if we have a direct URL in preferences, if yes - use it
-				if (openHABBaseUrl.length() > 0) {
-					Log.i(TAG, "Connecting to configured URL = " + openHABBaseUrl);
-					Toast.makeText(getApplicationContext(), getString(R.string.info_conn_url),
-							Toast.LENGTH_SHORT).show();
-					showTime();
-				} else {
-					// Get current network information
-					ConnectivityManager connectivityManager = (ConnectivityManager)getSystemService(
-							Context.CONNECTIVITY_SERVICE);
-					NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
-					if (activeNetworkInfo != null) {
-						Log.i(TAG, "Network is connected");
-						// If network is mobile, try to use remote URL
-						if (activeNetworkInfo.getType() == ConnectivityManager.TYPE_MOBILE || serviceDiscoveryEnabled == false) {
-							if (!serviceDiscoveryEnabled) {
-								Log.i(TAG, "openHAB discovery is disabled");
-							} else {
-								Log.i(TAG, "Network is Mobile (" + activeNetworkInfo.getSubtypeName() + ")");
-							}
-							openHABBaseUrl = normalizeUrl(settings.getString("default_openhab_alturl", ""));
-							// If remote URL is configured
-							if (openHABBaseUrl.length() > 0) {
-								Toast.makeText(getApplicationContext(), getString(R.string.info_conn_rem_url),
-										Toast.LENGTH_SHORT).show();
-								Log.i(TAG, "Connecting to remote URL " + openHABBaseUrl);
-								showTime();
-							} else {
-								Toast.makeText(getApplicationContext(), getString(R.string.error_no_url),
-										Toast.LENGTH_LONG).show();		
-							}
-						// If network is WiFi or Ethernet
-						} if (activeNetworkInfo.getType() == ConnectivityManager.TYPE_WIFI
-								|| activeNetworkInfo.getType() == ConnectivityManager.TYPE_ETHERNET) {
-							Log.i(TAG, "Network is WiFi or Ethernet");
-							// Start service discovery
-							this.serviceResolver = new AsyncServiceResolver(this, openHABServiceType);
-							progressDialog = ProgressDialog.show(this, "", 
-			                        "Discovering openHAB. Please wait...", true);
-							this.serviceResolver.start();
-						// We don't know how to handle this network type
-						} else {
-							Log.i(TAG, "Network type (" + activeNetworkInfo.getTypeName() + ") is unsupported");
-						}
-					// Network is not available
-					} else {
-						Log.i(TAG, "Network is not available");
-						Toast.makeText(getApplicationContext(), getString(R.string.error_network_not_available),
-								Toast.LENGTH_LONG).show();						
-					}
-				}
-			}
-		}
-	}
-	
-	// Start openHAB browsing!
-	public void showTime() {
-		if (openHABBaseUrl != null) {
-			openHABWidgetAdapter.setOpenHABBaseUrl(openHABBaseUrl);
-			if (nfcTagData.length() > 0) {
-				Log.d(TAG, "We have NFC tag data");
-				onNfcTag(nfcTagData, false);
-			} else {
-				selectSitemap(openHABBaseUrl, false);
-			}
-		} else {
-			Log.e(TAG, "No base URL!");
-		}
-	}
-
-	/**
-	 * This method is called by AsyncServiceResolver in case of successful service discovery
-	 * to start connection with local openHAB instance
-	 */
-	public void onServiceResolved(ServiceInfo serviceInfo) {
-		Log.i(TAG, "Service resolved: "
-                + serviceInfo.getHostAddresses()[0]
-                + " port:" + serviceInfo.getPort());
-		openHABBaseUrl = "https://" + serviceInfo.getHostAddresses()[0] + ":" +
-				String.valueOf(serviceInfo.getPort()) + "/";
-//		progressDialog.hide();
-		progressDialog.dismiss();
-		AsyncHttpClient asyncHttpClient = new MyAsyncHttpClient(this);
-		asyncHttpClient.get(openHABBaseUrl + "static/uuid", new AsyncHttpResponseHandler() {
-			@Override
-			public void onSuccess(String content) {
-				Log.i(TAG, "Got openHAB UUID = " + content);
-				SharedPreferences settings = 
-						PreferenceManager.getDefaultSharedPreferences(OpenHABWidgetListActivity.this);
-				if (settings.contains("openhab_uuid")) {
-					String openHABUUID = settings.getString("openhab_uuid", "");
-					if (openHABUUID.equals(content)) {
-						Log.i(TAG, "openHAB UUID does match the saved one");
-						showTime();
-					} else {
-						Log.i(TAG, "openHAB UUID doesn't match the saved one");
-						// TODO: need to add some user prompt here
-/*						Toast.makeText(getApplicationContext(), 
-								"openHAB UUID doesn't match the saved one!",
-								Toast.LENGTH_LONG).show();*/
-						showTime();
-					}
-				} else {
-					Log.i(TAG, "No recorded openHAB UUID, saving the new one");
-					Editor preferencesEditor = settings.edit();
-					preferencesEditor.putString("openhab_uuid", content);
-					preferencesEditor.commit();
-					showTime();
-				}
-			}
-			@Override
-		    public void onFailure(Throwable e, String errorResponse) {
-				Toast.makeText(getApplicationContext(), getString(R.string.error_no_uuid),
-						Toast.LENGTH_LONG).show();
-			}
-		});
-	}
-
-	/**
-	 * This method is called by AsyncServiceResolver in case of discovery failure
-	 * to start alternate connection through remote url (if configured)
-	 */
-	public void onServiceResolveFailed() {
-		if (progressDialog.isShowing())
-			progressDialog.dismiss();
-		Log.i(TAG, "Service resolve failed, switching to remote URL");
-		SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);
-		openHABBaseUrl = normalizeUrl(settings.getString("default_openhab_alturl", ""));
-		// If remote URL is configured
-		if (openHABBaseUrl.length() > 0) {
-			Toast.makeText(getApplicationContext(), getString(R.string.info_conn_rem_url),
-					Toast.LENGTH_SHORT).show();
-			Log.i(TAG, "Connecting to remote URL " + openHABBaseUrl);
-			showTime();
-		} else {
-			Toast.makeText(getApplicationContext(), getString(R.string.error_no_url),
-					Toast.LENGTH_LONG).show();		
-		}
-	}
-	
-	/**
-	 * This method is called when activity receives a new intent while running
-	 */
-	@Override
-	public void onNewIntent(Intent newIntent) {
-		Log.d(TAG, "New intent received = " + newIntent.toString());
-		if (newIntent.getDataString() != null) {
-			onNfcTag(newIntent.getDataString(), true);
-		}
-	}
-	
-	/**
-	 * This method processes new intents generated by NFC subsystem
-	 * @param nfcData - a data which NFC subsystem got from the NFC tag
-	 * @param pushCurrentToStack
-	 */
-	public void onNfcTag(String nfcData, boolean pushCurrentToStack) {
-		Uri openHABURI = Uri.parse(nfcData);
-		Log.d(TAG, openHABURI.getScheme());
-		Log.d(TAG, openHABURI.getHost());
-		Log.d(TAG, openHABURI.getPath());
-		if (openHABURI.getHost().equals("sitemaps")) {
-			Log.d(TAG, "Tag indicates a sitemap link");
-			String newPageUrl = this.openHABBaseUrl + "rest/sitemaps" + openHABURI.getPath();
-			String widgetId = openHABURI.getQueryParameter("widget");
-			String command = openHABURI.getQueryParameter("command");
-			Log.d(TAG, "widgetId = " + widgetId);
-			Log.d(TAG, "command = " + command);
-			if (widgetId != null && command != null) {
-				this.nfcWidgetId = widgetId;
-				this.nfcCommand = command;
-				// If we have widget+command and not pushing current page to stack
-				// this means we started through NFC read when HABDroid was not running
-				// so we need to put a flag to automatically close activity after we
-				// finish nfc action
-				if (!pushCurrentToStack)
-					this.nfcAutoClose = true;
-			}
-			Log.d(TAG, "Should go to " + newPageUrl);
-			if (pushCurrentToStack)
-				navigateToPage(newPageUrl, "");
-			else
-				openSitemap(newPageUrl);
-		}		
-	}
-
-	/**
-	 * This method is called when activity is being resumed after onPause()
-	 */
-	@Override
-	public void onResume() {
-		Log.d(TAG, "onResume()");
-		Log.d(TAG, "displayPageUrl = " + this.displayPageUrl);
-		super.onResume();
-		PendingIntent pendingIntent = PendingIntent.getActivity(
-				  this, 0, new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0);
-		if (NfcAdapter.getDefaultAdapter(this) != null)
-			NfcAdapter.getDefaultAdapter(this).enableForegroundDispatch(this, pendingIntent, null, null);
-		if (this.displayPageUrl.length() > 0) {
-			Log.d(TAG, "displayPageUrl > 0, resuming");
-			showPage(displayPageUrl, false);
-		}
-	}
-
-	/**
-	 * This method is called when activity is paused
-	 */
-	@Override
-	public void onPause() {
-		Log.d(TAG, "onPause()");
-		super.onPause();
-        if (NfcAdapter.getDefaultAdapter(this) != null)
-            NfcAdapter.getDefaultAdapter(this).disableForegroundDispatch(this);
-		openHABWidgetAdapter.stopVideoWidgets();
-		openHABWidgetAdapter.stopImageRefresh();
-		if(NfcAdapter.getDefaultAdapter(this) != null)
-			NfcAdapter.getDefaultAdapter(this).disableForegroundDispatch(this);
-		if (pageAsyncHttpClient != null)
-			pageAsyncHttpClient.cancelRequests(this, true);
-	}
-
-	@Override
-	public void onSaveInstanceState(Bundle savedInstanceState) {
-		Log.d("OpenHABWidgetListActivity", "onSaveInstanceState");
-
-	  // Save UI state changes to the savedInstanceState.
-	  // This bundle will be passed to onCreate if the process is
-	  // killed and restarted.
-	  savedInstanceState.putString("displayPageUrl", displayPageUrl);
-	  savedInstanceState.putString("openHABBaseUrl", openHABBaseUrl);
-	  savedInstanceState.putString("sitemapRootUrl", sitemapRootUrl);
-	  super.onSaveInstanceState(savedInstanceState);
-	}
-	
-	@Override
-	protected void onDestroy() {
-		super.onDestroy();
-		Log.d(TAG, "onDestroy() for " + this.displayPageUrl);
-		if (this.progressDialog != null)
-			this.progressDialog.dismiss();
-		if (this.serviceResolver != null)
-			this.serviceResolver.interrupt();
-		if (pageAsyncHttpClient != null)
-			pageAsyncHttpClient.cancelRequests(this, true);
-	}
-	
-	/**
-	 * This method is called when activity is finished
-	 * We need to intercept it to override transition animation according to application
-	 * settings
-	 */
-	@Override
-	public void finish() {
-		super.finish();
-		Util.overridePendingTransition(this, true);		
-	}
-	
-	/**
-	 * This method is called when a daugther activity is finished
-	 * we need to analyze return code
-	 */
-	@Override
-	public void onActivityResult(int requestCode, int resultCode, Intent data) {
-		Log.d(TAG, "onActivityResult " + String.valueOf(requestCode) + " " + String.valueOf(resultCode));
-		if (resultCode == -1) {
-			// Right now only PreferencesActivity returns -1
-			// Restart app after preferences
-			Log.d(TAG, "Restarting");
-			// Get launch intent for application
-			Intent restartIntent = getBaseContext().getPackageManager()
-		             .getLaunchIntentForPackage( getBaseContext().getPackageName() );
-			restartIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
-			// Finish current activity
-			finish();
-			// Start launch activity
-			startActivity(restartIntent);
-		}
-	}
-
-	/**
-     * Loads data from sitemap page URL and passes it to processContent
-     *
-     * @param  pageUrl  an absolute base URL of openHAB sitemap page
-     * @param  longPolling  enable long polling when loading page
-     * @return      void
-     */
-	public void showPage(String pageUrl, boolean longPolling) {
-		Log.i(TAG, "showPage for " + pageUrl + " longPolling = " + longPolling);
-		// Cancel any existing http request to openHAB (typically ongoing long poll)
-		if (!longPolling)
-			setProgressBarIndeterminateVisibility(true);
-		if (pageAsyncHttpClient != null) {
-			pageAsyncHttpClient.cancelRequests(this, true);
-		}
-		if (!longPolling) {
-			pageAsyncHttpClient = null;
-			pageAsyncHttpClient = new MyAsyncHttpClient(this);
-		}
-		// If authentication is needed
-		pageAsyncHttpClient.setBasicAuth(openHABUsername, openHABPassword);
-		// If long-polling is needed
-		if (longPolling) {
-			// Add corresponding fields to header to make openHAB know we need long-polling
-			pageAsyncHttpClient.addHeader("X-Atmosphere-Transport", "long-polling");
-			pageAsyncHttpClient.addHeader("Accept", "application/xml");
-			pageAsyncHttpClient.setTimeout(30000);
-		}
-		pageAsyncHttpClient.get(this, pageUrl, new AsyncHttpResponseHandler() {
-			@Override
-			public void onSuccess(String content) {
-				processContent(content);
-			}
-			@Override
-		     public void onFailure(Throwable e, String errorResponse) {
-				Log.e(TAG, "http request failed");
-				if (e.getMessage() != null) {
-					Log.e(TAG, e.getMessage());
-					if (e.getMessage().equals("Unauthorized")) {
-						showAlertDialog(getString(R.string.error_authentication_failed));
-					}
-				}
-				stopProgressIndicator();
-		     }
-		});
-	}
-
-	/**
-     * Parse XML sitemap page and show it
-     *
-     * @param  content	XML as a text
-     * @return      void
-     */
-	public void processContent(String content) {
-		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-		try {
-			DocumentBuilder builder = factory.newDocumentBuilder();
-			Document document;
-			openHABWidgetAdapter.stopVideoWidgets();
-			openHABWidgetAdapter.stopImageRefresh();
-			// TODO: fix crash with null content
-			if (content != null) {
-				document = builder.parse(new ByteArrayInputStream(content.getBytes("UTF-8")));
-			} else {
-				Log.e(TAG, "processContent: content == null");
-				return;
-			}
-			Node rootNode = document.getFirstChild();
-			openHABWidgetDataSource.setSourceNode(rootNode);
-			widgetList.clear();
-			// As we change the page we need to stop all videos on current page
-			// before going to the new page. This is quite dirty, but is the only
-			// way to do that...
-			for (OpenHABWidget w : openHABWidgetDataSource.getWidgets()) {
-				widgetList.add(w);
-			}
-			openHABWidgetAdapter.notifyDataSetChanged();
-			setTitle(openHABWidgetDataSource.getTitle());
-			setProgressBarIndeterminateVisibility(false);
-			// Set widget list index to saved or zero position
-			// This would mean we got widget and command from nfc tag, so we need to do some automatic actions!
-			if (this.nfcWidgetId != null && this.nfcCommand != null) {
-				Log.d(TAG, "Have widget and command, NFC action!");
-				OpenHABWidget nfcWidget = this.openHABWidgetDataSource.getWidgetById(this.nfcWidgetId);
-				OpenHABItem nfcItem = nfcWidget.getItem();
-				// Found widget with id from nfc tag and it has an item
-				if (nfcWidget != null && nfcItem != null) {
-					// TODO: Perform nfc widget action here
-					if (this.nfcCommand.equals("TOGGLE")) {
-						if (nfcItem.getType().equals("RollershutterItem")) {
-							if (nfcItem.getStateAsBoolean())
-								this.openHABWidgetAdapter.sendItemCommand(nfcItem, "UP");
-							else
-								this.openHABWidgetAdapter.sendItemCommand(nfcItem, "DOWN");							
-						} else {
-							if (nfcItem.getStateAsBoolean())
-								this.openHABWidgetAdapter.sendItemCommand(nfcItem, "OFF");
-							else
-								this.openHABWidgetAdapter.sendItemCommand(nfcItem, "ON");
-						}
-					} else {
-						this.openHABWidgetAdapter.sendItemCommand(nfcItem, this.nfcCommand);
-					}
-				}
-				this.nfcWidgetId = null;
-				this.nfcCommand = null;
-				if (this.nfcAutoClose) {
-					finish();
-				}
-			}
-			getListView().setOnItemClickListener(new OnItemClickListener() {
-				public void onItemClick(AdapterView<?> parent, View view, int position,
-						long id) {
-					Log.d(TAG, "Widget clicked " + String.valueOf(position));
-					OpenHABWidget openHABWidget = openHABWidgetAdapter.getItem(position);
-					if (openHABWidget.hasLinkedPage()) {
-						// Widget have a page linked to it
-                        String[] splitString;
-                        splitString = openHABWidget.getLinkedPage().getTitle().split("\\[|\\]");
-                        navigateToPage(openHABWidget.getLinkedPage().getLink(), splitString[0]);
-					}
-				}
-				
-			});
-			getListView().setOnItemLongClickListener(new OnItemLongClickListener() {
-				public boolean onItemLongClick(AdapterView<?> parent, View view,
-						int position, long id) {
-					Log.d(TAG, "Widget long-clicked " + String.valueOf(position));
-					OpenHABWidget openHABWidget = openHABWidgetAdapter.getItem(position);
-					Log.d(TAG, "Widget type = " + openHABWidget.getType());
-					if (openHABWidget.getType().equals("Switch") || openHABWidget.getType().equals("Selection") ||
-							openHABWidget.getType().equals("Colorpicker")) {
-						OpenHABWidgetListActivity.this.selectedOpenHABWidget = openHABWidget;
-						AlertDialog.Builder builder = new AlertDialog.Builder(OpenHABWidgetListActivity.this);
-						builder.setTitle(R.string.nfc_dialog_title);
-						OpenHABNFCActionList nfcActionList = new OpenHABNFCActionList(OpenHABWidgetListActivity.this.selectedOpenHABWidget);
-						builder.setItems(nfcActionList.getNames(), new DialogInterface.OnClickListener() {
-							public void onClick(DialogInterface dialog, int which) {
-					            Intent writeTagIntent = new Intent(OpenHABWidgetListActivity.this.getApplicationContext(),
-					            		OpenHABWriteTagActivity.class);
-					            writeTagIntent.putExtra("sitemapPage", OpenHABWidgetListActivity.this.displayPageUrl);
-					            writeTagIntent.putExtra("widget", OpenHABWidgetListActivity.this.selectedOpenHABWidget.getId());
-					            OpenHABNFCActionList nfcActionList = 
-					            	new OpenHABNFCActionList(OpenHABWidgetListActivity.this.selectedOpenHABWidget);
-					            writeTagIntent.putExtra("command", nfcActionList.getCommands()[which]);
-					            startActivityForResult(writeTagIntent, 0);
-					            Util.overridePendingTransition(OpenHABWidgetListActivity.this, false);
-					            OpenHABWidgetListActivity.this.selectedOpenHABWidget = null;
-							}
-						});
-						builder.show();
-						return true;
-					}
-					return true;
-				}				
-			});
-		} catch (ParserConfigurationException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		} catch (UnsupportedEncodingException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		} catch (SAXException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		} catch (IOException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-		showPage(displayPageUrl, true);
-	}
-
-	/*
-	 * Put current page and current widget list position into the stack and go to new page
-	 */
-	private void navigateToPage(String pageLink, String pageTitle) {
-		// We don't want to put current page to stack if navigateToPage is trying to go to the same page
-		if (!pageLink.equals(displayPageUrl)) {
-            Intent drillDownIntent = new Intent(OpenHABWidgetListActivity.this.getApplicationContext(),
-            		OpenHABWidgetListActivity.class);
-            drillDownIntent.setAction("org.openhab.habdroid.ui.OpwnHABWidgetListActivity");
-            drillDownIntent.putExtra("displayPageUrl", pageLink);
-            drillDownIntent.putExtra("openHABBaseUrl", openHABBaseUrl);
-            drillDownIntent.putExtra("sitemapRootUrl", sitemapRootUrl);
-            drillDownIntent.putExtra("pageTitle", pageTitle);
-            startActivityForResult(drillDownIntent, 0);
-            Util.overridePendingTransition(this, false);
-		}
-	}
-
-    @Override
-    public boolean dispatchTouchEvent(MotionEvent event) {
-        Log.d(TAG, event.toString());
-        Log.d(TAG, String.format("event action = %d", event.getAction()));
-        return super.dispatchTouchEvent(event);
-    }
-
-    @Override
-    public boolean onKeyLongPress(int keyCode, KeyEvent event) {
-        Log.d(TAG, "keyCode = " + String.format("%d", keyCode));
-        Log.d(TAG, "event = " + event.toString());
-        if (keyCode == 4) {
-            return true;
-        } else {
-            return super.onKeyLongPress(keyCode, event);
-        }
-    }
-	
-    @Override
-    public boolean onCreateOptionsMenu(Menu menu) {
-        MenuInflater inflater = getMenuInflater();
-        inflater.inflate(R.menu.main_menu, menu);
-        return true;
-    }
-
-    @Override
-    public boolean onOptionsItemSelected(MenuItem item) {
-    	switch (item.getItemId()) {
-    	case R.id.mainmenu_openhab_preferences:
-            Intent settingsIntent = new Intent(this.getApplicationContext(), OpenHABPreferencesActivity.class);
-            Util.overridePendingTransition(this, false);
-    		return true;
-    	case R.id.mainmenu_openhab_selectsitemap:
-			SharedPreferences settings = 
-			PreferenceManager.getDefaultSharedPreferences(OpenHABWidgetListActivity.this);
-			Editor preferencesEditor = settings.edit();
-			preferencesEditor.putString("default_openhab_sitemap", "");
-			preferencesEditor.commit();
-    		selectSitemap(openHABBaseUrl, true);
-    		return true;
-        case android.R.id.home:
-            Log.d(TAG, "Home selected - " + sitemapRootUrl);
-			// Get launch intent for application
-			Intent homeIntent = getBaseContext().getPackageManager()
-		             .getLaunchIntentForPackage( getBaseContext().getPackageName() );
-			homeIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
-			homeIntent.setAction("org.openhab.habdroid.ui.OpwnHABWidgetListActivity");
-			homeIntent.putExtra("displayPageUrl", sitemapRootUrl);
-			homeIntent.putExtra("openHABBaseUrl", openHABBaseUrl);
-			homeIntent.putExtra("sitemapRootUrl", sitemapRootUrl);
-			// Finish current activity
-			finish();
-			// Start launch activity
-			startActivity(homeIntent);
-			Util.overridePendingTransition(this, true);		
-            return true;
-        case R.id.mainmenu_openhab_clearcache:
-			Log.d(TAG, "Restarting");
-			// Get launch intent for application
-			Intent restartIntent = getBaseContext().getPackageManager()
-		             .getLaunchIntentForPackage( getBaseContext().getPackageName() );
-			restartIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
-			// Finish current activity
-			finish();
-        	WebImageCache cache = new WebImageCache(getBaseContext());
-        	cache.clear();
-			// Start launch activity
-			startActivity(restartIntent);
-			// Start launch activity
-			return true;
-        case R.id.mainmenu_openhab_writetag:
-            Intent writeTagIntent = new Intent(this.getApplicationContext(), OpenHABWriteTagActivity.class);
-            writeTagIntent.putExtra("sitemapPage", this.displayPageUrl);
-            startActivityForResult(writeTagIntent, 0);
-            Util.overridePendingTransition(this, false);
-    		return true;
-        default:
-    		return super.onOptionsItemSelected(item);
-    	}
-    }
-
-    /**
-     * Get sitemaps from openHAB, if user already configured preffered sitemap
-     * just open it. If no preffered sitemap is configured - let user select one.
-     *
-     * @param  baseURL  an absolute base URL of openHAB to open
-     * @return      void
-     */
-
-	private void selectSitemap(final String baseURL, final boolean forceSelect) {
-		Log.d(TAG, "Loding sitemap list from " + baseURL + "rest/sitemaps");
-	    AsyncHttpClient asyncHttpClient = new MyAsyncHttpClient(this);
-		// If authentication is needed
-	    asyncHttpClient.setBasicAuth(openHABUsername, openHABPassword);
-	    asyncHttpClient.get(baseURL + "rest/sitemaps", new AsyncHttpResponseHandler() {
-			@Override
-			public void onSuccess(String content) {
-				List<OpenHABSitemap> sitemapList = parseSitemapList(content);
-				if (sitemapList.size() == 0) {
-					// Got an empty sitemap list!
-					showAlertDialog(getString(R.string.error_empty_sitemap_list));
-					return;
-				}
-				// If we are forced to do selection, just open selection dialog
-				if (forceSelect) {
-					showSitemapSelectionDialog(sitemapList);
-				} else {
-					// Check if we have a sitemap configured to use
-					SharedPreferences settings = 
-							PreferenceManager.getDefaultSharedPreferences(OpenHABWidgetListActivity.this);
-					String configuredSitemap = settings.getString("default_openhab_sitemap", "");
-					// If we have sitemap configured
-					if (configuredSitemap.length() > 0) {
-						// Configured sitemap is on the list we got, open it!
-						if (sitemapExists(sitemapList, configuredSitemap)) {
-							Log.d(TAG, "Configured sitemap is on the list");
-							OpenHABSitemap selectedSitemap = getSitemapByName(sitemapList, configuredSitemap);
-							openSitemap(selectedSitemap.getHomepageLink());
-						// Configured sitemap is not on the list we got!
-						} else {
-							Log.d(TAG, "Configured sitemap is not on the list");
-							if (sitemapList.size() == 1) {
-								Log.d(TAG, "Got only one sitemap");
-								Editor preferencesEditor = settings.edit();
-								preferencesEditor.putString("default_openhab_sitemap", sitemapList.get(0).getName());
-									preferencesEditor.commit();
-								openSitemap(sitemapList.get(0).getHomepageLink());								
-							} else {
-								Log.d(TAG, "Got multiply sitemaps, user have to select one");
-								showSitemapSelectionDialog(sitemapList);
-							}
-						}
-					// No sitemap is configured to use
-					} else {
-						// We got only one single sitemap from openHAB, use it
-						if (sitemapList.size() == 1) {
-							Log.d(TAG, "Got only one sitemap");
-							Editor preferencesEditor = settings.edit();
-							preferencesEditor.putString("default_openhab_sitemap", sitemapList.get(0).getName());
-								preferencesEditor.commit();
-							openSitemap(sitemapList.get(0).getHomepageLink());
-						} else {
-							Log.d(TAG, "Got multiply sitemaps, user have to select one");
-							showSitemapSelectionDialog(sitemapList);
-						}
-					}
-				}
-			}
-			@Override
-	    	public void onFailure(Throwable e, String errorResponse) {
-				if (e.getMessage() != null) {
-					if (e.getMessage().equals("Unauthorized")) {
-						showAlertDialog(getString(R.string.error_authentication_failed));
-					} else {
-						showAlertDialog("ERROR: " + e.getMessage());
-					}
-				} else {
-					// TODO: carefully handle errors without message
-//					showAlertDialog("ERROR: Http error, no details");
-				}
-			}
-	    });
-	}
-
-	private void stopProgressIndicator() {
-		setProgressBarIndeterminateVisibility(false);
-	}
-
-	private boolean sitemapExists(List<OpenHABSitemap> sitemapList, String sitemapName) {
-		for (int i=0; i<sitemapList.size(); i++) {
-			if (sitemapList.get(i).getName().equals(sitemapName))
-				return true;
-		}
-		return false;
-	}
-	
-	private OpenHABSitemap getSitemapByName(List<OpenHABSitemap> sitemapList, String sitemapName) {
-		for (int i=0; i<sitemapList.size(); i++) {
-			if (sitemapList.get(i).getName().equals(sitemapName))
-				return sitemapList.get(i);
-		}
-		return null;
-	}
-	
-	private List<OpenHABSitemap> parseSitemapList(String xmlContent) {
-		List<OpenHABSitemap> sitemapList = new ArrayList<OpenHABSitemap>();
-		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-		DocumentBuilder builder;
-		Crittercism.leaveBreadcrumb("parseSitemapList");
-		try {
-			builder = factory.newDocumentBuilder();
-			Document document;
-			document = builder.parse(new ByteArrayInputStream(xmlContent.getBytes("UTF-8")));
-			NodeList sitemapNodes = document.getElementsByTagName("sitemap");
-			if (sitemapNodes.getLength() > 0) {
-				for (int i=0; i < sitemapNodes.getLength(); i++) {
-					Node sitemapNode = sitemapNodes.item(i);
-					OpenHABSitemap openhabSitemap = new OpenHABSitemap(sitemapNode);
-					sitemapList.add(openhabSitemap);
-				}
-			}
-		} catch (ParserConfigurationException e) {
-			Log.e(TAG, e.getMessage());
-		} catch (UnsupportedEncodingException e) {
-			Log.e(TAG, e.getMessage());
-		} catch (SAXException e) {
-			Log.e(TAG, e.getMessage());
-		} catch (IOException e) {
-			Log.e(TAG, e.getMessage());
-		}
-		return sitemapList;
-	}
-	
-	private void showAlertDialog(String alertMessage) {
-		AlertDialog.Builder builder = new AlertDialog.Builder(OpenHABWidgetListActivity.this);
-		builder.setMessage(alertMessage)
-			.setPositiveButton("OK", new DialogInterface.OnClickListener() {
-				public void onClick(DialogInterface dialog, int id) {
-				}
-		});
-		AlertDialog alert = builder.create();
-		alert.show();		
-	}
-	
-	private void showSitemapSelectionDialog(final List<OpenHABSitemap> sitemapList) {
-		Log.d(TAG, "Opening sitemap selection dialog");
-		final List<String> sitemapNameList = new ArrayList<String>();;
-		for (int i=0; i<sitemapList.size(); i++) {
-			sitemapNameList.add(sitemapList.get(i).getName());
-		}
-		AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(OpenHABWidgetListActivity.this);
-		dialogBuilder.setTitle("Select sitemap");
-		try {
-		dialogBuilder.setItems(sitemapNameList.toArray(new CharSequence[sitemapNameList.size()]),
-			new DialogInterface.OnClickListener() {
-				public void onClick(DialogInterface dialog, int item) {
-					Log.d(TAG, "Selected sitemap " + sitemapNameList.get(item));
-					SharedPreferences settings = 
-						PreferenceManager.getDefaultSharedPreferences(OpenHABWidgetListActivity.this);
-					Editor preferencesEditor = settings.edit();
-					preferencesEditor.putString("default_openhab_sitemap", sitemapList.get(item).getName());
-						preferencesEditor.commit();
-					openSitemap(sitemapList.get(item).getHomepageLink());
-				}
-			}).show();
-		} catch (BadTokenException e) {
-			Crittercism.logHandledException(e);
-		}
-	}
-	
-	private void openSitemap(String sitemapUrl) {
-		Log.i(TAG, "Opening sitemap at " + sitemapUrl);
-		displayPageUrl = sitemapUrl;
-		sitemapRootUrl = sitemapUrl;
-		showPage(displayPageUrl, false);
-    	OpenHABWidgetListActivity.this.getListView().setSelection(0);		
-	}
-
-	private String normalizeUrl(String sourceUrl) {
-		String normalizedUrl = "";
-		try {
-			URL url = new URL(sourceUrl);
-			normalizedUrl = url.toString();
-			normalizedUrl = normalizedUrl.replace("\n", "");
-			normalizedUrl = normalizedUrl.replace(" ", "");
-			if (!normalizedUrl.endsWith("/"))
-				normalizedUrl = normalizedUrl + "/";
-		} catch (MalformedURLException e) {
-			Log.d(TAG, "normalizeUrl: invalid URL");
-		}
-		return normalizedUrl;
-	}
-	
-}
diff --git a/src/org/openhab/habdroid/ui/OpenHABWidgetListFragment.java b/src/org/openhab/habdroid/ui/OpenHABWidgetListFragment.java
deleted file mode 100644
index ae17a3c88f4951ebedad8cbe31a5ae6501a010d4..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/ui/OpenHABWidgetListFragment.java
+++ /dev/null
@@ -1,497 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.ui;
-
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.os.Bundle;
-import android.os.Handler;
-import android.support.v4.app.ListFragment;
-import android.text.TextUtils;
-import android.util.Log;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.AdapterView;
-import android.widget.ListView;
-
-import com.loopj.android.http.AsyncHttpAbortException;
-
-import org.apache.http.Header;
-import org.apache.http.message.BasicHeader;
-import org.openhab.habdroid.R;
-import org.openhab.habdroid.core.DocumentHttpResponseHandler;
-import org.openhab.habdroid.model.OpenHABItem;
-import org.openhab.habdroid.model.OpenHABNFCActionList;
-import org.openhab.habdroid.model.OpenHABWidget;
-import org.openhab.habdroid.model.OpenHABWidgetDataSource;
-import org.openhab.habdroid.util.MyAsyncHttpClient;
-import org.openhab.habdroid.util.Util;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import java.net.SocketTimeoutException;
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * This class is apps' main fragment which displays list of openHAB
- * widgets from sitemap page with further navigation through sitemap and everything else!
- */
-
-public class OpenHABWidgetListFragment extends ListFragment {
-    private static final String TAG = "OpenHABWidgetListFragment";
-    private OnWidgetSelectedListener widgetSelectedListener;
-    // Datasource, providing list of openHAB widgets
-    private OpenHABWidgetDataSource openHABWidgetDataSource;
-    // List adapter for list view of openHAB widgets
-    private OpenHABWidgetAdapter openHABWidgetAdapter;
-    // Url of current sitemap page displayed
-    // Url of current sitemap page displayed
-    private String displayPageUrl;
-    // sitemap root url
-    private String sitemapRootUrl = "";
-    // openHAB base url
-    private String openHABBaseUrl = "https://demo.openhab.org:8443/";
-    // List of widgets to display
-    private ArrayList<OpenHABWidget> widgetList = new ArrayList<OpenHABWidget>();
-    // Username/password for authentication
-    private String openHABUsername = "";
-    private String openHABPassword = "";
-    // selected openhab widget
-    private OpenHABWidget selectedOpenHABWidget;
-    // widget Id which we got from nfc tag
-    private String nfcWidgetId;
-    // widget command which we got from nfc tag
-    private String nfcCommand;
-    // auto close app after nfc action is complete
-    private boolean nfcAutoClose = false;
-    // parent activity
-    private OpenHABMainActivity mActivity;
-    // loopj
-    private MyAsyncHttpClient mAsyncHttpClient;
-    // Am I visible?
-    private boolean mIsVisible = false;
-    private  OpenHABWidgetListFragment mTag;
-    private int mCurrentSelectedItem = -1;
-    private int mPosition;
-    private int mOldSelectedItem = -1;
-    private String mAtmosphereTrackingId;
-    //handlers will reconnect the network during outages
-    private Handler networkHandler = new Handler();
-    private Runnable networkRunnable;
-
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        Log.d(TAG, "onCreate()");
-        mTag = this;
-        super.onCreate(savedInstanceState);
-        if (savedInstanceState != null) {
-            Log.d(TAG, "restoring state from savedInstanceState");
-            displayPageUrl = savedInstanceState.getString("displayPageUrl");
-            openHABBaseUrl = savedInstanceState.getString("openHABBaseUrl");
-            sitemapRootUrl = savedInstanceState.getString("sitemapRootUrl");
-            openHABUsername = savedInstanceState.getString("openHABUsername");
-            openHABPassword = savedInstanceState.getString("openHABPassword");
-            mCurrentSelectedItem = savedInstanceState.getInt("currentSelectedItem", -1);
-            mPosition = savedInstanceState.getInt("position", -1);
-            Log.d(TAG, String.format("onCreate selected item = %d", mCurrentSelectedItem));
-        }
-        if (getArguments() != null) {
-            displayPageUrl = getArguments().getString("displayPageUrl");
-            openHABBaseUrl = getArguments().getString("openHABBaseUrl");
-            sitemapRootUrl = getArguments().getString("sitemapRootUrl");
-            openHABUsername = getArguments().getString("openHABUsername");
-            openHABPassword = getArguments().getString("openHABPassword");
-            mPosition = getArguments().getInt("position");
-        }
-        if (savedInstanceState != null)
-            if (!displayPageUrl.equals(savedInstanceState.getString("displayPageUrl")))
-                mCurrentSelectedItem = -1;
-    }
-
-    @Override
-    public void onActivityCreated(Bundle savedInstanceState) {
-        super.onActivityCreated(savedInstanceState);
-        Log.d(TAG, "onActivityCreated()");
-        mActivity = (OpenHABMainActivity)getActivity();
-        openHABWidgetDataSource = new OpenHABWidgetDataSource();
-        openHABWidgetAdapter = new OpenHABWidgetAdapter(getActivity(),
-                R.layout.openhabwidgetlist_genericitem, widgetList);
-        getListView().setAdapter(openHABWidgetAdapter);
-        openHABBaseUrl = mActivity.getOpenHABBaseUrl();
-        openHABUsername = mActivity.getOpenHABUsername();
-        openHABPassword = mActivity.getOpenHABPassword();
-        openHABWidgetAdapter.setOpenHABUsername(openHABUsername);
-        openHABWidgetAdapter.setOpenHABPassword(openHABPassword);
-        openHABWidgetAdapter.setOpenHABBaseUrl(openHABBaseUrl);
-        openHABWidgetAdapter.setAsyncHttpClient(mAsyncHttpClient);
-        getListView().setOnItemClickListener(new AdapterView.OnItemClickListener() {
-            public void onItemClick(AdapterView<?> parent, View view, int position,
-                                    long id) {
-                Log.d(TAG, "Widget clicked " + String.valueOf(position));
-                OpenHABWidget openHABWidget = openHABWidgetAdapter.getItem(position);
-                if (openHABWidget.hasLinkedPage()) {
-                    // Widget have a page linked to it
-                    String[] splitString;
-                    splitString = openHABWidget.getLinkedPage().getTitle().split("\\[|\\]");
-                    if (OpenHABWidgetListFragment.this.widgetSelectedListener != null) {
-                        widgetSelectedListener.onWidgetSelectedListener(openHABWidget.getLinkedPage(),
-                                OpenHABWidgetListFragment.this);
-                    }
-//                        navigateToPage(openHABWidget.getLinkedPage().getLink(), splitString[0]);
-                    mOldSelectedItem = position;
-                } else {
-                    Log.d(TAG, String.format("Click on item with no linked page, reverting selection to item %d", mOldSelectedItem));
-                    // If an item without a linked page is clicked this will clear the selection
-                    // and revert it to previously selected item (if any) when CHOICE_MODE_SINGLE
-                    // is switched on for widget listview in multi-column mode on tablets
-                    getListView().clearChoices();
-                    getListView().requestLayout();
-                    getListView().setItemChecked(mOldSelectedItem, true);
-                }
-            }
-
-        });
-        getListView().setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
-            public boolean onItemLongClick(AdapterView<?> parent, View view,
-                                           int position, long id) {
-                Log.d(TAG, "Widget long-clicked " + String.valueOf(position));
-                OpenHABWidget openHABWidget = openHABWidgetAdapter.getItem(position);
-                Log.d(TAG, "Widget type = " + openHABWidget.getType());
-                if (openHABWidget.getType().equals("Switch") || openHABWidget.getType().equals("Selection") ||
-                        openHABWidget.getType().equals("Colorpicker")) {
-                    selectedOpenHABWidget = openHABWidget;
-                    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
-                    builder.setTitle(R.string.nfc_dialog_title);
-                    OpenHABNFCActionList nfcActionList = new OpenHABNFCActionList(selectedOpenHABWidget);
-                    builder.setItems(nfcActionList.getNames(), new DialogInterface.OnClickListener() {
-                        public void onClick(DialogInterface dialog, int which) {
-                            Intent writeTagIntent = new Intent(getActivity().getApplicationContext(),
-                                    OpenHABWriteTagActivity.class);
-                            writeTagIntent.putExtra("sitemapPage", displayPageUrl);
-                            writeTagIntent.putExtra("item", selectedOpenHABWidget.getItem().getName());
-                            writeTagIntent.putExtra("itemType", selectedOpenHABWidget.getItem().getType());
-                            OpenHABNFCActionList nfcActionList =
-                                    new OpenHABNFCActionList(selectedOpenHABWidget);
-                            writeTagIntent.putExtra("command", nfcActionList.getCommands()[which]);
-                            startActivityForResult(writeTagIntent, 0);
-                            Util.overridePendingTransition(getActivity(), false);
-                            selectedOpenHABWidget = null;
-                        }
-                    });
-                    builder.show();
-                    return true;
-                }
-                return true;
-            }
-        });
-        if (getResources().getInteger(R.integer.pager_columns) > 1) {
-            Log.d(TAG, "More then 1 column, setting selector on");
-            getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
-        }
-    }
-
-    @Override
-    public void onAttach(Activity activity) {
-        super.onAttach(activity);
-        Log.d(TAG, "onAttach()");
-        if (activity instanceof OnWidgetSelectedListener) {
-            widgetSelectedListener = (OnWidgetSelectedListener)activity;
-            mActivity = (OpenHABMainActivity)activity;
-            mAsyncHttpClient = mActivity.getAsyncHttpClient();
-        } else {
-            Log.e("TAG", "Attached to incompatible activity");
-        }
-    }
-
-    @Override
-    public View onCreateView(LayoutInflater inflater, ViewGroup container,
-                             Bundle savedInstanceState) {
-        // Inflate the layout for this fragment
-        Log.i(TAG, "onCreateView");
-        return inflater.inflate(R.layout.openhabwidgetlist_fragment, container, false);
-    }
-
-    @Override
-    public void onViewCreated(View view, Bundle savedInstanceState) {
-        Log.d(TAG, "onViewCreated");
-        super.onViewCreated(view, savedInstanceState);
-    }
-
-    @Override
-    public void onPause () {
-        super.onPause();
-        Log.d(TAG, "onPause() " + displayPageUrl);
-        mAsyncHttpClient.cancelRequests(mActivity, mTag, true);
-
-        //remove any runtimes that may try to connect again
-        networkHandler.removeCallbacks(networkRunnable);
-
-        if (openHABWidgetAdapter != null) {
-            openHABWidgetAdapter.stopImageRefresh();
-            openHABWidgetAdapter.stopVideoWidgets();
-        }
-        mCurrentSelectedItem = getListView().getCheckedItemPosition();
-    }
-
-    @Override
-    public void onResume () {
-        super.onResume();
-        Log.d(TAG, "onResume() " + displayPageUrl);
-        if (displayPageUrl != null)
-            showPage(displayPageUrl, false);
-    }
-
-    @Override
-    public void onSaveInstanceState(Bundle savedInstanceState) {
-        Log.d(TAG, "onSaveInstanceState");
-        Log.d(TAG, String.format("onSave current selected item = %d", getListView().getCheckedItemPosition()));
-        savedInstanceState.putString("displayPageUrl", displayPageUrl);
-        savedInstanceState.putString("openHABBaseUrl", openHABBaseUrl);
-        savedInstanceState.putString("sitemapRootUrl", sitemapRootUrl);
-        savedInstanceState.putString("openHABUsername", openHABUsername);
-        savedInstanceState.putString("openHABPassword", openHABPassword);
-        savedInstanceState.putInt("currentSelectedItem", getListView().getCheckedItemPosition());
-        savedInstanceState.putInt("position", mPosition);
-        super.onSaveInstanceState(savedInstanceState);
-    }
-
-    @Override
-    public void setUserVisibleHint (boolean isVisibleToUser) {
-        super.setUserVisibleHint(isVisibleToUser);
-        mIsVisible = isVisibleToUser;
-        Log.d(TAG, String.format("isVisibleToUser(%B)", isVisibleToUser));
-    }
-
-    public static OpenHABWidgetListFragment withPage(String pageUrl, String baseUrl, String rootUrl,
-                                                     String username, String password, int position) {
-        Log.d(TAG, "withPage(" + pageUrl + ")");
-        OpenHABWidgetListFragment fragment = new OpenHABWidgetListFragment();
-        Bundle args = new Bundle();
-        args.putString("displayPageUrl", pageUrl);
-        args.putString("openHABBaseUrl", baseUrl);
-        args.putString("sitemapRootUrl", rootUrl);
-        args.putString("openHABUsername", username);
-        args.putString("openHABPassword", password);
-        args.putInt("position", position);
-        fragment.setArguments(args);
-        return fragment;
-    }
-
-    /**
-     * Loads data from sitemap page URL and passes it to processContent
-     *
-     * @param  pageUrl  an absolute base URL of openHAB sitemap page
-     * @param  longPolling  enable long polling when loading page
-     * @return      void
-     */
-    public void showPage(String pageUrl, final boolean longPolling) {
-        Log.i(TAG, " showPage for " + pageUrl + " longPolling = " + longPolling);
-        // Cancel any existing http request to openHAB (typically ongoing long poll)
-        if (!longPolling)
-            startProgressIndicator();
-        List<BasicHeader> headers = new LinkedList<BasicHeader>();
-        headers.add(new BasicHeader("Accept", "application/xml"));
-        headers.add(new BasicHeader("X-Atmosphere-Framework", "1.0"));
-        if (longPolling) {
-            mAsyncHttpClient.setTimeout(300000);
-            headers.add(new BasicHeader("X-Atmosphere-Transport", "long-polling"));
-            if (this.mAtmosphereTrackingId == null) {
-                headers.add(new BasicHeader("X-Atmosphere-tracking-id", "0"));
-            } else {
-                headers.add(new BasicHeader("X-Atmosphere-tracking-id", this.mAtmosphereTrackingId));
-            }
-        } else {
-            headers.add(new BasicHeader("X-Atmosphere-tracking-id", "0"));
-            mAsyncHttpClient.setTimeout(10000);
-        }
-        mAsyncHttpClient.get(mActivity, pageUrl, headers.toArray(new BasicHeader[] {}), null, new DocumentHttpResponseHandler() {
-            @Override
-            public void onSuccess(int statusCode, Header[] headers, Document document) {
-                for (int i=0; i<headers.length; i++) {
-                    Log.i(TAG, headers[i].getName() + ": " + headers[i].getValue());
-                    if (headers[i].getName().equalsIgnoreCase("X-Atmosphere-tracking-id")) {
-                        Log.i(TAG, "Found atmosphere tracking id: " + headers[i].getValue());
-                        OpenHABWidgetListFragment.this.mAtmosphereTrackingId = headers[i].getValue();
-                    }
-                }
-                if (document != null) {
-                    Log.d(TAG, "Response: "  + document.toString());
-                    if (!longPolling)
-                        stopProgressIndicator();
-                    processContent(document, longPolling);
-                } else {
-                    Log.e(TAG, "Got a null response from openHAB");
-                    showPage(displayPageUrl, true);
-                }
-            }
-            @Override
-            public void onFailure(Throwable error, String content) {
-                mAtmosphereTrackingId = null;
-                if (!longPolling)
-                    stopProgressIndicator();
-                if (error instanceof AsyncHttpAbortException) {
-                    Log.d(TAG, "Request for " + displayPageUrl + " was aborted");
-                    return;
-                }
-                if (error instanceof SocketTimeoutException) {
-                    Log.d(TAG, "Connection timeout, reconnecting");
-                    showPage(displayPageUrl, false);
-                    return;
-                } else {
-                    /*
-                    * If we get a network error try connecting again, if the
-                    * fragment is paused, the runnable will be removed
-                    */
-                    Log.e(TAG, error.getClass().toString());
-                    Log.e(TAG, "Connection error = " + error.getClass().toString() + ", cycle aborted");
-                    networkHandler.removeCallbacks(networkRunnable);
-                    networkRunnable =  new Runnable(){
-                        @Override
-                        public void run(){
-                            showPage(displayPageUrl, false);
-                        }
-                    };
-                    networkHandler.postDelayed(networkRunnable, 10 * 1000);
-                }
-            }
-        }, mTag);
-    }
-
-    /**
-     * Parse XML sitemap page and show it
-     *
-     * @param  document	XML Document
-     * @return      void
-     */
-    public void processContent(Document document, boolean longPolling) {
-        // As we change the page we need to stop all videos on current page
-        // before going to the new page. This is quite dirty, but is the only
-        // way to do that...
-        openHABWidgetAdapter.stopVideoWidgets();
-        openHABWidgetAdapter.stopImageRefresh();
-        Node rootNode = document.getFirstChild();
-        openHABWidgetDataSource.setSourceNode(rootNode);
-        widgetList.clear();
-        for (OpenHABWidget w : openHABWidgetDataSource.getWidgets()) {
-            // Remove frame widgets with no label text
-            if (w.getType().equals("Frame") && TextUtils.isEmpty(w.getLabel()))
-                continue;
-            widgetList.add(w);
-        }
-        openHABWidgetAdapter.notifyDataSetChanged();
-        if (!longPolling && isAdded()) {
-            getListView().clearChoices();
-            Log.d(TAG, String.format("processContent selectedItem = %d", mCurrentSelectedItem));
-            if (mCurrentSelectedItem >= 0)
-                getListView().setItemChecked(mCurrentSelectedItem, true);
-        }
-        if (getActivity() != null && mIsVisible)
-            getActivity().setTitle(openHABWidgetDataSource.getTitle());
-//            }
-        // Set widget list index to saved or zero position
-        // This would mean we got widget and command from nfc tag, so we need to do some automatic actions!
-        if (this.nfcWidgetId != null && this.nfcCommand != null) {
-            Log.d(TAG, "Have widget and command, NFC action!");
-            OpenHABWidget nfcWidget = this.openHABWidgetDataSource.getWidgetById(this.nfcWidgetId);
-            OpenHABItem nfcItem = nfcWidget.getItem();
-            // Found widget with id from nfc tag and it has an item
-            if (nfcWidget != null && nfcItem != null) {
-                // TODO: Perform nfc widget action here
-                if (this.nfcCommand.equals("TOGGLE")) {
-                    if (nfcItem.getType().equals("RollershutterItem")) {
-                        if (nfcItem.getStateAsBoolean())
-                            this.openHABWidgetAdapter.sendItemCommand(nfcItem, "UP");
-                        else
-                            this.openHABWidgetAdapter.sendItemCommand(nfcItem, "DOWN");
-                    } else {
-                        if (nfcItem.getStateAsBoolean())
-                            this.openHABWidgetAdapter.sendItemCommand(nfcItem, "OFF");
-                        else
-                            this.openHABWidgetAdapter.sendItemCommand(nfcItem, "ON");
-                    }
-                } else {
-                    this.openHABWidgetAdapter.sendItemCommand(nfcItem, this.nfcCommand);
-                }
-            }
-            this.nfcWidgetId = null;
-            this.nfcCommand = null;
-            if (this.nfcAutoClose) {
-                getActivity().finish();
-            }
-        }
-        showPage(displayPageUrl, true);
-    }
-
-    private void stopProgressIndicator() {
-        if (mActivity != null)
-            Log.d(TAG, "Stop progress indicator");
-            mActivity.stopProgressIndicator();
-    }
-
-    private void startProgressIndicator() {
-        if (mActivity != null)
-            Log.d(TAG, "Start progress indicator");
-            mActivity.startProgressIndicator();
-    }
-
-    private void showAlertDialog(String alertMessage) {
-        AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
-        builder.setMessage(alertMessage)
-                .setPositiveButton("OK", new DialogInterface.OnClickListener() {
-                    public void onClick(DialogInterface dialog, int id) {
-                    }
-                });
-        AlertDialog alert = builder.create();
-        alert.show();
-    }
-
-    public void setOpenHABUsername(String openHABUsername) {
-        this.openHABUsername = openHABUsername;
-    }
-
-    public void setOpenHABPassword(String openHABPassword) {
-        this.openHABPassword = openHABPassword;
-    }
-
-    public void setDisplayPageUrl(String displayPageUrl) {
-        this.displayPageUrl = displayPageUrl;
-    }
-
-    public String getDisplayPageUrl() {
-        return displayPageUrl;
-    }
-
-    public String getTitle() {
-        Log.d(TAG, "getPageTitle()");
-        if (openHABWidgetDataSource != null)
-            return openHABWidgetDataSource.getTitle();
-        return "";
-    }
-
-    public void clearSelection() {
-        if (getListView() != null && this.isVisible() && isAdded()) {
-            getListView().clearChoices();
-            getListView().requestLayout();
-        }
-    }
-
-    public int getPosition() {
-        return mPosition;
-    }
-
-}
diff --git a/src/org/openhab/habdroid/ui/OpenHABWriteTagActivity.java b/src/org/openhab/habdroid/ui/OpenHABWriteTagActivity.java
deleted file mode 100644
index b54c64b0a7cd54367e95c3a97744a88be1c8acb2..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/ui/OpenHABWriteTagActivity.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.ui;
-
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Timer;
-import java.util.TimerTask;
-
-import org.openhab.habdroid.R;
-import org.openhab.habdroid.util.Util;
-
-import com.google.analytics.tracking.android.EasyTracker;
-
-import android.nfc.FormatException;
-import android.nfc.NdefMessage;
-import android.nfc.NdefRecord;
-import android.nfc.NfcAdapter;
-import android.nfc.Tag;
-import android.nfc.tech.Ndef;
-import android.nfc.tech.NdefFormatable;
-import android.os.Bundle;
-import android.app.Activity;
-import android.app.PendingIntent;
-import android.content.Intent;
-import android.text.TextUtils;
-import android.util.Log;
-import android.view.Menu;
-import android.widget.TextView;
-
-public class OpenHABWriteTagActivity extends Activity {
-
-	// Logging TAG
-	private static final String TAG = "OpenHABWriteTagActivity";
-	private String sitemapPage = "";
-	private String item = "";
-	private String command = "";
-
-	@Override
-	public void onStart() {
-		super.onStart();
-		EasyTracker.getInstance().activityStart(this);
-	}
-	
-	@Override
-	public void onStop() {
-		super.onStop();
-		EasyTracker.getInstance().activityStop(this);
-	}
-
-	@Override
-	protected void onCreate(Bundle savedInstanceState) {
-		Util.setActivityTheme(this);
-		super.onCreate(savedInstanceState);
-		setContentView(R.layout.openhabwritetag);
-		TextView writeTagMessage = (TextView)findViewById(R.id.write_tag_message);
-    	if (!this.getPackageManager().hasSystemFeature("android.hardware.nfc")) {
-    		writeTagMessage.setText(R.string.info_write_tag_unsupported);
-    	} else if (NfcAdapter.getDefaultAdapter(this) != null) {
-    		if (!NfcAdapter.getDefaultAdapter(this).isEnabled()) {
-    			writeTagMessage.setText(R.string.info_write_tag_disabled);
-    		}
-    	}
-		if (getIntent().hasExtra("sitemapPage")) {
-			sitemapPage = getIntent().getExtras().getString("sitemapPage");
-			Log.d(TAG, "Got sitemapPage = " + sitemapPage);
-		}
-		if (getIntent().hasExtra("item")) {
-			item = getIntent().getExtras().getString("item");
-			Log.d(TAG, "Got item = " + item);
-		}
-		if (getIntent().hasExtra("command")) {
-			command = getIntent().getExtras().getString("command");
-			Log.d(TAG, "Got command = " + command);
-		}
-	}
-
-	@Override
-	public boolean onCreateOptionsMenu(Menu menu) {
-		// Inflate the menu; this adds items to the action bar if it is present.
-		getMenuInflater().inflate(R.menu.main_menu, menu);
-		return true;
-	}
-
-	@Override
-	public void onResume() {
-		Log.d(TAG, "onResume()");
-		super.onResume();
-		PendingIntent pendingIntent = PendingIntent.getActivity(
-				  this, 0, new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0);
-		if (NfcAdapter.getDefaultAdapter(this) != null)
-			NfcAdapter.getDefaultAdapter(this).enableForegroundDispatch(this, pendingIntent, null, null);
-	}
-
-	@Override
-	public void onPause() {
-		Log.d(TAG, "onPause()");
-		super.onPause();
-		if(NfcAdapter.getDefaultAdapter(this) != null)
-			NfcAdapter.getDefaultAdapter(this).disableForegroundDispatch(this);
-	}
-
-	public void onNewIntent(Intent intent) {
-	    Tag tagFromIntent = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
-	    String openhabURI = "";
-	    //do something with tagFromIntent
-	    Log.d(TAG, "NFC TAG = " + tagFromIntent.toString());
-	    Log.d(TAG, "Writing page " + sitemapPage + " to TAG");
-	    TextView writeTagMessage = (TextView)findViewById(R.id.write_tag_message);
-	    try {
-			URI sitemapURI = new URI(sitemapPage);
-			if (sitemapURI.getPath().startsWith("/rest/sitemaps")) {
-				openhabURI = "openhab://sitemaps" + sitemapURI.getPath().substring(14, sitemapURI.getPath().length());
-				if (!TextUtils.isEmpty(item)) {
-					openhabURI = openhabURI + "?item=" + item;
-				}
-				if (!TextUtils.isEmpty(command)) {
-					openhabURI = openhabURI + "&command=" + command;
-				}
-			}
-			Log.d(TAG, "URI = " + openhabURI);
-		    writeTagMessage.setText(R.string.info_write_tag_progress);
-		    writeTag(tagFromIntent, openhabURI);
-		} catch (URISyntaxException e) {
-			Log.e(TAG, e.getMessage());
-			writeTagMessage.setText(R.string.info_write_failed);
-		}
-	}
-
-	public void writeTag(Tag tag, String openhabUri) {
-		Log.d(TAG, "Creating tag object");
-	    TextView writeTagMessage = (TextView)findViewById(R.id.write_tag_message);
-        if (openhabUri == null) {
-            writeTagMessage.setText(R.string.info_write_failed);
-            return;
-        }
-        if (openhabUri.length() == 0) {
-            writeTagMessage.setText(R.string.info_write_failed);
-            return;
-        }
-		NdefRecord[] ndefRecords;
-		ndefRecords = new NdefRecord[1];
-		ndefRecords[0] = NdefRecord.createUri(openhabUri);
-		NdefMessage message = new NdefMessage(ndefRecords);
-		NdefFormatable ndefFormatable = NdefFormatable.get(tag);
-		if (ndefFormatable != null) {
-			Log.d(TAG, "Tag is uninitialized, formating");
-			try {
-				ndefFormatable.connect();
-				ndefFormatable.format(message);
-				ndefFormatable.close();
-			    writeTagMessage.setText(R.string.info_write_tag_finished);
-			    autoCloseActivity();
-			} catch (IOException e) {
-				// TODO Auto-generated catch block
-				if (e.getMessage() != null)
-					Log.e(TAG, e.getMessage());
-				writeTagMessage.setText(R.string.info_write_failed);
-			} catch (FormatException e) {
-				// TODO Auto-generated catch block
-				Log.e(TAG, e.getMessage());
-				writeTagMessage.setText(R.string.info_write_failed);
-			}
-		} else {
-			Log.d(TAG, "Tag is initialized, writing");
-			Ndef ndef = Ndef.get(tag);
-			if (ndef != null) {
-				try {
-					Log.d(TAG, "Connecting");
-					ndef.connect();
-					Log.d(TAG, "Writing");
-					if (ndef.isWritable()) {
-						ndef.writeNdefMessage(message);
-					}
-					Log.d(TAG, "Closing");
-					ndef.close();
-				    writeTagMessage.setText(R.string.info_write_tag_finished);
-				    autoCloseActivity();
-				} catch (IOException e) {
-					// TODO Auto-generated catch block
-					if (e != null)
-						Log.e(TAG, e.getMessage());
-				} catch (FormatException e) {
-					// TODO Auto-generated catch block
-					Log.e(TAG, e.getMessage());
-				}
-			} else {
-				Log.e(TAG, "Ndef == null");
-				writeTagMessage.setText(R.string.info_write_failed);
-			}
-		}
-	}
-	
-	@Override
-	public void finish() {
-		super.finish();
-		Util.overridePendingTransition(this, true);		
-	}
-	
-	private void autoCloseActivity() {
-		Timer autoCloseTimer = new Timer();
-		autoCloseTimer.schedule(new TimerTask() {
-			@Override
-			public void run() {
-				OpenHABWriteTagActivity.this.runOnUiThread(new Runnable() {
-					public void run() {
-						OpenHABWriteTagActivity.this.finish();
-					}
-				});
-				Log.d(TAG, "Autoclosing tag write activity");
-			}
-			
-		}, 2000);
-	}
-}
diff --git a/src/org/openhab/habdroid/ui/ScrollerCustomDuration.java b/src/org/openhab/habdroid/ui/ScrollerCustomDuration.java
deleted file mode 100644
index 9c42335147aa45637fee2a6812bcbc612748f391..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/ui/ScrollerCustomDuration.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.ui;
-
-import android.content.Context;
-import android.view.animation.Interpolator;
-import android.widget.Scroller;
-
-public class ScrollerCustomDuration extends Scroller {
-
-    private double mScrollFactor = 1;
-
-    public ScrollerCustomDuration(Context context) {
-        super(context);
-    }
-
-    public ScrollerCustomDuration(Context context, Interpolator interpolator) {
-        super(context, interpolator);
-    }
-
-    public ScrollerCustomDuration(Context context, Interpolator interpolator, boolean flywheel) {
-        super(context, interpolator, flywheel);
-    }
-
-    /**
-     * Set the factor by which the duration will change
-     */
-    public void setScrollDurationFactor(double scrollFactor) {
-        mScrollFactor = scrollFactor;
-    }
-
-    @Override
-    public void startScroll(int startX, int startY, int dx, int dy, int duration) {
-        super.startScroll(startX, startY, dx, dy, (int) (duration * mScrollFactor));
-    }
-
-}
\ No newline at end of file
diff --git a/src/org/openhab/habdroid/ui/StateRetainFragment.java b/src/org/openhab/habdroid/ui/StateRetainFragment.java
deleted file mode 100644
index 5da976ee3d2e2817c7fd8057175bea7e0ad2bb9d..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/ui/StateRetainFragment.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.ui;
-
-import android.os.Bundle;
-import android.support.v4.app.Fragment;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class StateRetainFragment extends Fragment {
-
-    private List<OpenHABWidgetListFragment> fragmentList = new ArrayList<OpenHABWidgetListFragment>(0);
-    private int mCurrentPage;
-
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setRetainInstance(true);
-    }
-
-    public List<OpenHABWidgetListFragment> getFragmentList() {
-        return fragmentList;
-    }
-
-    public void setFragmentList(List<OpenHABWidgetListFragment> fragmentList) {
-        this.fragmentList = fragmentList;
-    }
-
-    public int getCurrentPage() {
-        return mCurrentPage;
-    }
-
-    public void setCurrentPage(int currentPage) {
-        mCurrentPage = currentPage;
-    }
-}
diff --git a/src/org/openhab/habdroid/ui/drawer/OpenHABDrawerAdapter.java b/src/org/openhab/habdroid/ui/drawer/OpenHABDrawerAdapter.java
deleted file mode 100644
index 5e0555ab55b0e70b32295c122c5643fa71247bf7..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/ui/drawer/OpenHABDrawerAdapter.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.ui.drawer;
-
-import android.content.Context;
-import android.net.Uri;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ArrayAdapter;
-import android.widget.RelativeLayout;
-import android.widget.TextView;
-import org.openhab.habdroid.R;
-import org.openhab.habdroid.model.OpenHABSitemap;
-import org.openhab.habdroid.util.MySmartImageView;
-
-import java.util.List;
-
-public class OpenHABDrawerAdapter extends ArrayAdapter<OpenHABSitemap> {
-
-    public static final int TYPE_SITEMAPITEM = 0;
-    public static final int TYPES_COUNT = 1;
-    private static final String TAG = "OpenHABDrawerAdapter";
-    private String openHABBaseUrl = "http://demo.openhab.org:8080/";
-    private String openHABUsername = "";
-    private String openHABPassword = "";
-
-    public OpenHABDrawerAdapter(Context context, int resource,
-                                List<OpenHABSitemap> objects) {
-        super(context, resource, objects);
-    }
-
-    @SuppressWarnings("deprecation")
-    @Override
-    public View getView(int position, View convertView, ViewGroup parent) {
-        final RelativeLayout drawerItemView;
-        TextView drawerItemLabelTextView;
-        MySmartImageView drawerItemImage;
-        int drawerItemLayout;
-        OpenHABSitemap openHABSitemap = getItem(position);
-        switch (this.getItemViewType(position)) {
-            case TYPE_SITEMAPITEM:
-                drawerItemLayout = R.layout.openhabdrawer_item;
-                break;
-            default:
-                drawerItemLayout = R.layout.openhabdrawer_item;
-                break;
-        }
-        if (convertView == null) {
-            drawerItemView = new RelativeLayout(getContext());
-            String inflater = Context.LAYOUT_INFLATER_SERVICE;
-            LayoutInflater vi;
-            vi = (LayoutInflater)getContext().getSystemService(inflater);
-            vi.inflate(drawerItemLayout, drawerItemView, true);
-        } else {
-            drawerItemView = (RelativeLayout) convertView;
-        }
-        drawerItemLabelTextView = (TextView)drawerItemView.findViewById(R.id.itemlabel);
-        drawerItemImage = (MySmartImageView)drawerItemView.findViewById(R.id.itemimage);
-        if (openHABSitemap.getLabel() != null && drawerItemLabelTextView != null) {
-            drawerItemLabelTextView.setText(openHABSitemap.getLabel());
-        } else {
-            drawerItemLabelTextView.setText(openHABSitemap.getName());
-        }
-        if (openHABSitemap.getIcon() != null && drawerItemImage != null) {
-            String iconUrl = openHABBaseUrl + "images/" + Uri.encode(openHABSitemap.getIcon() + ".png");
-            drawerItemImage.setImageUrl(iconUrl, R.drawable.openhabiconsmall,
-                    openHABUsername, openHABPassword);
-        } else {
-            String iconUrl = openHABBaseUrl + "images/" + ".png";
-            drawerItemImage.setImageUrl(iconUrl, R.drawable.openhabiconsmall,
-                    openHABUsername, openHABPassword);
-        }
-        return drawerItemView;
-    }
-
-    @Override
-    public int getViewTypeCount() {
-        return TYPES_COUNT;
-    }
-
-    @Override
-    public int getItemViewType(int position) {
-        return TYPE_SITEMAPITEM;
-    }
-    public boolean areAllItemsEnabled() {
-        return false;
-    }
-
-    public boolean isEnabled(int position) {
-        return true;
-    }
-
-
-    public String getOpenHABBaseUrl() {
-        return openHABBaseUrl;
-    }
-
-    public void setOpenHABBaseUrl(String openHABBaseUrl) {
-        this.openHABBaseUrl = openHABBaseUrl;
-    }
-
-    public String getOpenHABUsername() {
-        return openHABUsername;
-    }
-
-    public void setOpenHABUsername(String openHABUsername) {
-        this.openHABUsername = openHABUsername;
-    }
-
-    public String getOpenHABPassword() {
-        return openHABPassword;
-    }
-
-    public void setOpenHABPassword(String openHABPassword) {
-        this.openHABPassword = openHABPassword;
-    }
-}
diff --git a/src/org/openhab/habdroid/ui/widget/ColorPicker.java b/src/org/openhab/habdroid/ui/widget/ColorPicker.java
deleted file mode 100644
index dd187a2bf65d5f790f6eed7434b53fca08ad0205..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/ui/widget/ColorPicker.java
+++ /dev/null
@@ -1,792 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.ui.widget;
-
-import org.openhab.habdroid.R;
-
-import android.content.Context;
-import android.content.res.TypedArray;
-import android.graphics.Canvas;
-import android.graphics.Color;
-import android.graphics.LinearGradient;
-import android.graphics.Paint;
-import android.graphics.RectF;
-import android.graphics.Shader;
-import android.graphics.Shader.TileMode;
-import android.graphics.SweepGradient;
-import android.os.Bundle;
-import android.os.Parcelable;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.view.MotionEvent;
-import android.view.View;
-
-/**
- * Displays a holo-themed color picker.
- *
- * <p>
- * Use {@link #getColor()} to retrieve the selected color.
- * </p>
- */
-public class ColorPicker extends View {
-
-	private static final String TAG = "ColorPicker";
-	/*
-	 * Constants used to save/restore the instance state.
-	 */
-	private static final String STATE_PARENT = "parent";
-	private static final String STATE_ANGLE = "angle";
-
-	/**
-	 * Colors to construct the color wheel using {@link SweepGradient}.
-	 *
-	 * <p>
-	 * Note: The algorithm in {@link #normalizeColor(int)} highly depends on these exact values. Be
-	 * aware that {@link #setColor(int)} might break if you change this array.
-	 * </p>
-	 */
-	private static final int[] COLORS = new int[] { 0xFFFF0000, 0xFFFF00FF, 0xFF0000FF, 0xFF00FFFF,
-		0xFF00FF00, 0xFFFFFF00, 0xFFFF0000 };
-
-	int[] BCOLORS = new int[] {0, 0, 0};
-
-	/**
-	 * {@code Paint} instance used to draw the color wheel.
-	 */
-	private Paint mColorWheelPaint;
-
-	/**
-	 * {@code Paint} instance used to draw the brightness slider.
-	 */
-	private Paint mBrightnessSliderPaint;
-
-	/**
-	 * {@code Paint} instance used to draw the saturation slider.
-	 */
-	private Paint mSaturationSliderPaint;
-
-	/**
-	 * {@code Paint} instance used to draw the color wheel pointer's "halo".
-	 */
-	private Paint mPointerHaloPaint;
-
-	/**
-	 * {@code Paint} instance used to draw the color wheel pointer (the selected color).
-	 */
-	private Paint mPointerColor;
-
-	/**
-	 * {@code Paint} instance used to draw the brightness pointer's "halo".
-	 */
-	private Paint mBrightnessPointerHaloPaint;
-
-	/**
-	 * {@code Paint} instance used to draw the border of brightness pointer.
-	 */
-	private Paint mBrightnessPointerBorderPaint;
-
-	/**
-	 * {@code Paint} instance used to draw the brightness pointer (the selected brightness).
-	 */
-	private Paint mBrightnessPointerColor;
-	
-	/**
-	 * {@code Paint} instance used to draw the brightness pointer's "halo".
-	 */
-	private Paint mSaturationPointerHaloPaint;
-
-	/**
-	 * {@code Paint} instance used to draw the brightness pointer (the selected brightness).
-	 */
-	private Paint mSaturationPointerColor;
-	
-	/**
-	 * The stroke width used to paint the color wheel (in pixels).
-	 */
-	private int mColorWheelStrokeWidth;
-
-	/**
-	 * The radius of the pointer (in pixels).
-	 */
-	private int mPointerRadius;
-
-	/**
-	 * The rectangle enclosing the color wheel.
-	 */
-	private RectF mColorWheelRectangle = new RectF();
-
-	/**
-	 * {@code true} if the user clicked on the color wheel pointer to start the move mode. {@code false} once
-	 * the user stops touching the screen.
-	 *
-	 * @see #onTouchEvent(MotionEvent)
-	 */
-	private boolean mUserIsMovingPointer = false;
-	
-	/**
-	 * {@code true} if the user clicked on the brightness pointer to start the move mode. {@code false} once
-	 * the user stops touching the screen.
-	 * 
-	 * @see #inTouchEvent(MotionEvent)
-	 */
-	private boolean mUserIsMovingBrightnessPointer = false;
-
-	/**
-	 * {@code true} if the user clicked on the brightness pointer to start the move mode. {@code false} once
-	 * the user stops touching the screen.
-	 * 
-	 * @see #inTouchEvent(MotionEvent)
-	 */
-	private boolean mUserIsMovingSaturationPointer = false;
-
-	/**
-	 * The ARGB value of the currently selected color.
-	 */
-	private int mColor;
-	
-	/**
-	 *  The value of currently selected brightness.
-	 */
-	private float mBrightness=1;
-
-	/**
-	 *  The value of currently selected brightness.
-	 */
-	private float mSaturation=1;
-	
-	/**
-	 *  The Y position of currently selected brightness.
-	 */
-	private float mBrightnessY;
-	
-	/**
-	 * The current final color calculated after brightness and saturation
-	 */
-
-	private int mBrightnessColor;
-
-	/**
-	 * The current HSV color selected by ColorPicker
-	 */
-	private float[] mHSVColor = {0,0,0};
-	
-	/**
-	 *  The Y position of currently selected brightness.
-	 */
-	private float mSaturationY;
-	
-	/**
-	 *  The current color calculated after saturation
-	 */
-	private int mSaturationColor;
-	
-	/**
-	 * Number of pixels the origin of this view is moved in X- and Y-direction.
-	 *
-	 * <p>
-	 * We use the center of this (quadratic) View as origin of our internal coordinate system.
-	 * Android uses the upper left corner as origin for the View-specific coordinate system. So this
-	 * is the value we use to translate from one coordinate system to the other.
-	 * </p>
-	 *
-	 * <p>Note: (Re)calculated in {@link #onMeasure(int, int)}.</p>
-	 *
-	 * @see #onDraw(Canvas)
-	 */
-	private float mTranslationOffset;
-
-	/**
-	 * Radius of the color wheel in pixels.
-	 *
-	 * <p>Note: (Re)calculated in {@link #onMeasure(int, int)}.</p>
-	 */
-	private float mColorWheelRadius;
-
-	/**
-	 * The pointer's position expressed as angle (in rad).
-	 */
-	private float mAngle;
-	
-	/**
-	 * The brightness slider X position
-	 */
-	private float mBrightnessSliderX;
-	
-	/**
-	 * The saturation slider X position
-	 */
-	private float mSaturationSliderX;
-	
-	/**
-	 * 
-	 */
-	private float mBrightnessSliderStartY;
-
-	/**
-	 * 
-	 */
-	private float mBrightnessSliderEndY;
-
-	/**
-	 * 
-	 */
-	private float mSaturationSliderStartY;
-
-	/**
-	 * 
-	 */
-	private float mSaturationSliderEndY;
-	
-	/**
-	 * Listener to send color change events to
-	 */
-    private OnColorChangedListener mListener;
-
-	public ColorPicker(Context context) {
-		super(context);
-		init(null, 0);
-	}
-
-	public ColorPicker(Context context, OnColorChangedListener l) {
-		super(context);
-		this.mListener = l;
-		init(null, 0);
-	}
-
-	public ColorPicker(Context context, AttributeSet attrs) {
-		super(context, attrs);
-		init(attrs, 0);
-	}
-
-	public ColorPicker(Context context, AttributeSet attrs, int defStyle) {
-		super(context, attrs, defStyle);
-		init(attrs, defStyle);
-	}
-
-	private void init(AttributeSet attrs, int defStyle) {
-		final TypedArray a = getContext().obtainStyledAttributes(attrs,
-				R.styleable.ColorPicker, defStyle, 0);
-
-		mColorWheelStrokeWidth = a.getInteger(R.styleable.ColorPicker_wheel_size, 16);
-		mPointerRadius = a.getInteger(R.styleable.ColorPicker_pointer_size, 32);
-		
-		// initialize X positions of brightness and saturation sliders
-		mBrightnessSliderX = mPointerRadius*2;
-		mSaturationSliderX = -mPointerRadius*2;
-		
-		Log.d(TAG, String.format("init %f %f %f %f", mBrightnessSliderStartY, mBrightnessSliderEndY, 
-				mSaturationSliderStartY, mSaturationSliderEndY));
-
-		a.recycle();
-
-		Shader s = new SweepGradient(0, 0, COLORS, null);
-
-		mColorWheelPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
-		mColorWheelPaint.setShader(s);
-		mColorWheelPaint.setStyle(Paint.Style.STROKE);
-		mColorWheelPaint.setStrokeWidth(mColorWheelStrokeWidth);
-
-		mBrightnessSliderPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
-
-		mPointerHaloPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
-		mPointerHaloPaint.setColor(Color.BLACK);
-		mPointerHaloPaint.setStrokeWidth(5);
-		mPointerHaloPaint.setAlpha(0x60);
-
-		mPointerColor = new Paint(Paint.ANTI_ALIAS_FLAG);
-		mPointerColor.setStrokeWidth(5);
-
-		mBrightnessPointerHaloPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
-		mBrightnessPointerHaloPaint.setColor(Color.BLACK);
-		mBrightnessPointerHaloPaint.setStrokeWidth(5);
-		mBrightnessPointerHaloPaint.setAlpha(0x60);
-		
-		mBrightnessPointerBorderPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
-		mBrightnessPointerBorderPaint.setColor(Color.WHITE);
-		mBrightnessPointerBorderPaint.setStrokeWidth(2);
-		mBrightnessPointerBorderPaint.setAlpha(0x60);
-
-		mBrightnessPointerColor = new Paint(Paint.ANTI_ALIAS_FLAG);
-		mBrightnessPointerColor.setStrokeWidth(5);
-
-		mSaturationSliderPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
-
-		mSaturationPointerHaloPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
-		mSaturationPointerHaloPaint.setColor(Color.BLACK);
-		mSaturationPointerHaloPaint.setStrokeWidth(5);
-		mSaturationPointerHaloPaint.setAlpha(0x60);
-
-		mSaturationPointerColor = new Paint(Paint.ANTI_ALIAS_FLAG);
-		mSaturationPointerColor.setStrokeWidth(5);
-
-		mAngle = (float) (-Math.PI / 2);
-		mPointerColor.setColor(calculateColor(mAngle));
-//		mBrightnessPointerColor.setColor(calculateColor(mAngle));
-		mBrightnessPointerColor.setColor(Color.BLACK);
-	}
-
-	@Override
-	protected void onDraw(Canvas canvas) {
-		Log.d(TAG, "onDraw");
-		// All of our positions are using our internal coordinate system. Instead of translating
-		// them we let Canvas do the work for us.
-		canvas.translate(mTranslationOffset, mTranslationOffset);
-
-		// Draw the color wheel.
-		canvas.drawOval(mColorWheelRectangle, mColorWheelPaint);
-
-		updateBrightnessAndSaturation();
-
-		// Draw the brightness slider
-		Shader brightnessShader = new LinearGradient(mBrightnessSliderX, mBrightnessSliderStartY,
-				mBrightnessSliderX, mBrightnessSliderEndY, mSaturationColor, Color.BLACK, 
-				TileMode.CLAMP);
-		mBrightnessSliderPaint.setShader(brightnessShader);
-		mBrightnessSliderPaint.setStyle(Paint.Style.STROKE);
-		mBrightnessSliderPaint.setStrokeWidth(mColorWheelStrokeWidth);
-		canvas.drawLine(mBrightnessSliderX, mBrightnessSliderStartY,
-						mBrightnessSliderX, mBrightnessSliderEndY, mBrightnessSliderPaint);
-		// Draw the saturation slider
-		Shader saturationShader = new LinearGradient(mSaturationSliderX, mSaturationSliderStartY,
-				mSaturationSliderX, mBrightnessSliderEndY, Color.WHITE, mPointerColor.getColor(),
-				TileMode.CLAMP);
-		mSaturationSliderPaint.setShader(saturationShader);
-		mSaturationSliderPaint.setStyle(Paint.Style.STROKE);
-		mSaturationSliderPaint.setStrokeWidth(mColorWheelStrokeWidth);
-		canvas.drawLine(mSaturationSliderX, mSaturationSliderStartY,
-				mSaturationSliderX, mSaturationSliderEndY, mSaturationSliderPaint);
-
-		float[] pointerPosition = calculatePointerPosition(mAngle);
-
-		// Draw the pointer's "halo"
-		canvas.drawCircle(pointerPosition[0], pointerPosition[1], mPointerRadius, mPointerHaloPaint);
-
-		// Draw the pointer (the currently selected color) slightly smaller on top.
-		canvas.drawCircle(pointerPosition[0], pointerPosition[1],
-				(float) (mPointerRadius / 1.2), mPointerColor);
-
-		// Draw the brightness pointer's "halo"
-		canvas.drawCircle(mBrightnessSliderX, mBrightnessY, mPointerRadius, mBrightnessPointerHaloPaint);
-		// Draw the brightness pointer's border
-		canvas.drawCircle(mBrightnessSliderX, mBrightnessY, mPointerRadius-2, mBrightnessPointerBorderPaint);
-		// Draw the pointer (the currently selected brightness) slightly smaller on top.
-		mBrightnessPointerColor.setColor(mBrightnessColor);
-		canvas.drawCircle(mBrightnessSliderX, mBrightnessY, (float) (mPointerRadius / 1.2), mBrightnessPointerColor);
-
-		// Draw the saturation pointer's "halo"
-		canvas.drawCircle(mSaturationSliderX, mSaturationY, mPointerRadius, mSaturationPointerHaloPaint);
-		// Draw the pointer (the currently selected saturation) slightly smaller on top.
-		mSaturationPointerColor.setColor(mSaturationColor);
-		canvas.drawCircle(mSaturationSliderX, mSaturationY, (float) (mPointerRadius / 1.2), mSaturationPointerColor);
-	}
-
-	@Override
-	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
-		int height = getDefaultSize(getSuggestedMinimumHeight(),
-				heightMeasureSpec);
-		int width = getDefaultSize(getSuggestedMinimumWidth(), widthMeasureSpec);
-		int min = Math.min(width, height);
-//		Log.i("ColorDemo", String.format("w = %d, h = %d", width, height));
-		setMeasuredDimension(min, min);		
-
-		mTranslationOffset = min * 0.5f;
-		mColorWheelRadius = mTranslationOffset - mPointerRadius;
-
-		mColorWheelRectangle.set(-mColorWheelRadius, -mColorWheelRadius, mColorWheelRadius,
-				mColorWheelRadius);
-
-		mBrightnessSliderEndY = (float)(mColorWheelRadius*0.5);
-		mBrightnessSliderStartY = (float)(-mColorWheelRadius*0.5);
-		mSaturationSliderEndY = (float)(mColorWheelRadius*0.5);
-		mSaturationSliderStartY = (float)(-mColorWheelRadius*0.5);
-	}
-
-	private int ave(int s, int d, float p) {
-		return s + java.lang.Math.round(p * (d - s));
-	}
-
-	/**
-	 * Calculate the color using the supplied angle.
-	 *
-	 * @param angle
-	 *         The selected color's position expressed as angle (in rad).
-	 *
-	 * @return The ARGB value of the color on the color wheel at the specified angle.
-	 */
-	private int calculateColor(float angle) {
-		float unit = (float) (angle / (2 * Math.PI));
-		if (unit < 0) {
-			unit += 1;
-		}
-
-		if (unit <= 0) {
-			return COLORS[0];
-		}
-		if (unit >= 1) {
-			return COLORS[COLORS.length - 1];
-		}
-
-		float p = unit * (COLORS.length - 1);
-		int i = (int) p;
-		p -= i;
-
-		int c0 = COLORS[i];
-		int c1 = COLORS[i + 1];
-		int a = ave(Color.alpha(c0), Color.alpha(c1), p);
-		int r = ave(Color.red(c0), Color.red(c1), p);
-		int g = ave(Color.green(c0), Color.green(c1), p);
-		int b = ave(Color.blue(c0), Color.blue(c1), p);
-
-		mColor = Color.argb(a, r, g, b);
-		return Color.argb(a, r, g, b);
-	}
-
-	/**
-	 * Get the currently selected color.
-	 *
-	 * @return The ARGB value of the currently selected color.
-	 */
-	public int getColor() {
-		return mColor;
-	}
-
-	/**
-	 * Set the color to be highlighted by the pointer.
-	 *
-	 * @param color
-	 *         The RGB value of the color to highlight. If this is not a color displayed on the
-	 *         color wheel a very simple algorithm is used to map it to the color wheel. The
-	 *         resulting color often won't look close to the original color. This is especially true
-	 *         for shades of grey. You have been warned!
-	 */
-	public void setColor(int color) {
-		mAngle = colorToAngle(color);
-		mPointerColor.setColor(calculateColor(mAngle));
-		invalidate();
-	}
-
-	public void setHSVColor(float[] hsv) {
-		Log.d(TAG, String.format("Setting color to %f %f %f", hsv[0], hsv[1], hsv[2]));
-		mAngle = this.colorToAngle(Color.HSVToColor(hsv));
-		mSaturation = hsv[1];
-		mBrightness = 1 - hsv[2];
-		mPointerColor.setColor(calculateColor(mAngle));
-		updateBrightnessAndSaturation();
-		postInvalidate();
-	}
-
-	/**
-	 * Convert a color to an angle.
-	 *
-	 * @param color
-	 *         The RGB value of the color to "find" on the color wheel. {@link #normalizeColor(int)}
-	 *         will be used to map this color to one on the color wheel if necessary.
-	 *
-	 * @return The angle (in rad) the "normalized" color is displayed on the color wheel.
-	 */
-	private float colorToAngle(int color) {
-		int[] colorInfo = normalizeColor(color);
-		int normColor = colorInfo[0];
-		int colorMask = colorInfo[1];
-		int shiftValue = colorInfo[2];
-
-		int anchorColor = (normColor & ~colorMask);
-
-		// Find the "anchor" color in the COLORS array
-		for (int i = 0; i < COLORS.length - 1; i++) {
-			if (COLORS[i] == anchorColor) {
-				int nextValue = COLORS[i + 1];
-
-				double value;
-				double decimals = ((normColor >> shiftValue) & 0xFF) / 255D;
-
-				// Find out if the gradient our color belongs to goes from the element just found to
-				// the next element in the array.
-				if ((nextValue & colorMask) != (anchorColor & colorMask)) {
-					// Compute value depending of the gradient direction
-					if (nextValue < anchorColor) {
-						value = i + 1 - decimals;
-					} else {
-						value = i + decimals;
-					}
-				} else {
-					// It's a gradient from this element to the previous element in the array.
-
-					// Wrap to the end of the array if the "anchor" color is the first element.
-					int index = (i == 0) ? COLORS.length - 1 : i;
-					int prevValue = COLORS[index - 1];
-
-					// Compute value depending of the gradient direction
-					if (prevValue < anchorColor) {
-						value = index - 1 + decimals;
-					} else {
-						value = index - decimals;
-					}
-				}
-
-				// Calculate the angle in rad (from -PI to PI)
-				float angle = (float) (2 * Math.PI * value / (COLORS.length - 1));
-				if (angle > Math.PI) {
-					angle -= 2 * Math.PI;
-				}
-
-				return angle;
-			}
-		}
-
-		// This shouldn't happen
-		return 0;
-	}
-
-	/**
-	 * "Normalize" the supplied color.
-	 *
-	 * <p>
-	 * This will set the lowest value of R,G,B to 0, the highest to 255, and will keep the middle
-	 * value.<br>
-	 * For values close to those on the color wheel this will result in close matches. For other
-	 * values, especially shades of grey this will produce funny results.
-	 * </p>
-	 *
-	 * @param color
-	 *         The color to "normalize".
-	 *
-	 * @return An {@code int} array with the following contents:
-	 *         <ol>
-	 *           <li>The ARGB value of the "normalized" color.</li>
-	 *           <li>A mask with all bits {@code 0} but those for the byte representing the
-	 *               "middle value" that remains unchanged in the "normalized" color.</li>
-	 *           <li>The number of bits the "normalized" color has to be shifted to the right so the
-	 *               "middle value" is in the lower 8 bits.</li>
-	 *         </ol>
-	 */
-	private int[] normalizeColor(int color) {
-		int red = Color.red(color);
-		int green = Color.green(color);
-		int blue = Color.blue(color);
-
-		int newRed = red;
-		int newGreen = green;
-		int newBlue = blue;
-
-		int maskRed = 0;
-		int maskGreen = 0;
-		int maskBlue = 0;
-		int shiftValue;
-
-		if (red < green && red < blue) {
-			// Red is the smallest component
-			newRed = 0;
-			if (green > blue) {
-				// Green is the largest component
-				shiftValue = 0;
-				maskBlue = 0xFF;
-				newGreen = 0xFF;
-			} else {
-				// We make blue the largest component
-				shiftValue = 8;
-				maskGreen = 0xFF;
-				newBlue = 0xFF;
-			}
-		} else if (green < red && green < blue) {
-			// Green is the smallest component
-			newGreen = 0;
-			if (red > blue) {
-				// Red is the largest component
-				shiftValue = 0;
-				maskBlue = 0xFF;
-				newRed = 0xFF;
-			} else {
-				// We make blue the largest component
-				shiftValue = 16;
-				maskRed = 0xFF;
-				newBlue = 0xFF;
-			}
-		} else {
-			// We make blue the smallest component
-			newBlue = 0;
-			if (red > green) {
-				// Red is the largest component
-				shiftValue = 8;
-				maskGreen = 0xFF;
-				newRed = 0xFF;
-			} else {
-				// We make green the largest component
-				shiftValue = 16;
-				maskRed = 0xFF;
-				newGreen = 0xFF;
-			}
-		}
-
-		int normColor = Color.argb(255, newRed, newGreen, newBlue);
-		int colorMask = Color.argb(0, maskRed, maskGreen, maskBlue);
-
-		return new int[] { normColor, colorMask, shiftValue };
-	}
-
-	@Override
-	public boolean onTouchEvent(MotionEvent event) {
-		// Convert coordinates to our internal coordinate system
-		float x = event.getX() - mTranslationOffset;
-		float y = event.getY() - mTranslationOffset;
-
-		switch (event.getAction()) {
-		case MotionEvent.ACTION_DOWN:
-			// Check whether the user pressed on (or near) the pointer
-			float[] pointerPosition = calculatePointerPosition(mAngle);
-			if (x >= (pointerPosition[0] - 48) && x <= (pointerPosition[0] + 48)
-					&& y >= (pointerPosition[1] - 48) && y <= (pointerPosition[1] + 48)) {
-//				Log.i("MotionEvent", String.format("down inside color x = %f, y = %f", x, y));
-				mUserIsMovingPointer = true;
-				invalidate();
-			} else if ((x >= mBrightnessSliderX-mPointerRadius && x <= mBrightnessSliderX+mPointerRadius) && 
-					(y >= mBrightnessSliderStartY-mPointerRadius/2 && y <= mBrightnessSliderEndY+mPointerRadius/2)) {
-//				Log.i("MotionEvent", String.format("down inside brightness x = %f, y = %f", x, y));
-				mUserIsMovingBrightnessPointer = true;
-			} else if ((x >= mSaturationSliderX-mPointerRadius/2 && x <= mSaturationSliderX+mPointerRadius/2) && 
-					(y >= mSaturationSliderStartY-mPointerRadius/2 && y <= mSaturationSliderEndY+mPointerRadius/2)) {
-//				Log.i("MotionEvent", String.format("down inside saturation x = %f, y = %f", x, y));
-				mUserIsMovingSaturationPointer = true;
-			}
-			break;
-		case MotionEvent.ACTION_MOVE:
-			if (mUserIsMovingPointer) {
-				mAngle = (float) java.lang.Math.atan2(y, x);
-				mPointerColor.setColor(calculateColor(mAngle));
-//				updateBrightnessAndSaturation();
-//				Log.i("MotionEvent", String.format("move inside color x = %f,  y = %f", x, y));
-				invalidate();
-			} else if (mUserIsMovingBrightnessPointer) {
-				if (y < mBrightnessSliderStartY)
-					y = mBrightnessSliderStartY;
-				if (y > mBrightnessSliderEndY)
-					y = mBrightnessSliderEndY;
-//				Log.i("MotionEvent", String.format("move inside brightness x = %f,  y = %f", x, y));
-				mBrightness = calculateSliderValue(mBrightnessSliderEndY,
-						mBrightnessSliderStartY, y);
-//				Log.d("MotionEvent", String.format("New brightness = %f", mBrightness));
-				invalidate();
-			} else if (mUserIsMovingSaturationPointer) {
-				if (y < mSaturationSliderStartY)
-					y = mSaturationSliderStartY;
-				if (y > mSaturationSliderEndY)
-					y = mSaturationSliderEndY;
-//				Log.i("MotionEvent", String.format("move inside saturation x = %f,  y = %f", x, y));
-				mSaturation = calculateSliderValue(mSaturationSliderEndY,
-						mSaturationSliderStartY, y);
-//				Log.d("MotionEvent", String.format("New saturation = %f", mSaturation));
-				invalidate();
-			}
-			break;
-		case MotionEvent.ACTION_UP:
-//			Log.i("MotionEvent", "up");
-			mUserIsMovingPointer = false;
-			mUserIsMovingBrightnessPointer = false;
-			mUserIsMovingSaturationPointer = false;
-			if (mListener != null) {
-				mListener.colorChanged(mHSVColor, this);
-			}
-			break;
-		}
-		return true;
-	}
-	
-	/**
-	 * Calculate a 0-255 value from minimum/maximum and position between them
-	 */
-	private float calculateSliderValue(float sliderMinimum, float sliderMaximum, float sliderPosition) {
-		float sliderSize = 0;
-		float sliderStart = 0;
-		if (sliderMinimum < sliderMaximum) {
-			sliderSize = sliderMaximum - sliderMinimum;
-			sliderStart = sliderMinimum;
-		} else {
-			sliderSize = sliderMinimum - sliderMaximum;
-			sliderStart = sliderMaximum;
-		}
-		sliderPosition = sliderPosition - sliderStart;
-		return sliderPosition/sliderSize;
-	}
-	
-	/**
-	 * Calculate color in between two colors based on a 0-1 position
-	 */
-	private int calculateSaturationColor(int saturationColor, float saturationValue) {
-		float baseHSV[] = {0, 0, 0};
-		Color.RGBToHSV(Color.red(saturationColor), Color.green(saturationColor), Color.blue(saturationColor), baseHSV);
-		baseHSV[1] = saturationValue;
-		return Color.HSVToColor(baseHSV);
-	}
-	
-	/**
-	 * Calculate final color based on on brightness 0-1
-	 */
-	
-	private int calculateFinalColor(int brightnessColor, float brightnessValue) {
-		float baseHSV[] = {0, 0, 0};
-		Color.RGBToHSV(Color.red(brightnessColor), Color.green(brightnessColor), Color.blue(brightnessColor), baseHSV);
-		baseHSV[1] = mSaturation;
-		baseHSV[2] = 1 - brightnessValue;
-		return Color.HSVToColor(baseHSV);
-	}
-
-	/**
-	 * Update brightness and saturation
-	 */
-
-	private void updateBrightnessAndSaturation() {
-		mBrightnessY = mBrightnessSliderStartY+(mBrightnessSliderEndY-mBrightnessSliderStartY)*mBrightness;
-		mSaturationY = mSaturationSliderStartY+(mSaturationSliderEndY-mSaturationSliderStartY)*mSaturation;
-		mSaturationColor = calculateSaturationColor(mPointerColor.getColor(), mSaturation);
-		mBrightnessColor = calculateFinalColor(mSaturationColor, mBrightness);
-		Color.colorToHSV(mBrightnessColor, mHSVColor);
-	}
-	
-	/**
-	 * Calculate the pointer's coordinates on the color wheel using the supplied angle.
-	 *
-	 * @param angle
-	 *         The position of the pointer expressed as angle (in rad).
-	 *
-	 * @return The coordinates of the pointer's center in our internal coordinate system.
-	 */
-	private float[] calculatePointerPosition(float angle) {
-		float x = (float) (mColorWheelRadius * Math.cos(angle));
-		float y = (float) (mColorWheelRadius * Math.sin(angle));
-
-		return new float[] { x, y };
-	}
-
-	@Override
-	protected Parcelable onSaveInstanceState() {
-		Parcelable superState = super.onSaveInstanceState();
-
-		Bundle state = new Bundle();
-		state.putParcelable(STATE_PARENT, superState);
-		state.putFloat(STATE_ANGLE, mAngle);
-
-		return state;
-	}
-
-	@Override
-	protected void onRestoreInstanceState(Parcelable state) {
-		Bundle savedState = (Bundle) state;
-
-		Parcelable superState = savedState.getParcelable(STATE_PARENT);
-		super.onRestoreInstanceState(superState);
-
-		mAngle = savedState.getFloat(STATE_ANGLE);
-		mPointerColor.setColor(calculateColor(mAngle));
-	}
-}
diff --git a/src/org/openhab/habdroid/ui/widget/ColorPickerDialog.java b/src/org/openhab/habdroid/ui/widget/ColorPickerDialog.java
deleted file mode 100644
index 97c68c2942028b3c767f8e761d63bd7d274a11eb..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/ui/widget/ColorPickerDialog.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.ui.widget;
-
-import android.app.Dialog;
-import android.content.Context;
-import android.os.Bundle;
-import android.util.Log;
-import android.view.View;
-
-public class ColorPickerDialog extends Dialog {
-
-	private static final String TAG = "ColorPickerDialog";
-    private OnColorChangedListener mListener;
-    private float[] mInitialColor;
-    private ColorPicker colorPickerView;
-    private Object tag;
-
-
-    public ColorPickerDialog(Context context,
-                             OnColorChangedListener listener,
-                             float[] initialColor) {
-        super(context);
- 
-        mListener = listener;
-        mInitialColor = initialColor;
-    }
- 
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        OnColorChangedListener l = new OnColorChangedListener() {
-            public void colorChanged(float[] color, View v) {
-                mListener.colorChanged(color, v);
-                Log.d(TAG, String.format("New color = %f %f %f", color[0], color[1], color[2]));
-//                dismiss();
-            }
-        };
-        // TODO: add initial color
-        this.colorPickerView = new ColorPicker(getContext(), l);
-        this.colorPickerView.setHSVColor(mInitialColor);
-        if (this.tag != null)
-        	this.colorPickerView.setTag(this.tag);
-        setContentView(this.colorPickerView);
-        setTitle("Pick a Color");
-    }
-
-	public View getView() {
-		return colorPickerView;
-	}
-
-	public Object getTag() {
-		return tag;
-	}
-
-	public void setTag(Object tag) {
-		this.tag = tag;
-		if (this.colorPickerView != null) {
-			this.colorPickerView.setTag(this.tag);
-		}
-	}
-}
diff --git a/src/org/openhab/habdroid/ui/widget/OnColorChangedListener.java b/src/org/openhab/habdroid/ui/widget/OnColorChangedListener.java
deleted file mode 100644
index 4588a725e55cb5378f8b34a977932ad3e6fbd490..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/ui/widget/OnColorChangedListener.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.ui.widget;
-
-import android.view.View;
-
-public interface OnColorChangedListener {
-    void colorChanged(float[] hsv, View v);
-}
diff --git a/src/org/openhab/habdroid/ui/widget/SegmentedControlButton.java b/src/org/openhab/habdroid/ui/widget/SegmentedControlButton.java
deleted file mode 100644
index 8912940218015417ed32c3bd45efcb76f1554d73..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/ui/widget/SegmentedControlButton.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- * This class is based on SegmentedControlButton by Benjamin Ferrari
- * http://bookworm.at
- * https://github.com/bookwormat/segcontrol
- * And extended to meet openHAB needs
- */
-
-package org.openhab.habdroid.ui.widget;
-
-import android.content.Context;
-import android.content.res.TypedArray;
-import android.graphics.Canvas;
-import android.graphics.Paint;
-import android.graphics.Paint.Style;
-import android.graphics.Rect;
-import android.graphics.drawable.Drawable;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.view.MotionEvent;
-import android.view.View;
-import android.widget.CompoundButton;
-import android.widget.RadioButton;
-import org.openhab.habdroid.R;
-
-/** @author benjamin ferrari */
-public class SegmentedControlButton extends RadioButton {
-
-    private Drawable backgroundSelected;
-
-    private int lineColor;
-
-    private int mLineHeightSelected;
-
-    private int lineHeightUnselected;
-
-    private float mX;
-
-    private int mTextColorSelected;
-
-    private int mTextColorUnselected;
-
-    private int mTextDistanceFromLine;
-
-    private Drawable backgroundUnselected;
-    private Paint textPaint;
-
-    private Paint linePaint;
-    
-    private int buttonIndex;
-
-    private OnClickListener mOnClickListener;
-
-    public SegmentedControlButton(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        init(attrs);
-    }
-
-    public SegmentedControlButton(Context context, AttributeSet attrs, int defStyle) {
-        super(context, attrs, defStyle);
-        init(attrs);
-    }
-
-    public Drawable getBackgroundSelected() {
-        return backgroundSelected;
-    }
-
-    public int getLineColor() {
-        return lineColor;
-    }
-
-    public int getLineHeightUnselected() {
-        return lineHeightUnselected;
-    }
-
-    public void init(AttributeSet attrs) {
-
-        if (attrs != null) {
-            TypedArray attributes = this.getContext().obtainStyledAttributes(attrs, R.styleable.SegmentedControlButton);
-            if (backgroundSelected == null) {
-                Drawable d = attributes.getDrawable(R.styleable.SegmentedControlButton_backgroundSelected);
-                backgroundSelected = d == null ? getBackground() : d;
-            }
-
-            if (backgroundUnselected == null) {
-                backgroundUnselected = this.getBackground();
-            }
-
-            this.lineColor = attributes.getColor(R.styleable.SegmentedControlButton_lineColor, 0);
-            this.mTextColorUnselected = attributes.getColor(R.styleable.SegmentedControlButton_textColorUnselected, 0);
-            this.mTextColorSelected = attributes.getColor(R.styleable.SegmentedControlButton_textColorSelected, 0);
-            this.lineHeightUnselected = attributes.getDimensionPixelSize(R.styleable.SegmentedControlButton_lineHeightUnselected, 0);
-            this.mLineHeightSelected = attributes.getDimensionPixelSize(R.styleable.SegmentedControlButton_lineHeightSelected, 0);
-            this.mTextDistanceFromLine = attributes.getDimensionPixelSize(R.styleable.SegmentedControlButton_textDistanceFromLine, 0);
-
-            textPaint = new Paint();
-            textPaint.setAntiAlias(true);
-            textPaint.setTextSize(this.getTextSize());
-            textPaint.setTextAlign(Paint.Align.CENTER);
-            linePaint = new Paint();
-            linePaint.setColor(this.getLineColor());
-            linePaint.setStyle(Style.FILL);
-        }
-
-        this.setOnCheckedChangeListener(new OnCheckedChangeListener() {
-            @Override
-            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
-                if (isChecked) {
-                    setBackgroundDrawable(backgroundSelected);
-                } else {
-                    setBackgroundDrawable(backgroundUnselected);
-                }
-            }
-        });
-
-        this.setOnTouchListener(new OnTouchListener() {
-            @Override
-            public boolean onTouch(View view, MotionEvent motionEvent) {
-                if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
-                    Log.i("SegmentedControlButton", "Button released");
-                    if (!isChecked())
-                        SegmentedControlButton.this.setBackgroundDrawable(backgroundUnselected);
-                } else if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
-                    Log.i("SegmentedControlButton", "Button pressed");
-                    SegmentedControlButton.this.setBackgroundDrawable(backgroundSelected);
-                    if (mOnClickListener != null)
-                        mOnClickListener.onClick(SegmentedControlButton.this);
-                }
-                return true;
-            }
-        });
-    }
-
-    @Override
-    public void setOnClickListener(OnClickListener onClickListener) {
-        mOnClickListener = onClickListener;
-    }
-
-    @Override
-    public void onDraw(Canvas canvas) {
-
-        String text = this.getText().toString();
-        int lineHeight;
-        if (isChecked()) {
-            lineHeight = mLineHeightSelected;
-            textPaint.setColor(mTextColorSelected);
-        } else {
-            lineHeight = this.getLineHeightUnselected();
-            textPaint.setColor(mTextColorUnselected);
-        }
-
-        int textHeightPos = this.getHeight() - mLineHeightSelected - mTextDistanceFromLine;
-
-        float x = mX;
-
-        Drawable background = getBackground();
-        background.setBounds(0, 0, getWidth(), getHeight());
-        background.draw(canvas);
-
-        canvas.drawText(text, x, textHeightPos, textPaint);
-
-        if (lineHeight > 0) {
-            Rect rect = new Rect(0, this.getHeight() - lineHeight, getWidth(), this.getHeight());
-            canvas.drawRect(rect, linePaint);
-        }
-
-    }
-
-    @Override
-    protected void onSizeChanged(int w, int h, int ow, int oh) {
-        super.onSizeChanged(w, h, ow, oh);
-        mX = w * 0.5f; // remember the center of the screen
-    }
-
-    public void setLineColor(int lineColor) {
-        this.lineColor = lineColor;
-    }
-
-    public void setTextColorSelected(int textColorSelected) {
-        this.mTextColorSelected = textColorSelected;
-    }
-
-    public void setTextColorUnselected(int textColor) {
-        this.mTextColorUnselected = textColor;
-    }
-
-    public void setTextDistanceFromLine(int textDistanceFromLine) {
-        mTextDistanceFromLine = textDistanceFromLine;
-    }
-
-	public int getButtonIndex() {
-		return buttonIndex;
-	}
-
-	public void setButtonIndex(int buttonIndex) {
-		this.buttonIndex = buttonIndex;
-	}
-
-}
diff --git a/src/org/openhab/habdroid/util/AsyncServiceResolver.java b/src/org/openhab/habdroid/util/AsyncServiceResolver.java
deleted file mode 100644
index a21caef1459c22d6d3683c3ad556385f71eea609..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/util/AsyncServiceResolver.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.util;
-
-import java.io.IOException;
-import java.net.Inet4Address;
-import java.net.InetAddress;
-import java.net.NetworkInterface;
-import java.net.SocketException;
-import java.util.Enumeration;
-
-import javax.jmdns.JmDNS;
-import javax.jmdns.ServiceEvent;
-import javax.jmdns.ServiceInfo;
-import javax.jmdns.ServiceListener;
-
-import com.crittercism.app.Crittercism;
-
-import android.app.Activity;
-import android.content.Context;
-import android.net.wifi.WifiManager;
-import android.net.wifi.WifiManager.MulticastLock;
-import android.util.Log;
-
-public class AsyncServiceResolver extends Thread implements ServiceListener {
-	private final static String TAG = "AsyncServiceResolver";
-	private Context mCtx;
-	// Multicast lock for mDNS
-	private MulticastLock mMulticastLock;
-	// mDNS service
-	private JmDNS mJmdns;
-	private String mServiceType;
-	private ServiceInfo mResolvedServiceInfo;
-	private static Thread mSleepingThread;
-	private boolean mIsResolved = false;
-    private AsyncServiceResolverListener mListener;
-    private final static int mDefaultDiscoveryTimeout = 3000;
-	
-	public AsyncServiceResolver(Context context, String serviceType) {
-		super();
-		mCtx = context;
-		mServiceType = serviceType;
-        if (context instanceof AsyncServiceResolverListener)
-            mListener = (AsyncServiceResolverListener)context;
-	}
-
-    public AsyncServiceResolver(Context context, AsyncServiceResolverListener listener, String serviceType) {
-        super();
-        mCtx = context;
-        mServiceType = serviceType;
-        mListener = listener;
-    }
-
-    public void run() {
-		WifiManager wifi =
-		           (android.net.wifi.WifiManager)
-		              mCtx.getSystemService(android.content.Context.WIFI_SERVICE);
-		mMulticastLock = wifi.createMulticastLock("HABDroidMulticastLock");
-		mMulticastLock.setReferenceCounted(true);
-		try {
-			mMulticastLock.acquire();
-		} catch (SecurityException e) {
-			Log.i(TAG, "Security exception during multicast lock");
-			Crittercism.logHandledException(e);
-		}
-		mSleepingThread = Thread.currentThread();
-		Log.i(TAG, "Discovering service " + mServiceType);
-		try {
-//			Log.i(TAG, "Local IP:"  + getLocalIpv4Address().getHostAddress().toString());
-			/* TODO: This is a dirty fix of some crazy ipv6 incompatibility
-			   This workaround makes JMDNS work on local ipv4 address an thus
-			   discover openHAB on ipv4 address. This should be fixed to fully
-			   support ipv6 in future. */
-            mJmdns = JmDNS.create(getLocalIpv4Address());
-			mJmdns.addServiceListener(mServiceType, this);
-		} catch (IOException e) {
-			Log.e(TAG, e.getMessage());
-		}
-		try {
-			// Sleep for specified timeout
-			Thread.sleep(mDefaultDiscoveryTimeout);
-			if (!mIsResolved) {
-				((Activity) mCtx).runOnUiThread(new Runnable() {
-					public void run() {
-						mListener.onServiceResolveFailed();
-					}
-				});
-				shutdown();
-			}
-		} catch (InterruptedException e) {
-		}
-	}
-
-	public void serviceAdded(ServiceEvent event) {
-        Log.d(TAG, "Service Added " + event.getName());
-		mJmdns.requestServiceInfo(event.getType(), event.getName(), 1);
-	}
-
-	public void serviceRemoved(ServiceEvent event) {
-	}
-
-	public void serviceResolved(ServiceEvent event) {
-		mResolvedServiceInfo = event.getInfo();
-		mIsResolved = true;
-		((Activity) mCtx).runOnUiThread(new Runnable() {
-			public void run() {
-				mListener.onServiceResolved(mResolvedServiceInfo);
-			}
-		});
-		shutdown();
-		mSleepingThread.interrupt();
-	}
-
-	private void shutdown() {
-		if (mMulticastLock != null)
-			mMulticastLock.release();
-		if (mJmdns != null) {
-			mJmdns.removeServiceListener(mServiceType, this);
-			try {
-				mJmdns.close();
-			} catch (IOException e) {
-				Log.e(TAG, e.getMessage());
-			}
-		}
-	}
-	
-	private InetAddress getLocalIpv4Address() {
-	    try {
-	        for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) {
-	            NetworkInterface intf = en.nextElement();
-	            for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) {
-	                InetAddress inetAddress = enumIpAddr.nextElement();
-	                Log.i(TAG, "IP: " + inetAddress.getHostAddress().toString());
-	                Log.i(TAG, "Is IPV4 = " + (inetAddress instanceof Inet4Address));
-	                if (!inetAddress.isLoopbackAddress() && (inetAddress instanceof Inet4Address)) {
-                        Log.i(TAG, "Selected " + inetAddress.getHostAddress().toString());
-	                    return inetAddress;
-	                }
-	            }
-	        }
-	    } catch (SocketException ex) {
-	        Log.e(TAG, ex.toString());
-	    }
-	    return null;
-	}
-}
diff --git a/src/org/openhab/habdroid/util/AsyncServiceResolverListener.java b/src/org/openhab/habdroid/util/AsyncServiceResolverListener.java
deleted file mode 100644
index 957328b4c1b5587795732e8f9ab3dfd7a5ae415c..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/util/AsyncServiceResolverListener.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.util;
-
-import javax.jmdns.ServiceInfo;
-
-public interface AsyncServiceResolverListener {
-	public void onServiceResolved(ServiceInfo serviceInfo);
-	public void onServiceResolveFailed();
-}
diff --git a/src/org/openhab/habdroid/util/MjpegInputStream.java b/src/org/openhab/habdroid/util/MjpegInputStream.java
deleted file mode 100644
index 0728cacc17b26934484c1a595987f02683b21480..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/util/MjpegInputStream.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.util;
-
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-
-import java.io.BufferedInputStream;
-import java.io.ByteArrayInputStream;
-import java.io.DataInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-public class MjpegInputStream extends DataInputStream {
-    private static final String TAG = "MjpegInputStream";
-
-    private final byte[] SOI_MARKER = { (byte) 0xFF, (byte) 0xD8 };
-    private final byte[] EOF_MARKER = { (byte) 0xFF, (byte) 0xD9 };
-    private final String CONTENT_LENGTH = "Content-Length";
-    private final static int HEADER_MAX_LENGTH = 100;
-    private final static int FRAME_MAX_LENGTH = 400000 + HEADER_MAX_LENGTH;
-    private int mContentLength = -1;
-
-    public MjpegInputStream(InputStream in) {
-        super(new BufferedInputStream(in, FRAME_MAX_LENGTH));
-    }
-
-    private int getEndOfSeqeunce(DataInputStream in, byte[] sequence) throws IOException {
-        int seqIndex = 0;
-        byte c;
-        for(int i=0; i < FRAME_MAX_LENGTH; i++) {
-            c = (byte) in.readUnsignedByte();
-            if(c == sequence[seqIndex]) {
-                seqIndex++;
-                if(seqIndex == sequence.length) {
-                    return i + 1;
-                }
-            } else {
-                seqIndex = 0;
-            }
-        }
-        return -1;
-    }
-
-    private int getStartOfSequence(DataInputStream in, byte[] sequence) throws IOException {
-        int end = getEndOfSeqeunce(in, sequence);
-        return (end < 0) ? (-1) : (end - sequence.length);
-    }
-
-    private int parseContentLength(byte[] headerBytes) throws IOException, NumberFormatException {
-        ByteArrayInputStream headerIn = new ByteArrayInputStream(headerBytes);
-        Properties props = new Properties();
-        props.load(headerIn);
-        return Integer.parseInt(props.getProperty(CONTENT_LENGTH));
-    }
-
-    public Bitmap readMjpegFrame() throws IOException {
-        mark(FRAME_MAX_LENGTH);
-        int headerLen = getStartOfSequence(this, SOI_MARKER);
-        reset();
-        byte[] header = new byte[headerLen];
-        readFully(header);
-        try {
-            mContentLength = parseContentLength(header);
-        } catch (NumberFormatException nfe) {
-            mContentLength = getEndOfSeqeunce(this, EOF_MARKER);
-        }
-        reset();
-        byte[] frameData = new byte[mContentLength];
-        skipBytes(headerLen);
-        readFully(frameData);
-        return BitmapFactory.decodeStream(new ByteArrayInputStream(frameData));
-    }
-}
\ No newline at end of file
diff --git a/src/org/openhab/habdroid/util/MjpegStreamer.java b/src/org/openhab/habdroid/util/MjpegStreamer.java
deleted file mode 100644
index 74e4cb519feb71ff429f4b8bdfafaa69396bc5b4..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/util/MjpegStreamer.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.util;
-
-import android.content.Context;
-import android.graphics.Bitmap;
-import android.os.AsyncTask;
-import android.os.Handler;
-import android.os.Message;
-import android.util.Log;
-import android.widget.ImageView;
-
-import org.apache.http.HttpResponse;
-import org.apache.http.auth.AuthScope;
-import org.apache.http.auth.UsernamePasswordCredentials;
-import org.apache.http.client.ClientProtocolException;
-import org.apache.http.client.CredentialsProvider;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.impl.client.BasicCredentialsProvider;
-import org.apache.http.impl.client.DefaultHttpClient;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-
-public class MjpegStreamer {
-
-    private static final String TAG = "MjpegStreamer";
-    private String mSourceUrl;
-    private String mUsername;
-    private String mPassword;
-    private MjpegInputStream mInputStream;
-    private boolean mRunning = false;
-    private Handler mHandler;
-    private Context mCtx;
-    private int mId;
-    private ImageView mTargetImageView;
-    private DownloadImageTask mDownloadImageTask;
-
-    public MjpegStreamer(String sourceUrl, String username, String password, Context ctx){
-        mSourceUrl = sourceUrl;
-        mUsername = username;
-        mPassword = password;
-        mCtx = ctx;
-        mHandler = new Handler(new Handler.Callback() {
-            @Override
-            public boolean handleMessage(Message msg) {
-                Bitmap bmp = (Bitmap) msg.obj;
-                if (mTargetImageView != null)
-                    mTargetImageView.setImageBitmap(bmp);
-                return false;
-            }
-        });
-    }
-
-    public void start() {
-        mDownloadImageTask = startTask(this, 1, false, mHandler);
-    }
-
-    public void stop() {
-        if (mDownloadImageTask != null)
-            mDownloadImageTask.cancel(true);
-    }
-
-    public void setTargetImageView(ImageView targetImageView) {
-        mTargetImageView = targetImageView;
-    }
-
-    public void startStream(Handler handler, int id){
-        mHandler = handler;
-        mId = id;
-        mInputStream = new MjpegInputStream(httpRequest(mSourceUrl, mUsername, mPassword));
-        mRunning = true;
-    }
-
-    public void getFrame(){
-        Bitmap mBitmap;
-        try {
-            mBitmap = mInputStream.readMjpegFrame();
-            Message m = mHandler.obtainMessage(mId, mBitmap);
-            m.sendToTarget();
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-    }
-
-    public InputStream httpRequest(String url, String usr, String pwd){
-        HttpResponse res = null;
-        DefaultHttpClient httpclient = new DefaultHttpClient();
-        CredentialsProvider credProvider = new BasicCredentialsProvider();
-        credProvider.setCredentials(new AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT),
-                new UsernamePasswordCredentials(usr, pwd));
-        httpclient.setCredentialsProvider(credProvider);
-        Log.d(TAG, "1. Sending http request");
-        try {
-            res = httpclient.execute(new HttpGet(URI.create(url)));
-            Log.d(TAG, "2. Request finished, status = " + res.getStatusLine().getStatusCode());
-            if(res.getStatusLine().getStatusCode()==401){
-                //You must turn off camera User Access Control before this will work
-                return null;
-            }
-            Log.d(TAG, "content-type = " + res.getEntity().getContentType());
-            Log.d(TAG, "content-encoding = " + res.getEntity().getContentEncoding());
-            return res.getEntity().getContent();
-        } catch (ClientProtocolException e) {
-            e.printStackTrace();
-            Log.d(TAG, "Request failed-ClientProtocolException", e);
-            //Error connecting to camera
-        } catch (IOException e) {
-            e.printStackTrace();
-            Log.d(TAG, "Request failed-IOException", e);
-            //Error connecting to camera
-        }
-
-        return null;
-
-    }
-
-    private DownloadImageTask startTask(MjpegStreamer cam, int id, boolean useParallelExecution, Handler h) {
-        DownloadImageTask task = new DownloadImageTask(cam, id);
-        if (useParallelExecution) {
-            task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
-        } else {
-            task.execute(h);
-        }
-        return task;
-    }
-
-    private class DownloadImageTask extends AsyncTask<Handler, Void, Void> {
-        MjpegStreamer cam;
-        int id;
-        DownloadImageTask(MjpegStreamer cam, int id){
-            this.cam = cam;
-            this.id = id;
-        }
-
-        protected Void doInBackground(Handler... h) {
-            cam.startStream(h[0], id);
-            while (!isCancelled()) {
-                cam.getFrame();
-            }
-            return null;
-        }
-    }
-}
\ No newline at end of file
diff --git a/src/org/openhab/habdroid/util/MyAsyncHttpClient.java b/src/org/openhab/habdroid/util/MyAsyncHttpClient.java
deleted file mode 100644
index c645b58b6ed588a30ed316994e8a912ae70d794f..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/util/MyAsyncHttpClient.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.util;
-
-import android.content.Context;
-import android.preference.PreferenceManager;
-
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.X509TrustManager;
-
-import org.apache.http.conn.ssl.SSLSocketFactory;
-
-import com.loopj.android.http.AsyncHttpClient;
-
-import de.duenndns.ssl.MemorizingTrustManager;
-
-public class MyAsyncHttpClient extends AsyncHttpClient {
-	
-	private SSLContext sslContext;
-	private SSLSocketFactory sslSocketFactory;
-	
-	public MyAsyncHttpClient(Context ctx) {
-		super(ctx);
-		try {
-	        sslContext = SSLContext.getInstance("TLS");
-	        sslContext.init(null, MemorizingTrustManager.getInstanceList(ctx), new java.security.SecureRandom());
-	        sslSocketFactory = new MySSLSocketFactory(sslContext);
-            if (PreferenceManager.getDefaultSharedPreferences(ctx).getBoolean("default_openhab_sslhost", false))
-                sslSocketFactory.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
-	        this.setSSLSocketFactory(sslSocketFactory);
-	    } catch (Exception ex) {
-	    }
-	}
-}
diff --git a/src/org/openhab/habdroid/util/MySSLSocketFactory.java b/src/org/openhab/habdroid/util/MySSLSocketFactory.java
deleted file mode 100644
index 1bba58e429095b16c9b8120fb29b43fe1a9baa0c..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/util/MySSLSocketFactory.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.util;
-
-import java.io.IOException;
-import java.net.Socket;
-import java.net.UnknownHostException;
-import java.security.KeyManagementException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.UnrecoverableKeyException;
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.X509TrustManager;
-
-import org.apache.http.conn.ssl.SSLSocketFactory;
-
-public class MySSLSocketFactory extends SSLSocketFactory {
-    SSLContext sslContext = SSLContext.getInstance("TLS");
-
-    public MySSLSocketFactory(KeyStore truststore) throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException {
-        super(truststore);
-
-        TrustManager tm = new X509TrustManager() {
-            public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
-            }
-
-            public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
-            }
-
-            public X509Certificate[] getAcceptedIssuers() {
-                return null;
-            }
-        };
-
-        sslContext.init(null, new TrustManager[] { tm }, null);
-    }
-
-    public MySSLSocketFactory(SSLContext context) throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException, UnrecoverableKeyException {
-    	super((KeyStore) null);
-       sslContext = context;
-    }
-    
-    @Override
-    public Socket createSocket(Socket socket, String host, int port, boolean autoClose) throws IOException, UnknownHostException {
-        return sslContext.getSocketFactory().createSocket(socket, host, port, autoClose);
-    }
-
-    @Override
-    public Socket createSocket() throws IOException {
-        return sslContext.getSocketFactory().createSocket();
-    }
-}
diff --git a/src/org/openhab/habdroid/util/MySmartImageView.java b/src/org/openhab/habdroid/util/MySmartImageView.java
deleted file mode 100644
index c29f32ff70db6f13806147357e494a8be2e991a6..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/util/MySmartImageView.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.util;
-
-import java.util.Timer;
-import java.util.TimerTask;
-import android.content.Context;
-import android.os.Handler;
-import android.os.Message;
-import android.util.AttributeSet;
-import android.util.Log;
-
-import com.loopj.android.image.SmartImageView;
-
-public class MySmartImageView extends SmartImageView {
-	private String myImageUrl;
-	private Timer imageRefreshTimer;
-	
-	boolean useImageCache = true;
-
-	public MySmartImageView(Context context) {
-		super(context);
-	}
-	
-    public MySmartImageView(Context context, AttributeSet attrs) {
-        super(context, attrs);
-    }
-
-    public MySmartImageView(Context context, AttributeSet attrs, int defStyle) {
-        super(context, attrs, defStyle);
-    }
-
-    public void setImageUrl(String url) {
-    	this.myImageUrl = url;
-        setImage(new MyWebImage(url));
-    }
-
-    public void setImageUrl(String url, String username, String password) {
-    	this.myImageUrl = url;
-        setImage(new MyWebImage(url, username, password));
-    }
-    
-    public void setImageUrl(String url, final Integer fallbackResource) {
-    	this.myImageUrl = url;
-        setImage(new MyWebImage(url), fallbackResource, null);
-    }
-
-    public void setImageUrl(String url, final Integer fallbackResource, String username, String password) {
-    	this.myImageUrl = url;
-        setImage(new MyWebImage(url, username, password), fallbackResource, null);
-    }
-    
-    public void setImageUrl(String url, final Integer fallbackResource, final Integer loadingResource) {
-    	this.myImageUrl = url;
-        setImage(new MyWebImage(url), fallbackResource, loadingResource);
-    }
-
-    public void setImageUrl(String url, final Integer fallbackResource, final Integer loadingResource, String username, String password) {
-    	this.myImageUrl = url;
-        setImage(new MyWebImage(url, username, password), fallbackResource, loadingResource);
-    }
-    
-    public void setImageUrl(String url, boolean useImageCache) {
-    	this.myImageUrl = url;
-    	this.useImageCache = useImageCache;
-        setImage(new MyWebImage(url, useImageCache));
-    }
-
-    public void setImageUrl(String url, boolean useImageCache, String username, String password) {
-    	this.myImageUrl = url;
-    	this.useImageCache = useImageCache;
-        setImage(new MyWebImage(url, useImageCache, username, password));
-    }
-    
-    public void setRefreshRate(int msec) {
-    	Log.i("MySmartImageView", "Setting image refresh rate to " + msec + " msec");
-    	if (this.imageRefreshTimer != null)
-    		this.imageRefreshTimer.cancel();
-    	this.imageRefreshTimer = new Timer();
-    	final Handler timerHandler = new Handler() {
-    		public void handleMessage(Message msg) {
-				Log.i("MySmartImageView", "Refreshing image at " + MySmartImageView.this.myImageUrl);
-				MySmartImageView.this.setImage(new MyWebImage(MySmartImageView.this.myImageUrl, false));
-    		}
-    	};
-    	imageRefreshTimer.scheduleAtFixedRate(new TimerTask() {
-			@Override
-			public void run() {
-				timerHandler.sendEmptyMessage(0);
-			}
-    	}, msec, msec);
-    }
-    
-    public void cancelRefresh() {
-    	if (this.imageRefreshTimer != null)
-    		this.imageRefreshTimer.cancel();
-    }
-
-}
diff --git a/src/org/openhab/habdroid/util/MyWebImage.java b/src/org/openhab/habdroid/util/MyWebImage.java
deleted file mode 100644
index 51e4fe73131b1cf7c4e27a331a401d6949d46e4f..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/util/MyWebImage.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.net.HttpURLConnection;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.security.KeyManagementException;
-import java.security.NoSuchAlgorithmException;
-import java.security.cert.X509Certificate;
-
-import javax.net.ssl.HostnameVerifier;
-import javax.net.ssl.HttpsURLConnection;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSession;
-import javax.net.ssl.SSLSocketFactory;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.X509TrustManager;
-
-import com.loopj.android.image.SmartImage;
-import com.loopj.android.image.WebImageCache;
-
-import android.content.Context;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.util.Base64;
-import android.util.Log;
-
-public class MyWebImage implements SmartImage {
-    private static final int CONNECT_TIMEOUT = 5000;
-    private static final int READ_TIMEOUT = 10000;
-
-    private static WebImageCache webImageCache;
-
-    private String url;
-    private boolean useCache = true;
-    
-    private String authUsername;
-    private String authPassword;
-    private boolean shouldAuth = false;
-
-    public MyWebImage(String url) {
-        this.url = url;
-        this.useCache = true;
-    }
-    
-    public MyWebImage(String url, String username, String password) {
-        this.url = url;
-        this.useCache = true;
-        this.setAuthentication(username, password);
-    }
-    
-    public MyWebImage(String url, boolean useCache) {
-    	this.url = url;
-    	this.useCache = useCache;
-    }
-
-    public MyWebImage(String url, boolean useCache, String username, String password) {
-    	this.url = url;
-    	this.useCache = useCache;
-        this.setAuthentication(username, password);
-    }
-    
-    public Bitmap getBitmap(Context context) {
-        // Don't leak context
-        if(webImageCache == null) {
-            webImageCache = new WebImageCache(context);
-        }
-
-        // Try getting bitmap from cache first
-        Bitmap bitmap = null;
-        if(url != null) {
-            if (this.useCache)
-            	bitmap = webImageCache.get(url);
-            if(bitmap == null) {
-            	Log.i("MyWebImage", "Cache for " + url + " is empty, getting image");
-                bitmap = getBitmapFromUrl(url);
-                if(bitmap != null && this.useCache) {
-                    webImageCache.put(url, bitmap);
-                }
-            }
-        }
-
-        return bitmap;
-    }
-
-    private Bitmap getBitmapFromUrl(String url) {
-        Bitmap bitmap = null;
-        String encodedUserPassword = null;
-        if (shouldAuth)
-        	try {
-        		String userPassword = this.authUsername + ":" + this.authPassword;
-        		encodedUserPassword = Base64.encodeToString(userPassword.getBytes("UTF-8"), Base64.DEFAULT);
-        	} catch (UnsupportedEncodingException e1) {
-        		// TODO Auto-generated catch block
-        		e1.printStackTrace();
-        	}
-        if (url.startsWith("https")) {
-        	try {
-        		HttpsURLConnection.setDefaultHostnameVerifier(getHostnameVerifier());
-        		HttpsURLConnection conn = (HttpsURLConnection) new URL(url).openConnection();
-        		conn.setSSLSocketFactory(getSSLSocketFactory());
-        		conn.setConnectTimeout(CONNECT_TIMEOUT);
-        		conn.setReadTimeout(READ_TIMEOUT);
-        		if (this.shouldAuth)
-        			conn.setRequestProperty("Authorization", "Basic " + encodedUserPassword);
-        		bitmap = BitmapFactory.decodeStream((InputStream) conn.getContent());
-        	} catch(Exception e) {
-        		e.printStackTrace();
-        	}
-        } else {
-        	try {
-				HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection();
-        		conn.setConnectTimeout(CONNECT_TIMEOUT);
-        		conn.setReadTimeout(READ_TIMEOUT);
-        		if (this.shouldAuth)
-        			conn.setRequestProperty("Authorization", "Basic " + encodedUserPassword);
-        		bitmap = BitmapFactory.decodeStream((InputStream) conn.getContent());
-			} catch (MalformedURLException e) {
-				e.printStackTrace();
-			} catch (IOException e) {
-				e.printStackTrace();
-			}
-        }
-        return bitmap;
-    }
-
-    public static void removeFromCache(String url) {
-        if(webImageCache != null) {
-            webImageCache.remove(url);
-        }
-    }
-    
-    public SSLSocketFactory getSSLSocketFactory() {
-        // Create a trust manager that does not validate certificate chains
-        final TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {
-            @Override
-            public void checkClientTrusted( final X509Certificate[] chain, final String authType ) {
-            }
-            @Override
-            public void checkServerTrusted( final X509Certificate[] chain, final String authType ) {
-            }
-            @Override
-            public X509Certificate[] getAcceptedIssuers() {
-                return null;
-            }
-        } };
-        
-        // Install the all-trusting trust manager
-        SSLContext sslContext;
-		try {
-			sslContext = SSLContext.getInstance( "SSL" );
-	        sslContext.init( null, trustAllCerts, new java.security.SecureRandom() );
-	        // Create an ssl socket factory with our all-trusting manager
-	        SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory();
-	        return sslSocketFactory;
-		} catch (NoSuchAlgorithmException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		} catch (KeyManagementException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-		return null;
-    }
-    
-    public HostnameVerifier getHostnameVerifier() {
-        HostnameVerifier allHostsValid = new HostnameVerifier() {
-			@Override
-			public boolean verify(String hostname, SSLSession session) {
-				return true;
-			}
-        };
-        return allHostsValid;
-    }
-    
-    public void setAuthentication(String username, String password) {
-    	this.authUsername = username;
-    	this.authPassword = password;
-    	if (this.authUsername.length() > 0 && this.authPassword.length() > 0)
-    		this.shouldAuth = true;
-    }
-}
\ No newline at end of file
diff --git a/src/org/openhab/habdroid/util/Util.java b/src/org/openhab/habdroid/util/Util.java
deleted file mode 100644
index 64462b339ebae6a7259b5da1fafa76dc914a55f0..0000000000000000000000000000000000000000
--- a/src/org/openhab/habdroid/util/Util.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/**
- * Copyright (c) 2010-2014, openHAB.org and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *  @author Victor Belov
- *  @since 1.4.0
- *
- */
-
-package org.openhab.habdroid.util;
-
-import android.content.Context;
-import android.util.Log;
-import com.crittercism.app.Crittercism;
-import org.json.JSONException;
-import org.json.JSONObject;
-import org.openhab.habdroid.R;
-
-import android.app.Activity;
-import android.preference.PreferenceManager;
-import org.openhab.habdroid.model.OpenHABSitemap;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
-public class Util {
-
-    private final static String TAG = "Util";
-
-	public static void setActivityTheme(Activity activity) {
-		if (PreferenceManager.getDefaultSharedPreferences(activity).getString("default_openhab_theme", "dark").equals("dark")) {
-//			activity.setTheme(android.R.style.Theme_Holo);
-			activity.setTheme(R.style.HABDroid_Dark);
-		} else {
-//			activity.setTheme(android.R.style.Theme_Holo_Light);
-			activity.setTheme(R.style.HABDroid_Light);
-		}
-	}
-	
-	public static void overridePendingTransition(Activity activity, boolean reverse) {
-		if (PreferenceManager.getDefaultSharedPreferences(activity).getString("default_openhab_animation", "android").equals("android")) {
-		} else if (PreferenceManager.getDefaultSharedPreferences(activity).getString("default_openhab_animation", "android").equals("ios")) {
-			if (reverse) {
-				activity.overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right);
-			} else {
-				activity.overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);				
-			}
-		} else {
-			activity.overridePendingTransition(0, 0);
-		}
-	}
-
-    public static String normalizeUrl(String sourceUrl) {
-        String normalizedUrl = "";
-        try {
-            URL url = new URL(sourceUrl);
-            normalizedUrl = url.toString();
-            normalizedUrl = normalizedUrl.replace("\n", "");
-            normalizedUrl = normalizedUrl.replace(" ", "");
-            if (!normalizedUrl.endsWith("/"))
-                normalizedUrl = normalizedUrl + "/";
-        } catch (MalformedURLException e) {
-            Log.e(TAG, "normalizeUrl: invalid URL");
-        }
-        return normalizedUrl;
-    }
-
-    public static void initCrittercism(Context ctx, String appKey) {
-        // Initialize crittercism reporting
-        JSONObject crittercismConfig = new JSONObject();
-        try {
-            crittercismConfig.put("shouldCollectLogcat", true);
-        } catch (JSONException e) {
-            if (e.getMessage() != null)
-                Log.e(TAG, e.getMessage());
-            else
-                Log.e(TAG, "Crittercism JSON exception");
-        }
-        Crittercism.init(ctx, appKey, crittercismConfig);
-    }
-
-    public static List<OpenHABSitemap> parseSitemapList(Document document) {
-        List<OpenHABSitemap> sitemapList = new ArrayList<OpenHABSitemap>();
-            NodeList sitemapNodes = document.getElementsByTagName("sitemap");
-            if (sitemapNodes.getLength() > 0) {
-                for (int i=0; i < sitemapNodes.getLength(); i++) {
-                    Node sitemapNode = sitemapNodes.item(i);
-                    OpenHABSitemap openhabSitemap = new OpenHABSitemap(sitemapNode);
-                    sitemapList.add(openhabSitemap);
-                }
-            }
-        return sitemapList;
-    }
-
-    public static boolean sitemapExists(List<OpenHABSitemap> sitemapList, String sitemapName) {
-        for (int i=0; i<sitemapList.size(); i++) {
-            if (sitemapList.get(i).getName().equals(sitemapName))
-                return true;
-        }
-        return false;
-    }
-
-    public static OpenHABSitemap getSitemapByName(List<OpenHABSitemap> sitemapList, String sitemapName) {
-        for (int i=0; i<sitemapList.size(); i++) {
-            if (sitemapList.get(i).getName().equals(sitemapName))
-                return sitemapList.get(i);
-        }
-        return null;
-    }
-
-}