Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Periodical Subscription Feature

thushv89 edited this page Jul 13, 2012 · 3 revisions

In FbreaderJ, when a user needs to download a periodical (Newspaper/Magazine) they "explicitly" have to go to the Periodical Details Screen and Select download. This can become painful for a user, who would like to subscribe to a certain periodical. User would have to keep an eye for new editions/revisions and download them manually by themselves. Here I will be trying to come up with a solution for this issue with minimal user interaction.

With the new proposed subscription feature, user gets following benefits. 1. User do not need to keep an eye on new editions/revisions of a periodical 2. User do not have to manually download the periodical. All the user have to do is, go to the Periodical Detail screen and check 'Keep me updated with the latest issues'. And fbreaderj will automatically download books for the user.

Implementation Details

I'll be updating the package org.geometerplus.android.fbreader.subscription, with following classes

 PeriodicalDataSource
    Open/Close DB connection
    CRUD new periodical entries
 SQLiteHelper
    Create Table
    Define table structure
 DbPeriodicalEntity
    A single entity in the DB table
    Periodical ID, Title, Latest Edition, Latest Revision

Also I will be adding a Service class called PeriodicalDownloadService (Background process for downloading periodicals)

and IPeriodicalAPI (API for accessing the service)

How it works

 Downloading will happen as a background process (i.e. Android Service)
 First application will determine the periodicals user is subscribed to (from the DB) and store them to an Array
 Then application will iterate through the list of periodicals and will check whether new edition/revision is available
 If available, download the periodical (Show a small notification icon on the notification bar, that periodicals are   being downloaded)

Concerns

 Internet BandWidth usage
 Storage usage

Overcoming the issues

 For newspapers, download only the latest edition/revision if user misses a several editions/revisions
 For magazines, this is not applicable. Therefore we're currently working on a workaround for that.
 Show/Voice a warning, when running low on storage space.