kiwix-android icon indicating copy to clipboard operation
kiwix-android copied to clipboard

Open Wikipedia Links

Open TimMagee opened this issue 7 years ago • 16 comments

Could Kiwix Android open wikipedia.org links?

Or would this be too difficult?

TimMagee avatar May 14 '18 17:05 TimMagee

I did do some preliminary research into this and as far as I am aware to open domain links like that requires control over domain you are accessing.

mhutti1 avatar May 14 '18 18:05 mhutti1

Hmmm . . . . All the unofficial Reddit apps can open Reddit links. NewPipe can open Youtube links. Twidiere can open Twitter links. I don't think we need to control wikipedia.org to register as an opener for wikipedia.org links. Remember, we are simply registering our app withing the android system.

TimMagee avatar May 18 '18 01:05 TimMagee

@TimMagee @mhutti1 , Actually, it just requires an intent filter.

screenshot_20180518-075048

You just need to add the following code in the android manifest:

<intent-filter>
  <action android:name="android.intent.action.VIEW" />
  <category android:name="android.intent.category.DEFAULT" />
  <category android:name="android.intent.category.BROWSABLE" />
  <data android:host="www.wikipedia.com" android:scheme="http" />
</intent-filter>

siddharthks2010 avatar May 18 '18 02:05 siddharthks2010

Oh ok. I equated offline search with linking for some reason. Is there a way to programmically add hosts though?

mhutti1 avatar May 18 '18 16:05 mhutti1

@mhutti1 I am not quite sure I understand. By "programmically adding hosts", do you mean that we add a set of hosts in a resource file and run a loop in the android manifest, and reference a host from the file in each iteration to make the intent filter?

siddharthks2010 avatar May 19 '18 02:05 siddharthks2010

Yes something like that.

mhutti1 avatar May 20 '18 13:05 mhutti1

I did some research on this topic, but i couldn't find much. I don't think we can add the loop directly in the xml file. However, we can write a simple python script that takes a resource file containing the hosts and generate the required xml code.

siddharthks2010 avatar May 21 '18 02:05 siddharthks2010

Ok, we can at least add a few different popular ones even if we can't do it programmically.

mhutti1 avatar May 21 '18 09:05 mhutti1

This tickets depends in addition of the implementation of https://github.com/openzim/mwoffliner/issues/278

kelson42 avatar Jun 10 '18 12:06 kelson42

It might be possible to implement this without that fix with a small workaround to edit the URL before passing it.

mhutti1 avatar Jun 28 '18 21:06 mhutti1

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

stale[bot] avatar Jun 26 '19 05:06 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

stale[bot] avatar Jul 01 '20 13:07 stale[bot]

This issue is still as relevant today as it ever has been.

TimMagee avatar Oct 22 '21 01:10 TimMagee

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

stale[bot] avatar Jan 03 '22 21:01 stale[bot]

Here one problem is as well that, how to know that Kiwix has actually the ZIM able to provide the specific Wikipedia article provided?

kelson42 avatar Jan 07 '23 17:01 kelson42