1. src/ui/adapter/FriendCardAdapter.java

    @Override

    public View getView(int position, View convertView, ViewGroup arg2) {

        CellHolder cell = null;

        if (convertView == null) {

            cell = new CellHolder();

            convertView = inflater.inflate(R.layout.friend_card_cell, null);

            cell.alpha = (TextView) convertView.findViewById(R.id.alpha);

            cell.avatarImageView = (ImageView) convertView.findViewById(R.id.avatarImageView);

            cell.titleView = (TextView) convertView.findViewById(R.id.title);

            cell.desView = (TextView) convertView.findViewById(R.id.des);

            convertView.setTag(cell);

        } else {

            cell = (CellHolder) convertView.getTag();

        }


        final UserInfo model = cards.get(position);

        ImageLoader.getInstance().displayImage(CommonValue.BASE_URL+model.userHead, cell.avatarImageView, CommonValue.DisplayOptions.default_options);

        cell.titleView.setText(model.nickName);

        cell.desView.setText( model.description);

        cell.alpha.setVisibility(View.GONE);

        convertView.setOnClickListener(new OnClickListener() {

            @Override

            public void onClick(View arg0) {

                //((Friend)context).createChat(model.userId+XmppConnectionManager.BASE_XMPP_SERVER_NAME);

                ((Friend)context).createChat(model.userId+"@"+XmppConnectionManager.BASE_XMPP_SERVER_NAME+"/android/");

            }

        });


        convertView.setOnLongClickListener(new OnLongClickListener() {


        @Override

        public boolean onLongClick(View arg0) {

            ((Friend)context).show2OptionsDialog(new String[]{"删除好友"}, model);

            return true;

        }

    });

    return convertView;

}


2. /src/config/XmppConnectionManager.java

  /**

    * XMPP服务器连接工具类.

    */

    public class XmppConnectionManager {

        //final String XmppHost = "182.92.101.207";

        final String XmppHost = "192.168.1.103";

        final int XmppPort = 5222;

        //public static String BASE_XMPP_SERVER_NAME = "@aliyun-05808812";

        public static String BASE_XMPP_SERVER_NAME = "chat.com";


3. /src/config/CommonValue.java

    public class CommonValue {

        public static String PackageName = "com.donal.wechat";


        //public static String BASE_API = "http://182.92.101.207:8080/wechat/api/";

        //public static String BASE_URL = "http://182.92.101.207:8080/";

        public static String BASE_API = "http://192.168.1.103:8080/wechat/api/";

        public static String BASE_URL = "http://192.168.1.103:8080/";