Difference between revisions of "KiwixKolibri"

Jump to navigation Jump to search
some changes from yesterday
(updates from initial discussions)
(some changes from yesterday)
 
(3 intermediate revisions by the same user not shown)
Line 230: Line 230:
** Kiwix renders a custom ZIMfile that conains fractions + 3 links deep
** Kiwix renders a custom ZIMfile that conains fractions + 3 links deep


* Stickers & Swag
* Include content from ZIM files in Koibri
** Kolibri <3 Kiwix (Lovebirds :) )
** Example use case: in order to avoid duplication of supporting code,
 
(please add ideas here)
 




Line 253: Line 250:
* ACTION_VIEW intents that start with `kolibri://<path>` will be handled by the Kolibiri app (see below)
* ACTION_VIEW intents that start with `kolibri://<path>` will be handled by the Kolibiri app (see below)
* ACTION_VIEW intents starting with `kiwix://<path>` will be handled by the Kiwix app,
* ACTION_VIEW intents starting with `kiwix://<path>` will be handled by the Kiwix app,
* Suppose you're in the Kiwix app and you're browsing some videos from KA zim file. The exercises don't work within the Kiwix appthough, but you can click on an perseus exercise and the Kiwix app will send you to the Kolibri app as follows
* Suppose you're in the Kiwix app and you're browsing some videos from KA zim file.
Uri exercise = Uri.parse("kolibri:/learn/#/1ceff53605.../topics/c/845ce535...");<br>Intent callIntent = new Intent(Intent.ACTION_VIEW, exercise);
The exercises don't work within the Kiwix appthough, but you can click on an perseus exercise and the Kiwix app will send you to the Kolibri app as follows
// do check here
 
callIntent.startActivity()
    Uri exercise = Uri.parse("kolibri:/learn/#/1ceff53605.../topics/c/845ce535...");
    Intent callIntent = new Intent(Intent.ACTION_VIEW, exercise);
    // do check here
    callIntent.startActivity()
 
We could something like this in the Kolibri android app manifest:
We could something like this in the Kolibri android app manifest:
 
     <activity
     <activity
         android:name=".activities.LinkDispatcherActivity"
         android:name=".activities.LinkDispatcherActivity"
Line 264: Line 265:
         android:launchMode="singleInstance"
         android:launchMode="singleInstance"
         android:theme="@android:style/Theme.NoDisplay" >
         android:theme="@android:style/Theme.NoDisplay" >
        <nowiki>
         <intent-filter>
         <intent-filter>
             <action android:name="android.intent.action.VIEW"/>
             <action android:name="android.intent.action.VIEW"/>
             <category android:name="android.intent.category.DEFAULT"/>
             <category android:name="android.intent.category.DEFAULT"/>
             <category android:name="android.intent.category.BROWSABLE"/>
             <category android:name="android.intent.category.BROWSABLE"/>
             <data android:scheme="kolibri" />
             <data android:scheme="kolibri"/>
             '''<nowiki><data android:host="view_channel"/></nowiki>'''
             <data android:host="view_channel"/>
             <nowiki><data android:host="view_node"/></nowiki>
             <data android:host="view_node"/>
             <nowiki><data android:pathPattern=".*"/></nowiki>
             <data android:pathPattern=".*"/>
         </intent-filter>
         </intent-filter>
        </nowiki>
     </activity>
     </activity>


in the Kiwix android app
in the Kiwix android app
 
 
     <activity
     <activity
         android:name=".activities.LinkDispatcherActivity"
         android:name=".activities.LinkDispatcherActivity"
Line 282: Line 286:
         android:launchMode="singleInstance"
         android:launchMode="singleInstance"
         android:theme="@android:style/Theme.NoDisplay" >
         android:theme="@android:style/Theme.NoDisplay" >
        <nowiki>
         <intent-filter>
         <intent-filter>
             <action android:name="android.intent.action.VIEW"/>
             <action android:name="android.intent.action.VIEW"/>
             <category android:name="android.intent.category.DEFAULT"/>
             <category android:name="android.intent.category.DEFAULT"/>
             <category android:name="android.intent.category.BROWSABLE"/>
             <category android:name="android.intent.category.BROWSABLE"/>
             <data android:scheme="kiwix" />
             <data android:scheme="kiwix"/>
             '''<nowiki><data android:host="view_zimfile"/></nowiki>'''
             <data android:host="view_zimfile"/>
             <nowiki><data android:host="view_page"/></nowiki>
             <data android:host="view_page"/>
             <nowiki><data android:pathPattern=".*"/></nowiki>
             <data android:pathPattern=".*"/>
         </intent-filter>
         </intent-filter>
        </nowiki>
     </activity>
     </activity>


To verify there is an activity available that can respond to the intent, call <code>queryIntentActivities()</code> to get a list of activities capable of handling your <code>Intent</code>. If the returned <code>List</code> is not empty, you can safely use the intent. For example:
To verify there is an activity available that can respond to the intent, call <code>queryIntentActivities()</code> to get a list of activities capable of handling your <code>Intent</code>. If the returned <code>List</code> is not empty, you can safely use the intent. For example:
16

edits

Navigation menu