heb12 / heb12mobile

Legacy Code for Heb12 Android App
https://heb12.github.io/heb12mobile/app/src/main/assets/index.html
GNU General Public License v3.0
8 stars 3 forks source link

New config file layout #24

Closed petabyt closed 4 years ago

petabyt commented 4 years ago

Old:

{ 
   "currentTranslation":"KJV2000",
   "lastBook":"Mark",
   "lastChapter":"1",
   "theme":"default",
   "font":"Arial",
   "highlightedVerses":{ 
      "John 3 16":"yellow",
      "Hebrews 4 12":"lightgreen",
      "Luke 9 23":"lightgreen"
   },
   "fontSize":18,
   "bookmarkedChapters":{ 
      "Hebrews 4":true,
      "John 3":true
   }
}

New:

{ 
   "currentTranslation":"KJV2000",
   "lastBook":"Mark",
   "lastChapter":"1",
   "theme":"default",
   "font":"Arial",
   "fontSize":18,
   "highlightedVerses":{ 
      "John 3 16":"yellow",
      "Hebrews 4 12":"lightgreen",
      "Luke 9 23":"lightgreen"
   },
   "bookmarkedChapters":[ 
      "Hebrews 4",
      "John 3"
   ]
}

Old non-JSON config file layout

/* Heb12 Configuration File - Edit at your own risk! */currentTranslation=KJV2000;lastBook=Genesis;lastChapter=1;theme=Default;font=Arial;highlightedVerses={"John_3_16":"yellow","Hebrews_4_12":"lightgreen","Luke_9_23":"lightgreen"};fontSize=18;bookmarkedChapters={"Hebrews_4":true,"John_3":true};
MasterOfTheTiger commented 4 years ago

Okay. Is there also a way to store it in a specific folder for Heb12? I mean, other Android apps have their old folder under Android/data, couldn't Heb12 do the same?

petabyt commented 4 years ago

When I added the config file, I didn't think I was going to add downloadable translations. It currently looks like this:

root
 Heb12Config
 translations
  kjv.json
  kjv2000.json

It should probably look like this:

root
 Heb12
  translations
   kjv.json
   kjv2000.json
  configuration.txt

If I were to move it, I would have to write a script to detect a /Heb12 directory, and then somehow rearrange the files.

MasterOfTheTiger commented 4 years ago

You should move the config to a standard directory. https://android.stackexchange.com/questions/47924/where-android-apps-store-data

The translations can easily be put under root/heb12. That way users can easily have access to them.

petabyt commented 4 years ago

After I make a script to move the translations folder and Heb12config to /heb12, we can review all the changes and make sure it is ready for the next release.

petabyt commented 4 years ago

I'm just making a task list to help myself

petabyt commented 4 years ago

@MasterOfTheTiger I read on Stack Overflow that a folder in /data/data on the Android device would allow for app data to be put there, and be automatically deleted during uninstall. I though this would be better, but you wouldn't have the freedom to manually modify the app files.

MasterOfTheTiger commented 4 years ago

Here is an idea: store the config there. But put the downloaded translations in an Heb12 folder in the user accessible directory.

petabyt commented 4 years ago

I personally like to have the config file there, just in case something goes wrong, I can go in and change it. It also gives users the ability to share their config files with others, and make backups.