h5rcode / BlackBooks

This repository contains the source code for the Black Books Android app.
1 stars 2 forks source link
android books dagger2 google-books openlibrary

BlackBooks

This repository contains the source code for the Black Books Android app.

<img alt="Get it on Google Play" src="https://play.google.com/intl/en_us/badges/images/apps/en-play-badge.png" />

App features

Black Books helps you make an inventory of your books and manage them!

Privacy policy

This application DOES NOT collect any data from your device.

Permissions

Black Books requires the following permissions:

Implementation

Data storage

Black Books creates a SQLite database on the user's device to store all the information about the books (including thumbnails).

Caching

The book thumbnails are Bitmap images stored in the SQLite database as BLOBs (Binary Large Objects).

When displaying the list of all the books in the user's library, the app executes a select from table BOOK. The column where the thumbnails are stored is excluded from the select because the thumbnails are loaded separately using the class ThumbnailManager

The ThumbnailManager class loads the thumbnails asyncronously and stores them in a LruCache, providing a safer memory management. When the thumbnail of a book must be displayed, ThumbnailManager first checks if it is not already in the LruCache. If it is, the Bitmap is immediately returned (avoiding a select in the database), otherwise the thumbnail is loaded in an AsyncTask and stored in the LruCache.

ISBN lookup

When the device is connected to the Internet, Black Books can perform ISBN lookups by making calls to the following services:

All the classes implementing the ISBN lookup are defined in package com.blackbooks.services.search. The entry point is the method search(String isbn) in class BookSearcher which calls each service and merges their results into a single instance of BookInfo.

The call to each service is implemented by a corresponding Java class that sends a HTTP request and parses the response before returning the result.