powered by Jive Software

Can't launch simple android application with smack

Good evening.
First of all, i’m sorry for my bad english.

Second, i create a simple android application from templates (eclipse) and wrote some strings:

package com.example.client; import org.jivesoftware.smack.ConnectionConfiguration;
import org.jivesoftware.smack.XMPPConnection; import android.support.v7.app.ActionBarActivity;
import android.app.Activity;
import android.os.Bundle; public class MainActivity extends Activity {
          private ConnectionConfiguration config;
    private XMPPConnection connection;
        private String server = "talk.google.com";
    private String service = "gmail.com";
    private String login = "";
    private String password = "";
    private int port = 5222;
              @Override
          protected void onCreate(Bundle savedInstanceState) {
                    super.onCreate(savedInstanceState);
                    setContentView(R.layout.activity_main);                     config = new ConnectionConfiguration(server, port, service);
                    config.setSASLAuthenticationEnabled(true);
                    config.setSecurityMode(ConnectionConfiguration.SecurityMode.enabled);
                    connection = new XMPPConnection(config);
                      } }

i require smack.jar for this application. i do test at the virtual machine and this app close every time with error. i can’t understand why it happed