Android/Eclipse Fehler “could not find class 'org.jivesoftware.smack.ConnectionConfiguration', referenced from method"

Dies ist meine erste Erfahrung mit Android/Java. Ich versuche zu laufen, dieses basic-code und ich erhalte die folgende Fehlermeldung:

"Could not find class 'org.jivesoftware.smack.ConnectionConfiguration', referenced from method"

  • Mein 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();
                      }
                      }
                      }

Ich bin mit dem smack.jar von dieser Seite:

http://vidorsolutions.blogspot.com/2011/01/writing-xmppjabber-chat-application-for.html?m=1

Kann mir jemand sagen was ich falsch mache?

  • mit smack.jar ? enthält es Klasse erforderlich?
InformationsquelleAutor user1447979 | 2012-06-12
Schreibe einen Kommentar