title: create the new user in xmpp account programmatically in android
body: <p>public class RegisterConnection extends Activity 
  {</p>
  
  <pre><code>public static final String HOST = "ip";
  public static final int PORT = 5222;
  public static final String SERVICE = "ip";
  
  private String username;
  private String name;
  private String email_id;
  private String password;
  private String cmpassword;
  private String user;
  private String nam;
  private String emailid;
  private String pass;
  private String cmpass;
  
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      getIntentData();
      connect();
  
  }
  
  private void getIntentData() {
      // TODO Auto-generated method stub
  
      Intent getData=getIntent();
      username=getData.getStringExtra("username");
      name=getData.getStringExtra("name");
      email_id=getData.getStringExtra("email_id");
      password=getData.getStringExtra("password");
      cmpassword=getData.getStringExtra("cmpassword");
  
  }
  
  private void connect() {
      // TODO Auto-generated method stub
      final ProgressDialog dialog = ProgressDialog.show(this,"Connecting...", "Please wait...", false);
  
      Thread t = new Thread(new Runnable() {
  
          @Override
          public void run() {
              // TODO Auto-generated method stub
  
              ConnectionConfiguration connConfig = new ConnectionConfiguration(
                      HOST, PORT,SERVICE);
              XMPPConnection connection = new XMPPConnection(connConfig);
  
              try {
                  connection.connect();
                  Log.i("XMPPChatDemoActivity",
                          "Connected to " + connection.getHost());
              } catch (XMPPException ex) 
              {
                  Log.e("XMPPChatDemoActivity", "Failed to connect to "
                          + connection.getHost());
                  Log.e("XMPPChatDemoActivity", ex.toString());
              //  setConnection(null);
              }
  
              try{
  
                  //connection.connect();
  
                  Log.i("XMPPChatDemoActivity","Logged in as " + connection.getUser());
                  String kk= connection.getUser();
                  AccountManager accountManager = connection.getAccountManager();
                  Map&lt;String, String&gt; attributes = new HashMap&lt;String, String&gt;();
                  attributes.put("Username", username);
                  attributes.put("Name", name);
                  attributes.put("Email", email_id);
                  attributes.put("Password", password);
                  attributes.put("Confirm Password", cmpassword);
  
                  accountManager.createAccount("ip","",attributes);
  
                  Registration registration = new Registration();
                  registration.setType(IQ.Type.SET);
                  registration.setTo(connection.getServiceName());
  
                  PacketFilter filter = new AndFilter(new PacketIDFilter(registration.getPacketID()), new PacketTypeFilter(IQ.class));
                  PacketCollector collector = connection.createPacketCollector(filter);
          connection.sendPacket(registration);
          connection.disconnect();
  //      connection.connect();
                 // connection.login(username, password);
                  Log.i("XMPPChatDemoActivity","Logged in as " + connection.getUser());
  
  
                 /* AccountManager accountManager = connection.getAccountManager();
                  Map&lt;String, String&gt; attributes = new HashMap&lt;String, String&gt;();
                  attributes.put("username", "krishna");
                  attributes.put("password", "123456");
                  attributes.put("email", "krishna@gmail.com");
                  attributes.put("name", "krishnathakkar");
  
                  accountManager.createAccount("krishna@target.local", "123456",attributes);
  
                  Registration registration = new Registration();
                  registration.setType(IQ.Type.SET);
                  registration.setTo(connection.getServiceName());
  
                  PacketFilter filter = new AndFilter(new PacketIDFilter(registration.getPacketID()), new PacketTypeFilter(IQ.class));
                  PacketCollector collector = connection.createPacketCollector(filter);
                  connection.sendPacket(registration);
  
                  connection.connect();*/
  
              }catch(XMPPException ex){
  
                  Log.e("XMPPChatDemoActivity", "Failed to Register in as "
                          + username);
                   connection.disconnect();
  
              }
  
  
          }
  
  });
      t.start();
      dialog.show();
  
  }
  }   
  </code></pre>
  
  <blockquote>
    <p>Blockquote</p>
  </blockquote>
  
  <p>i have tried the above code for registration but it giving me error
  and saying no Response form server 
  and registration failed.
  the connection is been done successfully with the server.
  but not allowing me to create the new user</p>