title: Trying to reach my openfire server through my android client
body: <p>I want to create my own XMPP android client . So I begane with the samsung tutorial which interface itself with gmail and that you can find here :
  <a href="http://developer.samsung.com/android/technical-docs/Building-a-Chat-Application" rel="nofollow">http://developer.samsung.com/android/technical-docs/Building-a-Chat-Application</a></p>
  
  <p>It worked like a charm. Now I tryed to setup  this client for working with my openfire server. </p>
  
  <p>For this I converted the folowing lines:</p>
  
  <pre><code>public static final String HOST = "My public ip(82.65....)";
  public static final int PORT = 5222;
  public static final String SERVICE = "xmppclient.talkative.com";
  public static final String USERNAME = "test";
  public static final String PASSWORD = "test";
  </code></pre>
  
  <p>Actually we find back these variable in the connection setter:</p>
  
  <pre><code>ConnectionConfiguration connConfig = new ConnectionConfiguration(
                      HOST, PORT, SERVICE);
              XMPPConnection connection = new XMPPConnection(connConfig);
  </code></pre>
  
  <p>Finally I never manage to connect to the server and I always get the following error</p>
  
  <pre><code>03-27 00:18:00.660: E/XMPPChatDemoActivity(29942): Failed to connect to      81.65.**.***:5222.
  03-27 00:18:00.663: E/XMPPChatDemoActivity(29942): XMPPError connecting to 81.65.**.***:5222.: remote-server-error(502) XMPPError connecting to 81.65.**.***:5222.
  </code></pre>
  
  <p>This seems to be very simple but still I cannot get the right connection .</p>
  
  <p>I precise that I have the good INTERNET conf in my Manifest.</p>
  
  <p>If anyone has a clue it would be really usefull .</p>
  
  <p>Thanks</p>