Skip to content

Couple small usability improvements #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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

21 changes: 11 additions & 10 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.example.mqtt"
android:versionCode="1"
android:versionName="1.0" >
package="org.example.mqtt"
android:versionCode="2"
android:versionName="1.1">

<uses-sdk android:minSdkVersion="10" />
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="16"/>
<uses-permission android:name="android.permission.INTERNET"/>

<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.Light">
<activity
android:name="org.example.mqtt.MQTTActivity"
android:label="@string/app_name" >
android:name="org.example.mqtt.MQTTActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.MAIN"/>

<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
Expand Down
142 changes: 142 additions & 0 deletions res/layout-large/main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"

android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dp">

<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Address:"
android:textAppearance="?android:attr/textAppearanceMedium"/>

<Spinner
android:id="@+id/spnProtocol"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<EditText
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">
<requestFocus/>
</EditText>
</TableRow>
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="User Name:"
android:textAppearance="?android:attr/textAppearanceMedium"/>

<EditText
android:id="@+id/userNameEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:inputType="text|textNoSuggestions"/>
</TableRow>
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Password:"
android:textAppearance="?android:attr/textAppearanceMedium"/>

<EditText
android:id="@+id/passwordEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:inputType="textPassword"/>
</TableRow>
</TableLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<Button android:id="@+id/btnConnect"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Connect"
android:onClick="doConnect"
/>

<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Disconnect"
android:onClick="doDisconnect"
/>
</LinearLayout>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Destination:"
android:textAppearance="?android:attr/textAppearanceMedium"/>

<EditText
android:id="@+id/destinationEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"/>

<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Message:"
android:textAppearance="?android:attr/textAppearanceMedium"/>

<EditText
android:id="@+id/messageEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:inputType="textMultiLine"
android:lines="2"/>

<Button android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Send"
android:onClick="doSend"
/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Received:"
android:textAppearance="?android:attr/textAppearanceMedium"/>

<EditText
android:id="@+id/receiveEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="none|textMultiLine"
android:lines="2"/>

</LinearLayout>
</ScrollView>
Loading