Domanda

This may be too broad of a question, but how does one access a Bible document in an Android application? Is it a text file that has an index to find specific verses or is it something much more complicated? I hope that is enough to answer from.

È stato utile?

Soluzione

The first step would be to actually find a structured bible dataset from somewhere.

You can search and try to see if there's an xml version of your favourite translation somewhere, and maybe download that.

Once you've got it (either as xml, json, or whatever format), you can write some Java code to parse the file, and load it into some appropriate data structure that allows you to do what you want with it efficiently (eg. search it by verse).

You could even put it into a database (eg. MySQL or MongoDB), which would allow you to search it efficiently.

But really, how you want to structure the data depends on how you're going to use it, and what formats it's already available in (as it could be a pain to clean up the XML).


You might find the following resources useful:

These would mean avoiding a lot of the headaches of dealing with file formats, indexing, and all kinds of other stuff.

Web service APIs generally work by your program submitting a query to a website (eg. including the biblical reference), and you get back some structured data (eg. xml/json) containing the verse(s) you requested.

This would mean you have to find, download, parse, and index your own data structure for dealing with the text, but it would be much faster (if done right) than using a web service to do it.

The link I posted here has only some example books from the bible, but if you look you'll find more around the web.

Altri suggerimenti

It completely depends on the format of the file.

Any book or text document has multiple ways it can be stored and distributed. It could simply be in a .pdf file, or it could be stored in an XML, or .epub

It is beyond broad, because there are so many ways to do it, it's impossible to guess without more information.

This link has some information about the e-book formats:

http://en.wikipedia.org/wiki/Comparison_of_e-book_formats

And that's just one small subsection of ways text can be stored.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top