Last modified: 2012-02-24 02:52:33 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T34667, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 32667 - Open Wikipedia url in the app
Open Wikipedia url in the app
Status: RESOLVED FIXED
Product: Wikipedia App
Classification: Unclassified
Generic (Other open bugs)
1.0.0 (Android)
All All
: Unprioritized enhancement
: ---
Assigned To: Yuvi Panda
:
Depends on:
Blocks: 33957
  Show dependency treegraph
 
Reported: 2011-11-26 21:19 UTC by Tpt
Modified: 2012-02-24 02:52 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: Android
Assignee Huggle Beta Tester: ---


Attachments
Patch on Github (80 bytes, text/plain)
2011-11-26 21:19 UTC, Tpt
Details

Description Tpt 2011-11-26 21:19:05 UTC
Created attachment 9564 [details]
Patch on Github

It may be useful to open web links to Wikipedia form other apps (mail, facebook, twitter) in Wikipedia application rather than in a web browser. We can implement it with an android intent. I began to write a patch. What do you think about it ?
Comment 2 Sam Reed (reedy) 2011-11-26 23:01:31 UTC
If it works, please just put a pull request on Github
Comment 3 Brion Vibber 2011-11-27 16:32:08 UTC
Appears to work, though there's a couple things I'd recommend tweaking.

Probably need to escape that URL before passing it into the query string; otherwise we might lose some chars. <http://en.wikipedia.org/wiki/AT&T> and <http://en.wikipedia.org/wiki/%3F> both pass through correctly, but I'm just suspicious. :)


Some oddities:
* Open Wikipedia app
* switch to another app (say Gmail)
* follow a Wikipedia link in this app to another page and open it in Wikipedia app

A Wikipedia app screen pops up, loading the article. Neat!

* now hold down 'home' button and switch to some other randon app
* hold down 'home' and switch back to Wikipedia

You're seeing the original page you had open before, not the one you followed a link to.

* hold down 'home' and switch back to that other app (Gmail)

Now we see the Wikipedia view again, in the context of this other app, instead of the rest of the app.

* hitting 'back' from there can get us back to Gmail/etc


While this feels natural for a single view/back cycle, going to other apps back back it looks very wrong.



I'm also a little unsure about the input processing; if we somehow manage to get a bogus URL in there, does it load inline or does it pop back over to regular browser?
Comment 4 Tpt 2011-11-27 17:22:08 UTC
Escape URL : it's done by Android framework when it send it to the app.

The app open only links to Wikipedia (wikipedia.org). If you can't open an other url like google.com in the app (it is android:host="*.wikipedia.org" in the manifest)

For this problem of come back : it's because the link is open in an other instance of the main activity, I don't know how solve it.
Comment 5 Sander Deryckere 2012-01-22 15:00:47 UTC
The problem of come back is intended behaviour of Android. You get the same kind of things with thd default android browser or other apps.

So that doesn't need to be solved.
Comment 6 Yuvi Panda 2012-01-22 23:25:40 UTC
So is there no way to actually go back to the launched app if we hit home?
Comment 7 Tpt 2012-01-23 16:19:08 UTC
The solution is to use the option android:launchMode="singleTask" of the android manifest. Here is a pull request that implement this way : https://github.com/wikimedia/WikipediaMobile/pull/114
Comment 8 Yuvi Panda 2012-01-24 00:16:34 UTC
There is an implementation here (https://github.com/wikimedia/WikipediaMobile/tree/open-intent) based on work/idaes from Tpt. It follows the Android guidelines and uses standard launch modes. Should be merged in after a bit of discussion

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links