四:Smack文档的下载和初步了解
来源:互联网 发布:中国移动网络维护 编辑:程序博客网 时间:2024/06/16 04:27
从本篇开始就要进入代码篇,写代码需要看一下文档,所以我们先下载一个Smack文档。
一:Smack文档的下载
1、下载最新的Smack文档
官方下载站点:
http://www.igniterealtime.org/downloads/index.jsp
下载smack_4_0_1.zip。
解压后有三个文件夹:javadoc,libs,releasedocs。打开releasedocs-documentation-index.html
让我们先看一下Overview翻译一下,翻译不对的请多多指教。
Smack Overview
Smack is a library for communicating with XMPP servers to perform real-time communications, including instant messaging and group chat.
翻译:smack是一个与XMPP服务器进行实时通信的库,包括即时消息和群组聊天。
Smack Key Advantages
翻译:smack关键优势
Extremely simple to use, yet powerful API. Sending a text message to a user can be accomplished in only a few lines of code:
翻译:使用极其简单,但API的功能很强大。发送文本消息给用户只需要几行代码就可以完成:
Connection connection = new XMPPConnection("jabber.org");connection.connect();connection.login("mtucker", "password");Chat chat = connection.getChatManager().createChat("jsmith@jivesoftware.com", new MessageListener() { public void processMessage(Chat chat, Message message) { System.out.println("Received message: " + message); }});chat.sendMessage("Howdy!");
解释一下:
"jabber.org":是服务器地址,例如192.168.1.103
"mtucker", "password":是登录的用户名和密码,
"jsmith@jivesoftware.com":就是所说的jid,@前面的是登录的用户名后面的是第二篇的第六条6.配置服务器域名的域
Doesn't force you to code at the packet level, as other libraries do. Smack provides intelligent higher level constructs such as the Chat and Roster classes, which let you program more efficiently.
翻译:不强迫你在包级别去编码,和其他库一样。Smack提供智能更高层次结构像聊天和组,这让你的程序更有效。
Does not require that you're familiar with the XMPP XML format, or even that you're familiar with XML.
Provides easy machine to machine communication. Smack lets you set any number of properties on each message, including properties that are Java objects.
翻译:提供简单的机对机通信。对于每一个消息Smack让你设置任意数量的属性,包括Java对象的属性。
Open Source under the Apache License, which means you can incorporate Smack into your commercial or non-commercial applications.
翻译:开放源码在Apache许可下,这意味着您可以让Smack进入你的商业或非商业应用。
About XMPP
翻译:关于XMPP
XMPP (eXtensible Messaging and Presence Protocol) is an open protocol standardized by the IETF and supported and extended by the XMPP Standards Foundation ((http://www.xmpp.org).
翻译:XMPP(可扩展消息处理现场协议)是一个开放的协议由IETF标准化和XMPP支持和扩展的标准基金会((http://www.xmpp.org)。
How To Use This Documentation
翻译:如何去使用这个文档
This documentation assumes that you're already familiar with the main features of XMPP instant messaging. It's also highly recommended that you open the Javadoc API guide and use that as a reference while reading through this documentation.
翻译:本文档假设你已经熟悉XMPP即时消息的主要特点。也强烈建议您打开Javadoc API向导并作为参考使用,在阅读这个文档的时候。
翻译完了,其他项我就不翻译了,你们可以自己读一读,最后他建议我们去打开javadoc作参考,那我们就打开javadoc-index.html看一下,
嗯,不错,有各种包和类,你们先看看,下一篇开始写登录代码。
- 四:Smack文档的下载和初步了解
- Spring的AOP初步了解(四)
- Smack文档四:使用Chat通信
- Python初步了解(四)
- 关于属性和字段的初步了解
- Smack文档五:Roster 和 Presence
- android 基于XMPP协议的smack和openfire的前期了解
- 下载Word文档的四种方法
- Jawe的初步了解
- Jawe的初步了解
- Router 的初步了解
- 指针的初步了解
- Tornado的初步了解
- Cookie的初步了解
- UML的初步了解
- C#的初步了解
- 初步了解的J2EE
- Internet的初步了解
- Percona Xtrabackup
- poj 3321 Apple Tree 树状数组
- 怎样快速在线将pdf转换成word
- JDeveloper different library list deteected
- 算法学习 - 括号匹配(栈实现)C++
- 四:Smack文档的下载和初步了解
- android学习之路
- 中国的车祸为什么多?一个”海归”的亲身体验
- Iphone开发 获取视频缩略图和时长
- IIS PHP环境 $_SERVER['DOCUMENT_ROOT'] 获取不到值
- Maven安装配置参考
- js闭包(转载)
- IOS 30多个iOS常用动画,带详细注释
- 二维数组中的查找