Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7435463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:04:45+00:00 2026-05-29T10:04:45+00:00

I use Kxml2 parser to parse the xml response I get as a response

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:04:45+00:00Added an answer on May 29, 2026 at 10:04 am

    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:

    import com.sun.lwuit.xml.Element;
    import com.sun.lwuit.xml.XMLParser;
    

    In my project I extract a XML from an HTTPConnection.

    Suppose out XML is as follows:

      <?xml version="1.0" encoding="UTF-8"?>
        <xml>
         <TagFromXML>
           <child>
             <data>HI</data>
           </child>
         </TagFromXML>
        <TagFromXML>
          <child>
             <data>HI2</data>
           </child>
         </TagFromXML>
        </xml>
    

    Then do the following:

    InputStream is = hc.openInputStream();
    InputStreamReader isr = new InputStreamReader(is, "utf-8");
    XMLParser myParser = new XMLParser();
    Element e = myParser.parse(isr);
    Vector tagVector = e.getChildrenByTagName("TagFromXML");
    for(int i = 0; i<tagVector.size();i++){
     Element singleTag = (Element) tagVector.elementAt(i);
     Element child = (Element) (singleTag.getChildrenByTagName("child")).elementAt(0);
     Element data = (Element) (child.getChildrenByTagName("data")).elementAt(0);
     System.out.println("DATA: " + data.getChildAt(0).getText());
    }
    

    You will get

    HI

    HI2

    I hope this wroks for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

kXML is an alternative XML parser I chose to use for JavaME apps. The
Use Case: End-User searches for something and an ArrayCollection is returned with Result objects.
I want to get data in my BlackBerry app from an xml file. I
Use case: user clicks the link on a webpage - boom! load of files
Use Case When a user goes to my website, they will be confronted with
use Control::CLI; $cli = new Control::CLI('SSH'); $cli->connect(Host=>'10.10.10.10',Username=>'user',Password=>'pwd'); $cli->waitfor('>'); $cli->print('Show XXXXXXXXXXXXXXXXXXXX| grep Active'); @f=$cli->waitfor('>'); print
use WWW::Mechanize; my $mech = WWW::Mechanize->new; $mech->get( $url ); say $mech->text; How could I
Use case: User launches app The user enters google password The app lets the
Use Eclipse Classic with ADT plugin. Tried to make project from existing example of
Use case : User fills out a form to add a product and register

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.