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 8165837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:39:34+00:00 2026-06-06T19:39:34+00:00

I want to write a string to a key in an xml file and

  • 0

I want to write a string to a key in an xml file and then recall it later. How would I do this?

For instance, if the user were to enter a string of characters into a EditText view, I want to be able to store it and compare it against something, like a stored string.

  • 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-06-06T19:39:35+00:00Added an answer on June 6, 2026 at 7:39 pm

    In Android, the XmlPullParser is recommended when doing XML. Here’s a very simple example on how to use it.

     import java.io.IOException;
     import java.io.StringReader;
    
     import org.xmlpull.v1.XmlPullParser;
     import org.xmlpull.v1.XmlPullParserException.html;
     import org.xmlpull.v1.XmlPullParserFactory;
    
     public class SimpleXmlPullApp
     {
    
         public static void main (String args[])
             throws XmlPullParserException, IOException
         {
             XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
             factory.setNamespaceAware(true);
             XmlPullParser xpp = factory.newPullParser();
    
             xpp.setInput(new StringReader ("<foo>Hello World!</foo>"));
             int eventType = xpp.getEventType();
             while (eventType != XmlPullParser.END_DOCUMENT) {
              if(eventType == XmlPullParser.START_DOCUMENT) {
                  System.out.println("Start document");
              } else if(eventType == XmlPullParser.END_DOCUMENT) {
                  System.out.println("End document");
              } else if(eventType == XmlPullParser.START_TAG) {
                  System.out.println("Start tag "+xpp.getName());
              } else if(eventType == XmlPullParser.END_TAG) {
                  System.out.println("End tag "+xpp.getName());
              } else if(eventType == XmlPullParser.TEXT) {
                  System.out.println("Text "+xpp.getText());
              }
              eventType = xpp.next();
             }
         }
     }
    

    Here are some links that might help:

    • Several approaches –
      http://www.ibm.com/developerworks/opensource/library/x-android/
    • I got this example from here – http://www.vogella.com/articles/AndroidXML/article.html
    • Very good, more complete example – http://www.androidhive.info/2011/11/android-xml-parsing-tutorial/
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string which has an xml inside. I want to write this
I want to write a String to a Stream (a MemoryStream in this case)
I want to write method which generates key for cache object. This is my
I want to write the following procedure / function: procedure ShowSysPopup(aFile: string; x, y:
?string.Format(CultureInfo.GetCultureInfo(en-US), {0:d}, now) 4/12/2010 ?string.Format(CultureInfo.GetCultureInfo(fr-FR), {0:d}, now) 12/04/2010 I want to write a method:
I want to write an user defined error collection class which should collect all
I have a string value that I want to write to the registry as
I want to save a set of key, value pairs (string, int) between runs
I need to convert a string to write it into a registry.reg_binary key. I
I write an element in an XML file using XmlWriter using (XmlWriter writer =

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.