Skip to main content
AnkiDroid Companion requires two types of permissions to function properly: AnkiDroid API access and Android notification permissions.

Required Permissions

1. AnkiDroid API Permission

The app needs the READ_WRITE_PERMISSION to access AnkiDroid’s database and review cards. Permission name: com.ichi2.anki.permission.READ_WRITE_DATABASE What it allows:
  • Reading deck information
  • Querying scheduled cards
  • Submitting card reviews
  • Tracking study time
Required on: Android 6.0 (API 23) and above
This is a “dangerous” permission in Android’s security model. It must be explicitly granted by the user and can be revoked at any time from system settings.

2. Notification Permission

The app needs the POST_NOTIFICATIONS permission to display review notifications. Permission name: android.permission.POST_NOTIFICATIONS What it allows:
  • Displaying persistent notifications with cards
  • Showing completion notifications
  • Updating notifications with new cards
Required on: Android 13 (API 33) and above
<!-- From AndroidManifest.xml:5 -->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

How Permissions Are Requested

AnkiDroid API Permission

When you first launch AnkiDroid Companion, it checks if the API permission is granted:
// From MainActivity.kt:58-73
private fun setup() {
    // Api is not available, either AnkiDroid is not installed or API is disabled.
    if (!AnkiDroidHelper.isApiAvailable(this)) {
        explainError("API is not available!\n" +
                "This means either AnkiDroid is not installed or API is disabled from the AnkiDroid app")
    } else {
        mAnkiDroid = AnkiDroidHelper(this)
        if (mAnkiDroid.shouldRequestPermission()) {
            explainError("AnkiDroid Read Write permission is not granted, please make sure that it is given!")
            mAnkiDroid.requestPermission(this, 0)
        } else {
            startApp()
        }
    }
}

Permission Check Logic

// From AnkiDroidHelper.java:73-78
public boolean shouldRequestPermission() {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
        return false;
    }
    return ContextCompat.checkSelfPermission(mContext, READ_WRITE_PERMISSION) 
           != PackageManager.PERMISSION_GRANTED;
}

Permission Request

// From AnkiDroidHelper.java:85-87
public void requestPermission(Activity callbackActivity, int callbackCode) {
    ActivityCompat.requestPermissions(callbackActivity, 
                                     new String[]{READ_WRITE_PERMISSION}, 
                                     callbackCode);
}

Granting Permissions

First-Time Setup

  1. Launch AnkiDroid Companion for the first time
  2. System dialog appears asking for AnkiDroid API access
  3. Tap “Allow” to grant the permission
  4. Select a deck and tap “Refresh” to start
On Android 13+, you may see two permission dialogs: one for AnkiDroid API access and one for notifications.

Manual Permission Grant

If you previously denied permissions, you can grant them manually: Android Settings Path:
  1. Open SettingsApps
  2. Find AnkiDroid Companion
  3. Tap Permissions
  4. Enable required permissions
Notification Settings Path:
  1. Open SettingsApps
  2. Find AnkiDroid Companion
  3. Tap Notifications
  4. Enable All AnkiDroid Companion notifications

What Happens When Permissions Are Denied

AnkiDroid API Permission Denied

If you deny the API permission, the app displays an error:
// From MainActivity.kt:111
explainError("AnkiDroid Read Write permission is not granted, please make sure that it is given!")
What you’ll see:
  • Error message on the main screen
  • No deck selection available
  • “Refresh” button is hidden
How to fix:
  • Restart the app and grant permission when prompted
  • Or grant manually through Android Settings

Notification Permission Denied

If notification permission is denied:
  • Cards will still be reviewed in AnkiDroid’s database
  • But no notifications will appear
  • You won’t see cards without opening the app
Without notification permission, the core functionality of AnkiDroid Companion is unavailable. Make sure notifications are enabled in your system settings.

Permission Check During Card Queries

Before querying cards, the app verifies permissions are still granted:
// From AnkiDroidHelper.java:203-207
if (!isPermissionGranted()) {
    uiHandler.post(() -> Toast.makeText(mContext,
            R.string.permission_not_granted,
            Toast.LENGTH_SHORT).show());
}
This prevents crashes if permissions are revoked while the app is running.

Permission Verification Method

// From AnkiDroidHelper.java:89-91
public boolean isPermissionGranted() {
    return ContextCompat.checkSelfPermission(mContext, READ_WRITE_PERMISSION) 
           == PackageManager.PERMISSION_GRANTED;
}

Best Practices

Always keep permissions granted for AnkiDroid Companion to function properly. The app cannot access your cards or display notifications without these permissions.

If Permissions Stop Working

  1. Check Android Settings - Verify both permissions are enabled
  2. Restart the app - Close completely and reopen
  3. Reinstall if needed - Uninstall and reinstall from the releases page
  4. Check AnkiDroid - Ensure AnkiDroid itself is installed and working

Security & Privacy

The app only requests permissions necessary for its core functionality:
  • AnkiDroid API: Read/write access to AnkiDroid’s flashcard database
  • Notifications: Display cards in notification shade
AnkiDroid Companion does not store any card data, deck information, or review history. All data remains in AnkiDroid’s database. The companion app only acts as an interface to display and interact with your existing AnkiDroid data.

Build docs developers (and LLMs) love