Open hssm opened 9 years ago
I agree real profile support is important - and you are right David it is literally the reason I started hacking on this app at all hahaha. One of these days it'll get there in the meantime I'm glad you enjoy the hacky but usable parallel install workaround I made. I do use it myself (for my child's collection) so it's guaranteed to be available until real profile support comes in. Cheers
I agree real profile support is important - and you are right David it is literally the reason I started hacking on this app at all hahaha. One of these days it'll get there in the meantime I'm glad you enjoy the hacky but usable parallel install workaround I made. I do use it myself (for my child's collection) so it's guaranteed to be available until real profile support comes in. Cheers
Hi! Any updates on this?
Can we start a bounty for this? I am wiling to chip in $200.
I'd be willing to take this on, I was planning for it some time in the new year anyway
Draft of my thoughts:
EDITS in bold
Functionality
Collection
, set of SharedPreferences
and WebView Cookies/files
are the profileAnkiDroid Profiles
by default
Defaults
Unknown
Constraints
How do we handle WebView cookies Specifically: Shared Decks -> AnkiWeb login
Share it, I guess
How do we handle app shortcuts
Maybe add the profile name to each one? (I have no idea if that is possible) -> Add (David), Study (Arthur)
Profile names may contain special characters. Should the name map to a folder name?
Mimic Anki desktop behavior or allow any characters in the profile name but strip the unallowed in the folder name
Our current folder is AnkiDroid
For app private builds, doesn't seem to be a problem
For full builds, ideally the profile should be in AnkiDroid/profile name
but AnkiDroid/
already has the collection. The easiest solution I see is keeping the old AnkiDroid/
folder and if the user tries to create a new profile, default it to a new directory called AnkiDroid profiles
or some better name (ideally one that doesn't need to be localized). For new installs, we can default to this new folder
I specifically chose AnkiDroid
so we're not writing to the root of com.ichi2.anki/files
in the private directory (so AnkiDroid
can be the default profile)
For the public directory, AnkiDroid Profiles
seems ideal
How do we handle app shortcuts Maybe add the profile name to each one? (I have no idea if that is possible) -> Add (David), Study (Arthur)
I believe this is workable. Our shortcuts are dynamic.
I think we want to isolate the WebView cookies if at all possible
Widgets: probably 'unsupported' for now and have them tied to the current profile
For the add note widget, I don't suggest any work because it should deprecated when minSdk reaches Nougat and everyone can use shortcuts.
For the reviews shortcut, it needs a redesign so it can have some configurable aspect to distinct it from other instances of it (a color, icon, emoji, text, whatever).
edit: when I say redesign, I mean a whole redesign in appearance, size, etc. It doesn't need to be similar to the current one
I think we want to isolate the WebView cookies if at all possible
Now that I thought a little bit more, I agree
API 28+: WebView.setDataDirectorySuffix
Pseudocode
A profile will be of the format:
data class ProfileData(val identifier: String, var name: String) {
val webViewDataDirectory get() = identifier
fun preferences(context: Context) = context.getSharedPreferences(
name = identifier,
mode = getDefaultSharedPreferencesMode(),
)
fun rename(name: String) = TODO()
fun select() = TODO()
fun delete() = TODO("do we also delete data?")
companion object {
fun listAll(): List<ProfileData> { }
}
}
identifier
must NOT contain path separators (setDataDirectorySuffix
)
Proposal: current unix timestamp in ms
A file containing List<ProfileData>
should exist, for use on the Profile Management screen
name
inside ProfileData.preferences()
Realistic options for storage of the ProfileCollection:
SharedPreferences
using StringSet
+ concatenated string
SharedPreferences
TODO:
I'm not going to have capacity to take this through for the 2.19 series
Parallel builds simulate profiles. They don't auto-update, but you can find them:
edited by @david-allison
Originally reported on Google Code with ID 1643
Reported by
flerda
on 2013-01-26 01:18:26