2024年3月7日发(作者:)

case _TAG: if ("foobar".equals(e())) { (cate); } break; } event = (); } } catch (XmlPullParserException e) { // TODO Auto-generated catch block tackTrace(); } catch (IOException e) { // TODO Auto-generated catch block tackTrace(); } return cates; }

/** * 获取Pull解析器 *

* @param inputStream * @return */ public static XmlPullParser getXmlParser(InputStream inputStream) { XmlPullParserFactory factory; XmlPullParser xmlParser = null; if (inputStream == null) { return xmlParser; } try { factory = tance(); espaceAware(true); xmlParser = lParser(); ut(inputStream, _8); } catch (XmlPullParserException e1) { tackTrace(); } factory = null; return xmlParser; }/* *//** * 解析类别信息 *

* @param inStream * @return *//* public static List parseCategory(InputStream inStream) { List cates = null; CategoryInfo cate = null; XmlPullParser parser = getXmlParser(inStream); Log.i("Dust", "parser = " + parser); if (parser == null) { return cates; } cates = new ArrayList(); try { int event = ntType(); while (event != _DOCUMENT) { switch (event) { case _TAG: if ("foobar".equals(e())) { cate = new CategoryInfo(); } else if("categorytype".equals(e())){

appInfos = new ArrayList(); } else if ("foobar".equalsIgnoreCase(e())) { appInfo = new AppInfo(); } else if ("id".equalsIgnoreCase(e())) { Id(xt()); } else if ("name".equalsIgnoreCase(e())) { Name(xt()); } else if ("ming".equalsIgnoreCase(e())) { IconUrl(xt()); } else if (e().equalsIgnoreCase("score")) { Score(StrToFloat(parser .nextText())); } else if (e().equalsIgnoreCase("price")) { Price(StrToFloat(parser .nextText())); } else if (e().equalsIgnoreCase("type")) { Type(StrToInt(xt())); } else if (e().equalsIgnoreCase("bb")) { VersionName(xt()); } else if (e().equalsIgnoreCase("packageName")) { PackageName(xt()); } else if (e().equalsIgnoreCase("versioncode")) { VersionCode(StrToInt(parser .nextText())); } else if (e().equalsIgnoreCase("size")) { Size(xt()); } else if (e().equalsIgnoreCase("updatetime")) { UpdateTime(xt()); } else if (e().equalsIgnoreCase( "downloadCount")) { DownloadNum(StrToInt(parser .nextText())); } else if (e().equalsIgnoreCase("url")) { DetailPageUrl(xt()); } break; case _TAG: if ("INFO".equalsIgnoreCase(e())) { objsArr[0] = pageInfo; } else if ("foobar".equalsIgnoreCase(e())) { (appInfo); } else if ("ROWS".equalsIgnoreCase(e())) { objsArr[1] = appInfos; } break; } event = (); } } catch (XmlPullParserException e) { tackTrace(); } catch (IOException e) { tackTrace(); } return objsArr; } public static Object[] parseSpecialProjectApps(InputStream inStream) { Object[] objs = null; PageInfo pageInfo = null; List appInfos = null; AppEntity appInfo = null; try { XmlPullParser parser = getXmlParser(inStream); int event = ntType(); while (event != _DOCUMENT) {

while (event != _DOCUMENT) { switch (event) { case _TAG: if ("data".equalsIgnoreCase(e())) { objs = new Object[2]; } else if ("INFO".equalsIgnoreCase(e())) { pageInfo = new PageInfo(); } else if ("COUNT".equalsIgnoreCase(e())) { eItemTotal(StrToInt(parser .nextText())); } else if ("PAGECOUNT".equalsIgnoreCase(e())) { eItemNum(StrToInt(parser .nextText())); } else if ("PAGE".equalsIgnoreCase(e())) { eCurNum(StrToInt(parser .nextText())); } else if ("PAGESIZE".equalsIgnoreCase(e())) { eTotal(StrToInt(parser .nextText())); } else if ("pagegroupname".equalsIgnoreCase(parser .getName())) { eType(xt()); } else if ("ROWS".equalsIgnoreCase(e())) { appInfos = new ArrayList(); } else if ("foobar".equalsIgnoreCase(e())) { appInfo = new AppEntity(); } else if ("id".equalsIgnoreCase(e())) { //Id(xt()); (StrToLong(xt())); } else if ("name".equalsIgnoreCase(e())) { e(xt()); } else if ("ming".equalsIgnoreCase(e())) { //IconUrl(xt()); o(xt()); } else if ("score".equalsIgnoreCase(e())) { //Score(StrToFloat(xt())); re(StrToFloat(xt())); } else if ("price".equalsIgnoreCase(e())) { //Price(StrToFloat(xt())); ce(StrToFloat(xt())); } else if ("type".equalsIgnoreCase(e())) { //Type(StrToInt(xt())); e(StrToInt(xt())); } else if ("bb".equalsIgnoreCase(e())) { sionName(xt()); } else if ("packageName".equalsIgnoreCase(e())) { kageName(xt()); } else if ("versioncode".equalsIgnoreCase(e())) { sionCode(StrToInt(parser .nextText())); } else if ("size".equalsIgnoreCase(e())) { e(xt()); } else if ("updatetime".equalsIgnoreCase(e())) { //UpdateTime(xt()); ateTime(StrToLong(xt())); } else if ("downloadCount".equalsIgnoreCase(parser .getName())) { //DownloadNum(StrToInt(xt())); nloadTimes(StrToLong(xt())); } else if ("url".equalsIgnoreCase(e())) { //DownloadUrl(xt()); (xt()); } break; case _TAG:

case _TAG: if ("INFO".equalsIgnoreCase(e())) { objs[0] = pageInfo; } else if ("foobar".equalsIgnoreCase(e())) { (appInfo); } else if ("ROWS".equalsIgnoreCase(e())) { objs[1] = appInfos; } break; } event = (); } } catch (XmlPullParserException e) { tackTrace(); } catch (IOException e) { tackTrace(); } return objs; } public static List parseSpecialProjects(InputStream inStream) { List cates = null; CategoryInfo cate = null; try { XmlPullParser parser = getXmlParser(inStream); int event = ntType(); while (event != _DOCUMENT) { switch (event) { case _TAG: if ("data".equalsIgnoreCase(e())) { cates = new ArrayList(); } else if ("foobar".equalsIgnoreCase(e())) { cate = new CategoryInfo(); } else if ("name".equalsIgnoreCase(e())) { egoryName(xt()); } else if ("url".equalsIgnoreCase(e())) { egoryUrl(xt()); } else if ("img".equalsIgnoreCase(e())) { egoryTypeBg(xt()); } break; case _TAG: if ("foobar".equalsIgnoreCase(e())) { (cate); } break; } event = (); } } catch (XmlPullParserException e) { tackTrace(); } catch (IOException e) { tackTrace(); } return cates; } public static final Object[] getAppInfos(InputStream inputStream) { Object[] objects = null; PageInfo pageInfo = null; ArrayList appInfoArray = null; XmlPullParser parser = null; parser = getXmlParser(inputStream); if (parser == null) { return objects;

return objects; } try { int eventType = ntType(); AppInfo appInfo = null; String name = null; while (eventType != _DOCUMENT) { name = null; switch (eventType) { case _DOCUMENT: break; case _TAG: name = e(); if (IgnoreCase("data")) { objects = new Object[2]; } else if ((IgnoreCase("INFO")) && pageInfo == null) { pageInfo = new PageInfo(); } else if (IgnoreCase("key")) { } else if (IgnoreCase("COUNT")) { eCurItemNum(Utils .parserStrToInt(xt())); } else if (IgnoreCase("PAGECOUNT")) { eItemNum(StrToInt(parser .nextText())); } else if (IgnoreCase("PAGE")) { eCurNum(StrToInt(parser .nextText())); } else if (IgnoreCase("PAGESIZE")) { eTotal(StrToInt(parser .nextText())); } else if (IgnoreCase("ROWS")) { appInfoArray = new ArrayList(20); } else if (IgnoreCase("foobar")) { appInfo = new AppInfo(); } else if (IgnoreCase("id")) { Id(xt()); } else if (IgnoreCase("name")) { Name(xt()); } else if (IgnoreCase("ming")) { IconUrl(xt()); } else if (IgnoreCase("score")) { Score(StrToFloat(parser .nextText())); } else if (IgnoreCase("price")) { Price(StrToFloat(parser .nextText())); } else if (IgnoreCase("type")) { Type(StrToInt(xt())); } else if ((IgnoreCase("size"))) { Size(xt()); } else if (IgnoreCase("updatetime")) { UpdateTime(xt()); } else if (IgnoreCase("downloadCount")) { DownloadNum(StrToInt(parser .nextText())); } else if (IgnoreCase("desc")) { Description(xt()); } else if (IgnoreCase("url")) { DownloadUrl(xt()); } else if (IgnoreCase("bb")) { VersionName(xt()); } else if (IgnoreCase("sygj")) { Required(xt()); } else if (IgnoreCase("kfz")) {

} else if (IgnoreCase("kfz")) { Own(xt()); } else if (IgnoreCase("versionCode")) { VersionCode(StrToInt(parser .nextText())); } else if (IgnoreCase("packageName")) { PackageName(xt()); } break; case _TAG: if (e().equalsIgnoreCase("foobar")) { (appInfo); appInfo = null; } else if (e().equalsIgnoreCase("INFO")) { objects[0] = pageInfo; pageInfo = null; } else if (e().equalsIgnoreCase("ROWS")) { objects[1] = appInfoArray; appInfoArray = null; } break; } eventType = (); } } catch (XmlPullParserException e) { tackTrace(); } catch (IOException e) { tackTrace(); } catch (NullPointerException e) { tackTrace(); } return objects; }*/}