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

  • Home
  • SEARCH
  • 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 7935537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:57:08+00:00 2026-06-03T21:57:08+00:00

I have a simplistic app (just learning) that reads some XML data from a

  • 0

I have a simplistic app (just learning) that reads some XML data from a mocked up file. The XML data is well formed into 6 categories and I use the SAX parser to read it. My app basically has two buttons prev & next. So when the app loads I’d like to see the first category of XML data. When the user presses next button… well then I’d like to see the next category of data etc. to the end.

My question is how do I go back and forth through the data? Do I load it all into a data object with some form of sorting and iterate back and forth through the object or do I add an atty field to a parent element and just search the XML for the requested atty and child data? I don’t foresee the XML ever getting very large. Just trying to get more experienced input into how to go about synchronizing the data with the gui.

  • 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-03T21:57:10+00:00Added an answer on June 3, 2026 at 9:57 pm

    There are many ways you could go about it. One that is generally a decent path is parse the XML into a data structure that can be used by an Adapter to create the view structures and return them so be shown. That will give you a good level of control over how your data looks and allow you to tie in to many different complex View structures pretty easily.

    The data structure that you store it in also has many possibilities. Which ones work best would depend on your particular dataset generally.

    Given what I know about your data an ArrayList seems like a straightforward approach. Create yourself a class that will hold all of the data about one category. Create objects of that class in your parser as you are pulling the data out of the XML file, each time you get to a new category add your object to an ArrayList. When your done you should have an List structure that has 1 category object(with all of its data) at each index.

    Once you’ve got that set up make yourself an ArrayAdapter with your List. Override the getView() method to inflate your View objects and populate them with the data from your List.

    This Adapter can then feed a parent View (ViewPager, ViewSwitcher, ListView etc…) These parent views will make it easy to iterate over your data structures (i.e. switching from one category to the next and back.)

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

Sidebar

Related Questions

I currently have multiple queries that query data from a few tables linked through
I have an XML document (in a .net C# web app) that I want
Well the problem here is that if you have one DataTemplate for a type
I have a exceedingly simplistic data model (below). I am having trouble figuring out
I have a method that performs a simplistic 'grep' across files, using an enumerable
I have developed a jQuery API browser from the raw XML available from http://api.jquery.com/api/
I have a problem with namespace position in result xml file after xsl transformation.
We are building an app using the MVVM pattern, we have controllers that wire
Have just started converting an existing job tracking system into an ASP.NET MVC application.
Have just started using Google Chrome , and noticed in parts of our site,

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.