English Version! (1.1)

Now that we have King James Version text, why not translate the app into English and publish it too, with KJV as the default text? Yes, that’s interesting!

Although there are many KJV Bible app on Android Market, I believe some people will be more confortable with this app, namely the speed of displaying Bible text which I found is faster than most of the available apps. And also the (hopefully) clean user interface that minimizes distraction when reading the Bible.

So, yeah, doing this is not a small task for me. The following was done in order to release the English version of the app.

  1. Moving all translatable strings from the code to strings.xml (Eclipse feature to mark literal strings as error helps a lot)
  2. Translating the strings.xml into English 
  3. Changing literal string references in resource files to @string/* resource references
  4. Converting KJV text to internal format (not .yes file, since this file is not seekable if stored inside an .apk file)
  5. Putting some logic to differentiate different enabled features between the Indonesian app and English app (e.g. No devotion, help, and versions yet for the English build)
  6. Modifying icon colors
  7. Moving all code base from yuku.alkitab package to yuku.alkitab.base package. This is done such that compiling resources (the R file) into different package does not severely affect import statements on the Java sources.
The result: different application from the same (similar) code base:
English edition of the app!
Actually I didn’t get a nice idea how to name the app. If I just named it “KJV Bible”, it will be similar to those other app in the market. Maybe I will emphasize the quickness of the app, so I put “Quick” prefix. If you have some suggestion for the naming, please let me know!
And finally, this is the screenshot of the English interface. 
English! No devotions, no version switch, no help yet
By the way, this is called version 1.1 and released before the Indonesian release of 1.1 which will have more features enabled.

Adding other Bible versions / translations

We can only now see Indonesian Terjemahan Baru (New Translation) text. It is very impossible to view other translations like King James or even Bahasa Sehari-hari (Conversational Language) in Indonesian. Many people have requested this, but I had decided that 1.0 will not have this feature. Since 1.0 has been release, it’s time to think of this feature.

It is not easy to add support for more versions. First we don’t want to make the installer size bigger, because most of Android devices in the market do not use Android 2.2 that supports installation to external storage. Hence, the additional versions need to be downloaded separately as add-on, where the data files will be stored on an external storage (SD Card).

Another problem is deciding on the format of the additional modules. The requirements are:

  1. Must be seekable (no decompression or parsing of large blocks before reading)
  2. Must be single file (it’s hard to manage multiple files easily)
  3. Must be (quite) extensible
  4. Must support section headings and parallels
  5. Must have minimal seek count to read a whole chapter
That’s difficult. 

Actually there are many formats of Bible data, but I could not find one that is well-documented enough (and even, my data format is also not well-documented :p). So, yes, another data format for Bible text.

The file ends in .yes (it just sounds nice) and is downloaded from Google’s free web/app hosting service, appspot.com. I can be sure that it won’t be down so often and I configure the .yes files as static files, so Google will use content distribution system to optimize access speed.

For next release, I convert BIS (Bahasa Indonesia Sehari-hari) from bibledatabase.org text and sabda.org section headings and parallels, and King James / KJV text from bibledatabase.org to .yes format and made it available on the main menu of the Bible app. Finally, you see the first English text after so many Indonesian screenshots in this site!

King James Version

All the book names change. When entering the verse address, “Kej” (Kejadian aka Genesis) will not work, but “Gen” will.

And this is the dialog to choose the version:

Select Version

Now, we have an English text, why do we publish only the Indonesian Bible app? Why not translate the app into English and publish it too? Stay tuned!

1.0 Release

8 months after the first development, finally 1.0 is released!

New features and many clean ups from the previous version is here:

  • Indentations for Psalms
  • Neater verse display, with regular line spacing
  • Can keep screen on when reading
  • New search engine without pre-indexing
  • Move to different books when going prev/next chapters
  • Share verses via SMS, Email, etc according to installed apps
  • Annotations to verses
  • Bookmarks can have editable titles
  • Customizable colors with color themes or free choice
  • Font size can be more freely set with real preview
  • Small title bar for chapter address
  • Searching can be narrowed down to OT/NT
  • Much neater scrolling using up/down buttons
  • High-resolution icons for hdpi devices
  • Correction to many typos in the Bible text – available for request
  • Status message when downloading devotions
  • Renungan Harian devotion now has clickable verse addresses
  • Go To screen made fit for small screens
  • New graphics for left/right buttons
All the glory is for God alone! 
Soli Deo Gloria
Download it from the Android Market by searching “Alkitab” or scanning the QR code below:
http://market.android.com/search?q=bible+yuku (openable on devices only)

Preparing for 1.0 — colors galore

Do we need to stick with black background, white text, and blue verse numbers? User feedback says No!

Previously there is a setting to change the brightness of the text – the text stays white (or gray), the background is still black. Many requests say they want white background and black text.

Rather than satisfying individual request, why not allow us to customize the colors as free as we want?

Select color dialog

The above select color dialog is inspired by Adobe Photoshop. It was not easy for me to create that, because I need to understand combining gradient paints and converting between color values. I’m thinking of open sourcing this component soon [Update: now available].

But — isn’t it troublesome to select the colors for each of the background, text, and verse numbers?

Now we have Color Themes. Instead of selecting the colors one by one, we have presets for users to choose. They have names (in Indonesian), but they’re just meaningless really.

Color Theme
2 Blackboard
3 Tropic Lush
4 Moss Lake
5 Warm Ash
6 Sweet Orange

Now we are not forced to see black-and-white anymore, but colors! The colors are applied for bookmarks and devotion screens too ^^

Colorful enough?

Preparing for 1.0 — new search engine

There is a happy and sad moments recently. Happy because Google has just released Android 2.2, a very cheerful update that speeds up most applications by about 2x. My phone become super fast. Sad because the full-text search powered by SQLite FTS3 does not work anymore.

So I think, while the have-to-make-index-first thing is not so good too, it’s better to make another search engine that doesn’t use SQLite. Instead, the words are searched by scanning the Bible text and finding substrings. If there are multiple words, the subsequent words are looked for from the earlier result.

Performance was not satisfying – on the first correct attempt it took 2.5 minutes to search one word when running in the emulator (~40 seconds on Nexus One). The slowness I found are in:

  1. Reading of Bible text data which uses custom UTF8 decoder (the internal UTF8 decoder was even slower!)
  2. Call to String#indexOf for each verse
  3. Case-insensitive matching that uses toLowerCase
After the following optimizations, it took only 3 seconds to search a word on Nexus One.
  1. Currently the Bible data is all ASCII, I skip the UTF8 decoder altogether and convert the bytes using String(byte[], int)
  2. Instead of calling it for each verse, I call it for each chapter, if something is found, then the verses are identified.
  3. Because of number 1, I can use simpler methods to convert upper case letters to lower case just by adding 0x20 to all uppercase letters.
The downside of this custom search engine is that it’s longer to search (it was < 1 second when using FTS3 engine) and no support for * and quotes. The advantages are no additional space required to store the index, the words need not be exact, and we can filter OT and NT.
Searching for two non-consecutive words

Preparing for 1.0 — improved bookmarks and annotations

Up until the previous version, we can only store bookmarks according to the verse we select. No other information is available, nothing we can type and store. Moreover many users ask about the ability to write notes.

So in this version we added annotations to write notes and ability to give a title to bookmarks.

Bookmark title can be assigned
Annotations

It is quite complicated to handle old bookmarks. When the program is started, it checks if there are bookmarks in the old version, and converts it to the newer format on startup.

Moreover, when there is a bookmark for a verse or there is an annotation assigned to the verse, there will be icons on the right side of the text.

Icons on the right of verse 1

If you notice, the arrows for prev/next chapters have also changed. That icon is made with help of Jaya Satrio Hendrick. I hope you like that new, simpler icons.

Preparing for 1.0 — do we have to be always left-aligned?

Hmm, let’s see, we want to release 1.0, but I feel that something is still need to be polished before 1.0 release. I will show you a portion of Bible text from the latest 0.9 version below. It is taken from Psalms 90. Do you see anything missing?

Psalm 90 in version 0.9

Psalms are supposed to be poetry, nicely written to express similarity, difference, emphasis, and so on. But the display above looks like plain newspaper text with uncertain spacing. It is so… wrong.

Compare that with the same chapter from version 1.0:

Psalm 90 in version 1.0

The bad news is that the indentation data is not readily available. I think we will need to copy it from the Bible book published by Lembaga Alkitab Indonesia (Indonesian Bible Society).

Fortunately with help from Roy Krisnadi, the indentation for the whole Psalms book is complete. He sent me a feedback that he would like to help. I said he could help with the indentation data. He agreed and he sent me the data over several days. Thanks!

In order to store the indentation data, a special markup is needed. I designed it (of course not without flaws) as follows:

  • Verses that contain indentation data starts with @@
  • @0 marks the beginning of non-indented text (“Doa Musa, abdi Allah” above)
  • @1 marks the beginning of single-indented text (“Tuhan, Engkaulah tempat…” above)
  • @2 marks the beginning of double-indented text (“turun-temurun.” above)
  • @8 marks the forced new line (at the end of verse 2 above).
Hence, the text shown in the screenshot is stored as:

@@@0Doa Musa, abdi Allah. @8@1Tuhan, Engkaulah tempat perteduhan kami @2turun-temurun.

@@@1Sebelum gunung-gunung dilahirkan, @2dan bumi dan dunia diperanakkan, bahkan dari selama-lamanya sampai selama-lamanya Engkaulah Allah.@8

@@@1Engkau mengembalikan manusia kepada debu, @2dan berkata: “Kembalilah, hai anak-anak manusia!”

For anyone who wants this data for purposes of developing Bible applications for web, desktop or mobile, you can request it. We have agreed to share this data to others.
For version 1.0, only Psalms has this data. We haven’t managed to input indentation data onto other books that have indentations. If anyone wants to help, please contact me via the comments section below.

Version 0.9 features Section Headings and Devotion

I feel that something is still missing before I can say that the Bible app has a version number of 1.0. What is missing? The iPhone app that har made has section headings for the verses (Indonesian: Judul Perikop).

So I ask him how to get those data. He said that he got that from a Mac program that shows section headings on Indonesian Bible, and he was able to extract the files as HTML files. However I found some typos in the section headings, in fact I saw several times in a while, so I thought I needed to copy them from my physical Bible book.

Turned out that sabda.org has the section headings all listed together! I’m so thankful to sabda.org, they have a very comprehensive resources for Bible especially for Indonesian bible study. I need to create a parser that converts the verse addresses mentioned in the page to the internal addressing used in the app. For example,

Judul: Manusia dan taman Eden
Perikop: Kej 2:8-25 (TB)

is converted to: title=”Manusia dan taman Eden” address=0x000208 (where 0x00 is the book number (0 is Genesis), 0x02 is chapter number, and 0x08 is verse number).

The problem is on the inserting of the section headings into the verse texts. I need a big concentration to write the code to insert them correctly without impacting performance too much. At the end I used two files for the section headings, one is the index where everything will be loaded into memory, and another contains all the texts of the headings.

Section headings shown

Even better, there are parallels, which indicate similar or same stories in different part of the Bible. One example,

Judul: Silsilah Yesus Kristus
Perikop: Mat 1:1-17 (TB)
Paralel: Luk 3:23-38 (TB)

which means the texts in Matthew 1:1-17 is essentially the same story as what is told in Luke 3:23-38. I want to make the parallels appear as links that can be clicked to go directly to the verse.

The parallels are shown, it is clickable to jump directly to the verse

Some fine tuning was applied for the verse address parser to recognize dash sign (which is, if “Mat 26:47-56” is clicked, it will be recognized as “Mat 26:47”).

So 0.9 was released (0.9.1 was shortly after released to fix a strange bug), and I am very happy with this, since most of the Bible app don’t have section headings and parallels. I hope this app is useful for you, to study God’s Word better.

Devotion feature details (0.9)

One of the most requested feature is the ability to display Devotion (in Indonesian it is called “Renungan” or sometimes bahan saat teduh). So many people requested that so I was very much encouraged to add this feature.

This feature is different from other features, in that this requires external support in order to make this work. We need a live web server to handle the request of devotional material, because the material itself changes every day, we cannot store it onto the program.

I decided to support two devotional material, which is Renungan Harian (Indonesian version of Our Daily Bread of RBC Ministries), and Santapan Harian (literally: daily nourishment, of Pancar Pijar Alkitab).

They can be summarized as follows according to my experience:

  • Renungan Harian is focused on showing how to relate daily events with the Scriptures. The Scripture passage is selected in order to give some message about the daily events.
  • Santapan Harian is focused on giving exposition of every chapter on the Bible, sequentially with jumps every few weeks. After exposition, the implications to our daily life is given.
Both can suit readers, although I think the latter is for later stages of Christian spirituality growth.
Like the links above indicate, they are provided by my favorite sabda.org website. I afraid that if there are more and more users use the Bible app, sabda.org will suffer. So I made some kind of proxy cache in my server at kejut.com.

Santapan Harian devotion material

The verse address that is displayed on top of the devotion is clickable to directly jump to the verse.

How if there is no Internet connection when one wants to read the devotion? Every time a material is downloaded, it is checked, whether it is valid or not (because sabda.org only has materials until a specific date in the future), then if it is, will be stored into the local database. When the devotion screen is opened, materials up to 14 days to the future will be downloaded and stored.

When I read the feedbacks, there are many users that are happy with this, and also quite a number users who had problems… however it’s because the proxy cache server is not storing the materials with the correct encoding to the cache database, and it is fixed now!

Finally, searching introduced in 0.8!

A long-awaited feature is coming in 0.8, which is word-searching.

By the way, the comments I received via Android Market and via the feedback menu is very encouraging, that allows me to continue developing the app.

However, implementing the search function is not an easy task. I wonder how to make it fast enough without introducing a big overhead to the apk (downloaded installer) size.

At the end I decided to use the FTS3 (full-text search) that is included in SQLite library which is already built-in to all Android devices. The downside is that I need to create another database for the full-text search to work, and it needs time, too.

So when the user clicks on the search menu, there will be a dialog explaining that he needs to create a file on the SD Card for the index.

For search function, you need an index. Index needs about 9MB on the SD Card, … and so on

The indexing takes a while, on my Nexus One it takes almost 5 minutes to complete (I got an Android device finally, thanks to Google’s developer day where they gave out Nexus One phones).

Creating index… Phase 5: Inserting 1500 of 31102 verses

After indexing, searching for a word takes only a fraction of a second! I’m very happy with this ^^

Searching for “israel” and “Jacob”, words need to be exact but don’t need to be consecutive

A special thanks to the id-android community, where they for the first time become testers of unreleased versions of the Bible app. They made me sure that the app is ready for release ^^

Download rate has increased to about 10 per day, up from 4 a day when 0.5 was released ^^