My name is Kristian Theilgaard and I am a software developer at Redia A/S. I am currently working on an Android application for reading e-books on your tablet or smartphone.
Disclaimer: This post might contain some slight technical details, which might require a love for algorithms, coffee and cold pizza. ;)
The eReolen project lets you easily borrow books from Danish libraries using your social security number or an existing library card number. We want to bring a modern and tangible electronic experience to the existing process of borrowing a physical book from your local library.
With such a task there will be a lot of expectations of the technology. We would like the experience of browsing and sampling books to be as fluid and responsive as possible, and so hide any technical issues in the background.
One of the problems we face when implementing user-interactive software is responsiveness with a slick interface. In this project we are utilizing paging, as seen in operating system memory handling, to lessen server load and response times on the client when the user browses the bookshelf.
When loading thousands of books onto a mobile device, this data must come fast. Our servers contact our customer’s servers and cache a lot of data locally to lessen the load on the remote backend; this will lighten the load on the customer’s server as well as increase the client download speed. However, we cannot instantly get all books as this would cause tremendous load times in the application. Thus instead of loading all 500 books for a single topic (we actually handle way more than this since we have multiple categories in various sections of the app) we page them into chunks of 9 books each.
The user can then scroll over the end of the book list to start loading 9 more books, offset from the index of the last book, as seen in the first screenshot.
The code snippet seen in the second screenshot shows how we pass a new load listener to our book list. This is used for calling the server when the user scrolls the booklist over the edge of the device, hence starting a download of 9 more books. The constant BOOKS_TO_GET will in our current implementation be set to 9, whereas the mCurrentSort variable indicates the current offset of the book list.
This asynchronous behaviour will ensure better feedback to the user as well as avoiding unnecessary download of book data we don’t need, as the user cannot see all the books on the screen anyway.
We hope you will enjoy this functionality when you are browsing e-books on your tablet, and looking for your next reading experience from the eReolen library app.