XML 解析在 lwuit 应用程序的 android 版本上不起作用
我使用 Kxml2 解析器来解析从远程页面获得的 xml 响应。用于用户认证,返回的xml给出了用户的一些详细信息。该应用程序使用 LWUIT 1.5 构建,适用于 MIDP 和 Blackberry 版本。 在 Android 版本上它不起作用。为了让 Android 正常工作,我需要添加任何额外的规范吗?
I use Kxml2 parser to parse the xml response I get as a response from a remote page. It is for user authentication, and the returned xml gives several details about the user. The app is built with LWUIT 1.5 and it works on MIDP and Blackberry versions.
On the Android version it doesn't work. Is there any extra specification I am supposed to add, for Android to work properly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
LWUIT中有一个XMLParser,非常好用。您可以尝试使用它。它在我的 MIDP 和 BB 应用程序中运行良好。我无法在 Android 中测试它,但我认为这可能是解决方案。如何将 LWUIT 应用程序移植到 Android?
ADD
好吧,我会尽力解释这个解析器的使用
。您需要导入这个包:
在我的项目中,我从
HTTPConnection
中提取 XML。假设 XML 如下:
然后执行以下操作:
您将得到
HI
HI2
我希望这对您有用。
There is a XMLParser in LWUIT, is very easy to use. You can try to use it. It works fine in my MIDP and BB apps. I can't test it in Android but I think It could be the solution. How do you port your LWUIT apps to Android?
ADD
Well I will try to explain the use of this Parser the best that I can
You need to import this packages:
In my project I extract a XML from an
HTTPConnection
.Suppose out XML is as follows:
Then do the following:
You will get
HI
HI2
I hope this wroks for you.