Recently Written · git

subread-anki

One tap makes an Anki card on Android: word, definition, sentence, screenshot, audio. Works with any app, with SubRead Dictionary and SubRead Overlay.

git clone https://github.com/equwal/subread-anki

Log | Files | Refs


app/src/main/AndroidManifest.xml (5808 bytes)

1 <?xml version="1.0" encoding="utf-8"?>
2 <manifest xmlns:android="http://schemas.android.com/apk/res/android">
3 
4     <!-- The cards go into AnkiDroid through its API. Android asks the user once. -->
5     <uses-permission android:name="com.ichi2.anki.permission.READ_WRITE_DATABASE" />
6 
7     <!-- For an audio or a picture at a URL that a sender gives, for example a web reader. Nothing else. -->
8     <uses-permission android:name="android.permission.INTERNET" />
9 
10     <!--
11         The capture: the sound and the screen of the player, while the user has it on. Android
12         asks the user each time the capture starts, and shows it in the status bar.
13     -->
14     <uses-permission android:name="android.permission.RECORD_AUDIO" />
15     <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
16     <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />
17     <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
18 
19     <!--
20         The apps this one talks to. Android 11 and later hide other apps without this. The
21         providers are named too, so that the debug builds of the dictionary and the overlay
22         are found as well.
23     -->
24     <queries>
25         <package android:name="com.ichi2.anki" />
26         <package android:name="space.subread.overlay" />
27         <package android:name="space.subread.dictionary" />
28         <provider android:authorities="space.subread.dictionary.lookup" />
29         <provider android:authorities="space.subread.dictionary.debug.lookup" />
30         <provider android:authorities="space.subread.overlay.player" />
31         <provider android:authorities="space.subread.overlay.debug.player" />
32     </queries>
33 
34     <application
35         android:allowBackup="true"
36         android:icon="@drawable/icon"
37         android:label="@string/app_name"
38         android:supportsRtl="true"
39         android:theme="@android:style/Theme.DeviceDefault.Light.NoActionBar">
40 
41         <!-- The settings: AnkiDroid, the deck, the note type, the capture. -->
42         <activity
43             android:name=".MainActivity"
44             android:exported="true">
45             <intent-filter>
46                 <action android:name="android.intent.action.MAIN" />
47                 <category android:name="android.intent.category.LAUNCHER" />
48             </intent-filter>
49         </activity>
50 
51         <!--
52             The pop-up, the same as a dictionary: the text, the terms at the word, and one
53             "+ Anki" button for each. Doors: the text selection menu of Android ("SubRead Anki"),
54             the share sheet (a text or a picture), the action space.subread.anki.action.ADD
55             from another app, and the link subreadanki://add from a web page. A request that
56             brings its own definition is added at once, with no pop-up. See README.md.
57         -->
58         <activity
59             android:name=".AddActivity"
60             android:excludeFromRecents="true"
61             android:exported="true"
62             android:taskAffinity=""
63             android:theme="@style/Popup">
64             <intent-filter>
65                 <action android:name="android.intent.action.PROCESS_TEXT" />
66                 <category android:name="android.intent.category.DEFAULT" />
67                 <data android:mimeType="text/plain" />
68             </intent-filter>
69             <intent-filter>
70                 <action android:name="android.intent.action.SEND" />
71                 <category android:name="android.intent.category.DEFAULT" />
72                 <data android:mimeType="text/plain" />
73                 <data android:mimeType="image/*" />
74             </intent-filter>
75             <intent-filter>
76                 <action android:name="space.subread.anki.action.ADD" />
77                 <category android:name="android.intent.category.DEFAULT" />
78             </intent-filter>
79             <intent-filter>
80                 <action android:name="android.intent.action.VIEW" />
81                 <category android:name="android.intent.category.DEFAULT" />
82                 <category android:name="android.intent.category.BROWSABLE" />
83                 <data android:scheme="subreadanki" android:host="add" />
84             </intent-filter>
85         </activity>
86 
87         <!-- Asks Android for the capture, then starts the service. Shows nothing of its own. -->
88         <activity
89             android:name=".CaptureActivity"
90             android:excludeFromRecents="true"
91             android:exported="false"
92             android:taskAffinity=""
93             android:theme="@android:style/Theme.Translucent.NoTitleBar" />
94 
95         <!-- Keeps the last minutes of the sound of the player and the last picture of the screen. -->
96         <service
97             android:name=".CaptureService"
98             android:exported="false"
99             android:foregroundServiceType="mediaProjection" />
100 
101         <!-- The tile in the quick settings: capture on, capture off. -->
102         <service
103             android:name=".CaptureTile"
104             android:exported="true"
105             android:icon="@drawable/icon"
106             android:label="@string/tile_label"
107             android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
108             <intent-filter>
109                 <action android:name="android.service.quicksettings.action.QS_TILE" />
110             </intent-filter>
111         </service>
112 
113         <!-- Hands a media file to AnkiDroid, which copies it into the collection. -->
114         <provider
115             android:name=".MediaProvider"
116             android:authorities="${applicationId}.files"
117             android:exported="false"
118             android:grantUriPermissions="true">
119             <meta-data
120                 android:name="android.support.FILE_PROVIDER_PATHS"
121                 android:resource="@xml/file_paths" />
122         </provider>
123     </application>
124 </manifest>