这是我第一次使用 Android/Java。我正在尝试运行此基本代码,但我不断收到以下错误:
“找不到类 'org.jivesoftware.smack.ConnectionConfiguration',从方法中引用”
我的代码:
package message.pack; import org.jivesoftware.smack.ConnectionConfiguration; import org.jivesoftware.smack.XMPPConnection; import org.jivesoftware.smack.XMPPException; import android.app.Activity; import android.os.Bundle; public class ThesimpleigniteandroidActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } public static void main(String[] args) { ConnectionConfiguration conf = new ConnectionConfiguration("jabber.com",5222); XMPPConnection connection = new XMPPConnection(conf); try { connection.connect(); connection.login("myusername", "mypassword"); } catch (XMPPException e) { e.printStackTrace(); } finally { connection.disconnect(); } } }
我正在使用此页面中的 smack.jar:
http://vidorsolutions.blogspot.com/2011/01/writing-xmppjabber-chat-application-for.html?m=1
谁能告诉我我做错了什么?