kiwix / kiwix-android

Kiwix for Android
https://android.kiwix.org
GNU General Public License v3.0
867 stars 443 forks source link

Open Wikipedia Links #731

Open TimMagee opened 6 years ago

TimMagee commented 6 years ago

Could Kiwix Android open wikipedia.org links?

Or would this be too difficult?

mhutti1 commented 6 years ago

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.

TimMagee commented 6 years ago

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.

siddharthks2010 commented 6 years ago

@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>
mhutti1 commented 6 years ago

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

siddharthks2010 commented 6 years ago

@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?

mhutti1 commented 6 years ago

Yes something like that.

siddharthks2010 commented 6 years ago

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.

mhutti1 commented 6 years ago

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

kelson42 commented 6 years ago

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

mhutti1 commented 6 years ago

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

stale[bot] commented 5 years ago

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] commented 4 years ago

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.

TimMagee commented 2 years ago

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

stale[bot] commented 2 years ago

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.

kelson42 commented 1 year ago

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

ThreeDeeJay commented 5 months ago

Any updates on this?

This tickets depends in addition of the implementation of openzim/mwoffliner#278

Looks like it was implemented 👀 https://github.com/openzim/mwoffliner/pull/552