2012-03-28 44 views
4

我想在Android中創建一個小型聊天應用程序。對於工作的罰款在此下頁Android:開火xmpp

http://davanum.wordpress.com/2007/12/31/android-just-use-smack-api-for-xmpp/

它提到了這一點我做的步驟,如果我們進入Gmail的憑據等爲: -

private final static String SERVER_HOST = "talk.google.com"; 
private final static int SERVER_PORT = 5222; 
private final static String SERVICE_NAME = "gmail.com"; 
private final static String LOGIN = "[email protected]"; 
private final static String PASSWORD = "mypassword"; 

,但我想用我自己的服務器到位的Gmail 。我在我的系統中安裝了openfire,並且我在openfire中更新鮮,如果我使用我自己的服務器,請爲我提供什麼條目來處理上述憑據。

如果有任何疑問,請隨時問,我總是在這裏.. 先謝謝您。

回答

4

server_host和login/service_name。

SERVER_HOST是你連接到服務器,登錄是<something> @服務名,這應該爲你的服務器相匹配的聲明的服務名稱(可能SERVER_HOST匹配或SERVER_HOST的最後一部分)

所以如果你的服務器是xmpp.example .COM,改變你的項目應該最有可能

SERVER_HOST = "xmpp.example.com" 
SERVICE_NAME = "example.com" 
LOGIN = "[email protected]" 

SERVER_HOST = "xmpp.example.com" 
SERVICE_NAME = "xmpp.example.com" 
LOGIN = "[email protected]" 

,顯然,有端口◆ atch你運行openfire的端口(5222是默認值)