XmpPullParser

  鉴于xmpp协议都是以xml格式来传输,因此源码中解析协议都是用到XmpPullParser来解析xml

  XmpPullParser很简单,先简单介绍几个比较常用的方法

//定义一个事件采用回调方式,直到xml完毕
public int getEventType() throws XmlPullParserException ;
//遍历下一个事件,返回一个事件类型
public int next() throws XmlPullParserException, IOException
//得到当前tag的名字
public String getName();
//获得当前文本
public String getText();
//当前tag下的属性数量
public int getAttributeCount() ;
//获得当前指定属性位置的名称
public String getAttributeName(int index);
//获得当前指定属性位置的值
public String getAttributeValue(int index);
View Code

相关文章:

  • 2022-12-23
  • 2021-10-27
  • 2021-08-31
  • 2021-12-14
  • 2022-12-23
  • 2021-07-02
  • 2022-03-09
猜你喜欢
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2021-06-17
  • 2021-10-09
相关资源
相似解决方案