From ec0110dbb7cff2f328a20c80f25e2f850f808a10 Mon Sep 17 00:00:00 2001 From: Sebastian Roth Date: Tue, 6 Nov 2012 14:41:13 +0800 Subject: [PATCH 1/2] Usability improvements. --- .gitignore | 16 + AndroidManifest.xml | 21 +- res/layout/main.xml | 183 ++++----- src/org/example/mqtt/MQTTActivity.java | 524 +++++++++++++------------ 4 files changed, 373 insertions(+), 371 deletions(-) diff --git a/.gitignore b/.gitignore index d3f5d3e..9539001 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,19 @@ gen/ # Local configuration file (sdk path, etc) local.properties + +# IntelliJ +*.iws +*.ipr +*.iml + +# These dependencies should be resolved in other way, probably through maven. +# If you're not using maven for your Android project +# - clone https://github.com/fusesource/mqtt-client +# - run `mvn install` +# - copy the files from the ~/.m2/repository/ directory +libs/hawtbuf-1.9.jar +libs/hawtdispatch-1.12.jar +libs/hawtdispatch-transport-1.12.jar +libs/mqtt-client-1.5-SNAPSHOT.jar + diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 395e191..a9d7ac1 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,22 +1,23 @@ + package="org.example.mqtt" + android:versionCode="2" + android:versionName="1.1"> - + + android:icon="@drawable/ic_launcher" + android:label="@string/app_name" + android:theme="@android:style/Theme.Light"> + android:name="org.example.mqtt.MQTTActivity" + android:label="@string/app_name"> - + - + diff --git a/res/layout/main.xml b/res/layout/main.xml index e05a997..149e369 100644 --- a/res/layout/main.xml +++ b/res/layout/main.xml @@ -1,136 +1,116 @@ - + + android:layout_height="wrap_content"> - + android:layout_height="wrap_content" + android:orientation="vertical" + android:padding="10dp"> - + android:layout_height="wrap_content"> + - + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Address:" + android:textAppearance="?android:attr/textAppearanceMedium"/> + + - - + android:id="@+id/addressEditText" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_weight="1" + android:lines="1" + android:inputType="text|textNoSuggestions"> + - - - - - - - - - + + + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="User Name:" + android:textAppearance="?android:attr/textAppearanceMedium"/> - - - - - + android:id="@+id/userNameEditText" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:inputType="text|textNoSuggestions"/> + + + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Password:" + android:textAppearance="?android:attr/textAppearanceMedium"/> - - - - + + + + android:orientation="horizontal"> -