Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
anoop4real committed Feb 10, 2019
1 parent 1be5183 commit f9471cc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ class MQTTmanager (val connectionParams: MQTTConnectionParams, val context: Cont
fun publish(message:String){
try
{
client.publish(this.connectionParams.topic,message.toByteArray(),0,false,null,object :IMqttActionListener{
var msg = "Android says:" + message
client.publish(this.connectionParams.topic,msg.toByteArray(),0,false,null,object :IMqttActionListener{
override fun onSuccess(asyncActionToken: IMqttToken?) {
Log.w("Mqtt", "Publish Success!")
uiUpdater?.updateStatusViewWith("Published to Topic")
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
android:background="#e9ab90"
android:textColor="@color/colorPrimaryDark"
android:text="TextView"
android:layout_width="380dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/statusLabl" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
Expand All @@ -26,7 +26,7 @@
app:layout_constraintTop_toBottomOf="@+id/statusLabl" android:layout_marginEnd="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginRight="8dp" android:layout_marginStart="8dp"
app:layout_constraintStart_toStartOf="parent" android:layout_marginLeft="8dp"
android:hint="Enter ip Address" app:layout_constraintHorizontal_bias="0.533"/>
android:hint="Enter broker address" app:layout_constraintHorizontal_bias="0.533"/>
<EditText
android:layout_width="241dp"
android:layout_height="41dp"
Expand Down

0 comments on commit f9471cc

Please sign in to comment.