{"action":"created","issue":{"url":"https://api.github.com/repos/eclipse/kapua/issues/719","repository_url":"https://api.github.com/repos/eclipse/kapua","labels_url":"https://api.github.com/repos/eclipse/kapua/issues/719/labels{/name}","comments_url":"https://api.github.com/repos/eclipse/kapua/issues/719/comments","events_url":"https://api.github.com/repos/eclipse/kapua/issues/719/events","html_url":"https://github.com/eclipse/kapua/issues/719","id":240328533,"number":719,"title":"How To connect Android Device to Kapua using MQTT","user":{"login":"VivekPowar","id":25997057,"avatar_url":"https://avatars1.githubusercontent.com/u/25997057?v=3","gravatar_id":"","url":"https://api.github.com/users/VivekPowar","html_url":"https://github.com/VivekPowar","followers_url":"https://api.github.com/users/VivekPowar/followers","following_url":"https://api.github.com/users/VivekPowar/following{/other_user}","gists_url":"https://api.github.com/users/VivekPowar/gists{/gist_id}","starred_url":"https://api.github.com/users/VivekPowar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VivekPowar/subscriptions","organizations_url":"https://api.github.com/users/VivekPowar/orgs","repos_url":"https://api.github.com/users/VivekPowar/repos","events_url":"https://api.github.com/users/VivekPowar/events{/privacy}","received_events_url":"https://api.github.com/users/VivekPowar/received_events","type":"User","site_admin":false},"labels":[{"id":461644997,"url":"https://api.github.com/repos/eclipse/kapua/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":42,"created_at":"2017-07-04T06:57:19Z","updated_at":"2017-07-12T08:58:08Z","closed_at":null,"body":"```\r\nimport android.support.v7.app.AppCompatActivity;\r\nimport android.os.Bundle;\r\nimport android.widget.Toast;\r\n\r\nimport org.eclipse.paho.android.service.MqttAndroidClient;\r\nimport org.eclipse.paho.client.mqttv3.IMqttActionListener;\r\nimport org.eclipse.paho.client.mqttv3.IMqttToken;\r\nimport org.eclipse.paho.client.mqttv3.MqttClient;\r\nimport org.eclipse.paho.client.mqttv3.MqttConnectOptions;\r\nimport org.eclipse.paho.client.mqttv3.MqttException;\r\n\r\npublic class MainActivity extends AppCompatActivity {\r\n\r\n    public String MQTTHOST=\"tcp://kapua-broker:kapua-password@localhost:1883\";\r\n    public String USERNAME = \"********\";\r\n    public String PASSWORD = \"********\";\r\n\r\n    MqttAndroidClient client;\r\n\r\n    @Override\r\n    protected void onCreate(Bundle savedInstanceState) {\r\n        super.onCreate(savedInstanceState);\r\n        setContentView(R.layout.activity_main);\r\n\r\n        String clientId = MqttClient.generateClientId();\r\n         client =new MqttAndroidClient(this.getApplicationContext(), MQTTHOST,\r\n                        clientId);\r\n\r\n\r\n        try {\r\n            MqttConnectOptions options = new MqttConnectOptions();\r\n           // options.setUserName(USERNAME);\r\n           // options.setPassword(PASSWORD.toCharArray());\r\n            IMqttToken token = client.connect(options);\r\n\r\n            token.setActionCallback(new IMqttActionListener() {\r\n                @Override\r\n                public void onSuccess(IMqttToken asyncActionToken) {\r\n                    // We are connected\r\n                    Toast.makeText(MainActivity.this,\"Connected\",Toast.LENGTH_LONG).show();\r\n                }\r\n\r\n                @Override\r\n                public void onFailure(IMqttToken asyncActionToken, Throwable exception) {\r\n                    // Something went wrong e.g. connection timeout or firewall problems\r\n                    Toast.makeText(MainActivity.this,\"Connection Failed\",Toast.LENGTH_LONG).show();\r\n\r\n                }\r\n            });\r\n        } catch (MqttException e) {\r\n            e.printStackTrace();\r\n        }\r\n    }\r\n}\r\n```\r\n______________OUTPUT________________\r\nConnection Failed"},"comment":{"url":"https://api.github.com/repos/eclipse/kapua/issues/comments/314700367","html_url":"https://github.com/eclipse/kapua/issues/719#issuecomment-314700367","issue_url":"https://api.github.com/repos/eclipse/kapua/issues/719","id":314700367,"user":{"login":"VivekPowar","id":25997057,"avatar_url":"https://avatars1.githubusercontent.com/u/25997057?v=3","gravatar_id":"","url":"https://api.github.com/users/VivekPowar","html_url":"https://github.com/VivekPowar","followers_url":"https://api.github.com/users/VivekPowar/followers","following_url":"https://api.github.com/users/VivekPowar/following{/other_user}","gists_url":"https://api.github.com/users/VivekPowar/gists{/gist_id}","starred_url":"https://api.github.com/users/VivekPowar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VivekPowar/subscriptions","organizations_url":"https://api.github.com/users/VivekPowar/orgs","repos_url":"https://api.github.com/users/VivekPowar/repos","events_url":"https://api.github.com/users/VivekPowar/events{/privacy}","received_events_url":"https://api.github.com/users/VivekPowar/received_events","type":"User","site_admin":false},"created_at":"2017-07-12T08:58:08Z","updated_at":"2017-07-12T08:58:08Z","body":"@ctron yes actually i made same changes like this but its not working is there any changes or any dependency need to add for that ?"}}
{"actor":{"display_login":"VivekPowar"}}