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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T15:20:16+00:00 2026-06-13T15:20:16+00:00

I am creating an Android app that needs to access the Bible. I want

  • 0

I am creating an Android app that needs to access the Bible. I want it to be offline, so I prefer not to use one of the internet APIs. After reading this this post, I decided to store the text locally as XML, like this

<bible>
<b n="Genesis">
<c n="1">
<v n="1">In the beginning, God created the heavens and the earth.</v>

My problem is that the file is almost 34,000 lines long (4.4 MB) and it takes a LONG time (a few minutes) to parse the entire text.

Right now I’m using the XmlPullParser, like this

XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
XmlPullParser xpp = factory.newPullParser();

InputStream iStream = getResources().openRawResource(R.raw.bible);
BufferedReader reader = new BufferedReader(new InputStreamReader(iStream));
xpp.setInput(reader);

int eventType = xpp.getEventType();

while (eventType != XmlPullParser.END_DOCUMENT)
{
    // do something here
    eventType = xpp.next();
}

Is there a better way to store and/or access the bible locally on Android?

I’ve considered storing it as multiple XML files to parse it faster (a separate file for each book) but would prefer not to if possible.

I am open to any suggestions, including storing the text as something other than XML.

Thanks

  • 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-13T15:20:17+00:00Added an answer on June 13, 2026 at 3:20 pm

    I would just use SQLite as a “starting place” – that is, why not? (Well, really, an existing library / book reader / well established file schema would even better, but barring that 🙂

    SQLite has very efficient “on disk” access – e.g. no need to “parse” to memory or read an entire file – and it supports efficient seeks over indices (e.g. looking up a specific verse or getting chapters 2 through 12 in Exodus). I would expect both the SQLite database and the original XML file to have a comparable file size (assuming the XML is UTF-8 encoded).

    Then make a program/function to “load” the XML into the appropriate schema in the SQLite database – this can be done ahead of time (e.g. on a PC and then distribute the pre-populate SQLite database files) or the first time said XML is loaded on the client. This can be effectively the same reading code as it is now .. just replace “do something” with “update database”.

    I would avoid a splitting-of-files approach unless there is a particularly good reason for it – it will make it faster to find a specific chapter/verse, but it doesn’t really “solve the problem”. Since it’s using a sequential reader and not a full DOM it won’t necessarily result in less memory – it will just limit the garbage “read over” (and then discarded) while seeking. But then again, why not SQLite?

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

Sidebar

Related Questions

I'm creating my first android app that will make use of SQlite. I have
so here is the problem. I am currently creating an Android app that is
I am creating an app on android but after hearing about sencha that it
I am creating a app in android. In that i am using list view.
I am creating an android app that is basically a listing of information on
i am creating an app that needs a database. i created it using sqlite
I am creating an Android app that will download and cache PDF files (the
I'm creating an android app that is exchanging data with a web app via
We are creating an enterprise android app that would be installed on several mobiles
I am creating an Android app that requires me to do a rest request

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.