一周前我在android上工作,我必须在我的Appy android中使用MQTT的服务器(如mosquitto);因为我们将使用Delphy MQTT服务器。 Android的手机是2.3.6中的Galaxy Young ...... API:9
为了学习如何使用它,我测试Dale Lane的Mosquitto for android但是,有一天,我已经找到了我在论坛中的表现... Dale Lane的链接:http://dalelane.co.uk/blog/?p=1599
我的LogCat:
10-01 10:34:50.203 17844-17879/org.mosquitto.android.mqttdemo
W/Settings: Setting android_id has moved from
android.provider.Settings.System to android.provider.Settings.Secure,
returning read-only value.
10-01 10:34:50.250 17844-17879/org.mosquitto.android.mqttdemo
W/dalvikvm: threadid=11: thread exiting with uncaught exception
(group=0x40018578)
10-01 10:34:50.375 17844-17879/org.mosquitto.android.mqttdemo
E/AndroidRuntime: FATAL EXCEPTION: MQTTservice
java.lang.NoClassDefFoundError: javax.microedition.io.Connector
at com.ibm.mqtt.midp.MqttMidpSocket.setConnection(Unknown Source)
at com.ibm.mqtt.Mqtt.tcpipConnect(Unknown Source)
at com.ibm.mqtt.MqttBaseClient.doConnect(Unknown Source)
at com.ibm.mqtt.MqttBaseClient.connect(Unknown Source)
at com.ibm.mqtt.MqttClient.connect(Unknown Source)
at com.ibm.mqtt.MqttClient.connect(Unknown Source)
at org.mosquitto.android.powerviewer.MQTTService.connectToBroker(MQTTService.java:651)
at org.mosquitto.android.powerviewer.MQTTService.handleStart(MQTTService.java:285)
at org.mosquitto.android.powerviewer.MQTTService$2.run(MQTTService.java:209)
at java.lang.Thread.run(Thread.java:1019)
如果有人可以帮助我,谢谢,并抱歉我的英语;)
答案 0 :(得分:1)
如果您真的必须使用Dale博客文章中引用的IA92代码,那么您不应该使用Android上的J2ME库来获得J2SE版本。
不推荐使用IA92代码,您应该使用此处的eclipse paho代码:http://www.eclipse.org/paho/