AnkiDroid intent and sync'ing with Tasker

107 views
Skip to first unread message

Nelson eM Oh Kay

unread,
Nov 25, 2022, 2:52:15 PM11/25/22
to AnkiDroid
AnkiDroid is a wonderful piece of software, however because I juggle between the desktop and phone I sometimes run into the issue of the Anki database being out of sync when I use a specific device. For example I'll knock out some cards while on the phone and forget to sync because I've switched to another app and then realize that the database is out of sync when I go to the desktop and vice versa. To combat this I have a Tasker profile that executes the built-in AnkiDroid intent com.ichi2.anki.DO_SYNC. this works, however when the phone is off and locked AnkiDroid fails with the message that there's a network error. any idea why this is?

also, when this intent is executed and I'm currently in an app it brings AnkiDroid to the foreground, does the sync and stays there. is there any way to sync in the background so one never sees it except for maybe a notification after it's executed on whether it was successful or not?

Mike Hardy

unread,
Nov 27, 2022, 8:18:54 AM11/27/22
to anki-a...@googlegroups.com, Nelson eM Oh Kay


Hi there!


Great use of the Tasker Intent - I don't think many people use that, it's very rare for anyone to mention it


At any rate - this sounds like some sort of power management that is device specific (similar to https://dontkillmyapp.com/)


Perhaps you need to adjust power settings to allow background data for AnkiDroid, or turn off power saving or similar?


There is currently not a way to sync in the background but syncing in general and how we communicate progress to the user is an area of active development. For the media sync (the second sync phase) at least that will be a foreground service / "sticky notification" in the future, though the initial phase ("collection sync") that is still a blocking foreground sync. Allowing it to just be a foreground / sticky notification if the whole app is in the background could be a feature request if you want to enqueue it - https://github.com/ankidroid/Anki-Android/issues/new/choose


Hope this helps -

-Mike


On 11/25/22 14:52, Nelson eM Oh Kay wrote:
AnkiDroid is a wonderful piece of software, however because I juggle between the desktop and phone I sometimes run into the issue of the Anki database being out of sync when I use a specific device. For example I'll knock out some cards while on the phone and forget to sync because I've switched to another app and then realize that the database is out of sync when I go to the desktop and vice versa. To combat this I have a Tasker profile that executes the built-in AnkiDroid intent com.ichi2.anki.DO_SYNC. this works, however when the phone is off and locked AnkiDroid fails with the message that there's a network error. any idea why this is?

also, when this intent is executed and I'm currently in an app it brings AnkiDroid to the foreground, does the sync and stays there. is there any way to sync in the background so one never sees it except for maybe a notification after it's executed on whether it was successful or not?
--
You received this message because you are subscribed to the Google Groups "AnkiDroid" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anki-android...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/anki-android/a56d2b32-217c-4a60-959c-25fbff712283n%40googlegroups.com.

Nelson

unread,
Nov 29, 2022, 12:00:59 PM11/29/22
to Mike Hardy, anki-a...@googlegroups.com
Hi Mike, thank you for the insightful reply, as it was very helpful. The battery optimizing indeed helped with the AnkiDroid syncing with the intent! Looking forward to the future developments to AnkiDroid!




Best Regards,
Nelson


Reply all
Reply to author
Forward
0 new messages