build.gradle in the module directory as follows:dependencies {...implementation 'com.tencent.iot.hub:hub-device-java:x.x.x'}
ProductID, DevName, and DevPSK.ProductID, CertFile, and PrivateKeyFile.private String mProductID = "YOUR_PRODUCT_ID";private String mDevName = "YOUR_DEVICE_NAME";private String mDevPSK = "YOUR_DEV_PSK";private String mCertFilePath = null;private String mPrivKeyFilePath = null;TXMqttConnection mqttconnection = new TXMqttConnection(mProductID, mDevName, mDevPSK, new callBack());mqttconnection.connect(options, null);try {Thread.sleep(20000);} catch (InterruptedException e) {// TODO Auto-generated catch blocke.printStackTrace();}mqttconnection.disConnect(null);
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback