Giter Club home page Giter Club logo

Comments (19)

timbze avatar timbze commented on May 26, 2024 1

After taking some time to think of this and other reading plan features in the requests (and in my head :) ), it seems to me that there is a significant amount of work that could be done on the reading plans, and it's probably the easiest to do quite a bit of it at the same time.

  1. For this request #55, my idea is to add 2 db tables to store the info, and not store anything from the reading plans in shared prefs.
    My idea is to store in table 1 (some name like readingplan_metainfo) these columns (ID, PlanName (which would be the name in use now), ShortDescription (maybe 30 char desc that would show in reading plan list), ShortCode (6 chars max, that would be shown on left, 3 chars on top and 3 on bottom), DateStart, DaysInPlan, CurrentDay)
    Table 2 (some name like readingplan_dayinfo) with these columns (readingplan_metainfoID, DayNumber, PlanChapters (which would show e.g. Matt.1,Mark.1,Luke.1,John.1), DaysRead (String of bits to show which chapters in the day are already read))
    This would require some UX changes (To edit plan descriptions, and start date, and I think the reading plan main screen and also the 3-dot menu on top right need some improvements), we can discuss those further but I would first like to hear back if you @tuomas2 or others can give me input on if I'm almost on the right path. Also, if this is a good place to discuss these details?

In the open issues about reading plans we also have #180, which could be done after this. And we have #50, which I think goes right together with my plans here. And your comment on shared prefs to db could also be done afterward.

Looking forward to further discussion, and other's input on my ideas here.

from and-bible.

timbze avatar timbze commented on May 26, 2024

I would be interested to try and implement this. I see that the bookmarks and notes are just backed up and restored via the DB file.
I'm not sure what would be the best way to backup the reading plan progress. My idea is that we can do 1 out of 2 things, either

  1. Add another text file with same name as DB file name + suffix, and add the reading plan info there, or
  2. Make a way to add the reading plan info to the DB before backing it up

Any input is appreciated.

from and-bible.

tuomas2 avatar tuomas2 commented on May 26, 2024

I think it would be better to bundle it to database one way or another to keep things in one place and make backup/restore simpler. And not store it just before backing up, but store and read it always from/to there.

I haven't touched personally reading plan code (actually haven't even used it really), so I'm not yet familiar with what data is stored in reading plan / it's progress. But even if it is not naturally suitable for database, you can always create a table for it, and store the progress by serializing it into string on a string field. Then I would recommend similar approach as I'm using for SpeakSettings and PlaybackSettings (see SpeakSettings.kt).

Are you planning to start implementing this soon? Perhaps we could have a little more conversation and I could also see the current implementation a bit more so that I would know more what I am talking about.

from and-bible.

timbze avatar timbze commented on May 26, 2024

I will not be working on this too quick, as I have other things that are keeping me busy too, but probably within a few weeks.

The basic of it is the current day you're reading on is stored in SharedPreferences as a serialized string to store which chapters from this day are read and which ones are not. I didn't look into all the details of how it is being done, but I know that it does not store for previous days. The app does not let you progress till the day is complete, so then it knows that all previous days are complete, therefore no extra storage needed for previous days.

I think it is a good idea to just bundle it into DB.

Since the option is there to use one of the bundled reading plans or add your own customized plan, I would have to figure out how to store which plans are being used, and the progress for each. And make sure that the customized plans also would be available after the restore. But it shouldn't be too much work.

from and-bible.

tuomas2 avatar tuomas2 commented on May 26, 2024

Actually it would be nice if shared preferences were persisted into that database too. Not sure if it is easily done, but might be.

from and-bible.

tuomas2 avatar tuomas2 commented on May 26, 2024

Sounds good to me @timbze

from and-bible.

timbze avatar timbze commented on May 26, 2024

In v313 (in beta as of July 26, 2019) those who have Android 6.0+ can enable Google automatic backup, and also have the option Automatic restore set to "On", then on app reinstall from same account should get reading plan progress, notes, and bookmarks automatically restored. (12cb4bd)

It shall eventually, hopefully soon, also backup along with the backup feature in AndBible

from and-bible.

tuomas2 avatar tuomas2 commented on May 26, 2024

Implemented in build 319.0

from and-bible.

bvahedy avatar bvahedy commented on May 26, 2024

from and-bible.

tuomas2 avatar tuomas2 commented on May 26, 2024

Backup file is the same .db file that is used for bookmarks.

from and-bible.

bvahedy avatar bvahedy commented on May 26, 2024

I started a reading plan and did a backed up, then I uninstalled and reinstalled installed AndBibl. I then restored the notes and bookmarks. But when I looked at the reading plan non had been started.
Can someone else try this and see if it works for them.

from and-bible.

timbze avatar timbze commented on May 26, 2024

@bvahedy I should have given a bit more detail, but the only thing that is not backed up is which was your current reading plan. Once you select the plan you were on, the progress should be there. The plan start date should be restored, along with the reading day you were on, and the chapters you had already read.

from and-bible.

bvahedy avatar bvahedy commented on May 26, 2024

from and-bible.

timbze avatar timbze commented on May 26, 2024

And Bible stores which plan you have last been reading (what I called the current reading plan)
When you restore a backup, And Bible does not know which is the plan you have last been using, so you have to select it. When you select the plan, your progress in the plan will be there.

from and-bible.

timbze avatar timbze commented on May 26, 2024

All the plan progress is backed up. Only which plan you were last on is not backed up, and that's why when you go into reading plans the first time after a re-install, it asks you which plan you want to open. As you open it, it should be exactly as it was when backed up.

from and-bible.

bvahedy avatar bvahedy commented on May 26, 2024

from and-bible.

timbze avatar timbze commented on May 26, 2024

from and-bible.

bvahedy avatar bvahedy commented on May 26, 2024

from and-bible.

bvahedy avatar bvahedy commented on May 26, 2024

Verified this feature working in build 319.4

from and-bible.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.