When you first open the app, tap Allow on the permission dialog
The app will request: com.ichi2.anki.permission.READ_WRITE_DATABASE
2. Grant Permission Manually
If you previously denied:
Open Android Settings → Apps
Find AnkiDroid Companion
Tap Permissions
Find and enable the AnkiDroid permission
Restart AnkiDroid Companion
3. Permission Callback Handling
// From MainActivity.kt:97-115override fun onRequestPermissionsResult( requestCode: Int, permissions: Array<out String>, grantResults: IntArray) { super.onRequestPermissionsResult(requestCode, permissions, grantResults) for ((index, _) in permissions.withIndex()) { val permission = permissions[index] val grantResult = grantResults[index] if (permission == AddContentApi.READ_WRITE_PERMISSION) { if (grantResult == PackageManager.PERMISSION_GRANTED) { startApp() } else { explainError("AnkiDroid Read Write permission is not granted, please make sure that it is given!") } } }}
This permission is required on Android 6.0 (API 23) and above. On older Android versions, the permission is automatically granted.
Check AnkiDroid directly to see if you have cards scheduled for review
The companion app only shows cards that are currently due in AnkiDroid
2. Wrong Deck Selected
Open AnkiDroid Companion
Use the deck dropdown to select a different deck
Tap Refresh to load cards from the new deck
3. Card Query Returns Null
// From MainActivity.kt:153-164val card = mAnkiDroid.queryCurrentScheduledCard(deckID)if (card != null) { mAnkiDroid.storeState(deckID, card) Notifications.create().showNotification(this, card, deckName, false)} else { // No cards to show. val emptyCard = CardInfo() emptyCard.cardOrd = -1 emptyCard.noteID = -1 mAnkiDroid.storeState(deckID, emptyCard) Notifications.create().showNotification(this, null, "", false)}
4. Complex Card Formatting
From the README:
Currently this app only supports simple cards with small texts that doesn’t include any HTML. If your case involves complex scenarios, you can try to implement them or create an issue.
1. Notification Permission Denied
On Android 13+, notification permission is required:
<!-- From AndroidManifest.xml:5 --><uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
2. Notifications Disabled in System Settings
Even with permission granted, notifications can be disabled per-app.3. Notification Channel Issues
The app creates a notification channel:
// From MainActivity.kt:32-43private fun createNotificationChannel() { val name = "AnkiNotificationChannel" val descriptionText = "Channel for anki notifications" val importance = NotificationManager.IMPORTANCE_DEFAULT val channel = NotificationChannel("channel_id", name, importance).apply { description = descriptionText } val notificationManager: NotificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager notificationManager.createNotificationChannel(channel)}
The periodic worker checks every 8 hours for new cards when you’ve finished a deck:
// From MainActivity.kt:45-56private fun startPeriodicWorker() { Log.i("BackgroundService", "startBackgroundService called from MainActivity") val periodicWorkRequest = PeriodicWorkRequest.Builder( PeriodicWorker::class.java, 8, TimeUnit.HOURS ).build() WorkManager.getInstance(this).enqueueUniquePeriodicWork( "WORKER_ANKI", ExistingPeriodicWorkPolicy.REPLACE, periodicWorkRequest )}
// From PeriodicWorker.kt:23-54private fun checkNotifications() { var mAnkiDroid = AnkiDroidHelper(applicationContext) val localState = mAnkiDroid.storedState if (localState == null) { Log.i("BackgroundService", "Periodic worker - Local state is null") return } // This is not an empty card, don't do anything. if (localState.cardOrd != -1 || localState.noteID != (-1).toLong()) { return } // No card found on local state found, try to get the next scheduled card. val nextCard = mAnkiDroid.queryCurrentScheduledCard(localState.deckId) if (nextCard != null) { mAnkiDroid.storeState(localState.deckId, nextCard) Notifications.create().showNotification(applicationContext, nextCard, mAnkiDroid.currentDeckName, false) }}
Minimalistic Card SupportCurrently this app only supports simple cards with small texts that doesn’t include any HTML. If your cards have complex formatting, they may not display correctly.
Skipping CardsThere’s currently no way to skip a card without answering it. You must select one of the four ease ratings.
Study IntervalThe 8-hour check interval for new cards is hardcoded. This may become configurable in future versions.