安卓/ Eclipse的错误 - "找不到类的org.jivesoftware.smack.ConnectionConfiguration“,从法&QUOT参考; [英] Android/Eclipse Error - "Could not find class 'org.jivesoftware.smack.ConnectionConfiguration', referenced from method"
问题描述
这是我第一次与Android / Java的工作。我试图运行这个基本的code和我不断收到以下错误:
This is my first time working with Android/Java. I am trying to run this basic code and I keep getting the following error:
找不到类org.jivesoftware.smack.ConnectionConfiguration,从方法引用
-
我的code:
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:
I am using the smack.jar from this page:
的http://vidorsolutions.blogspot.com/2011/01/writing-xmppjabber-chat-application-for.html?m=1
谁能告诉我什么,我做错了什么?
Can anyone tell me what I am doing wrong?
推荐答案
这是类似于围绕Android的项目外罐(特别是与新的SDK工具),许多相关的问题。解决的办法是为您创建一个文件夹在您的项目称为库
和罐子复制到该文件夹。
This is similar to many related problems surrounding External jars in android projects (especially with the new sdk tools). The solution is for you to create a folder in your project called libs
and copy the jars into that folder.
这篇关于安卓/ Eclipse的错误 - "找不到类的org.jivesoftware.smack.ConnectionConfiguration“,从法&QUOT参考;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!