Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to retrieve parts of Wikipedia content into Android App?

Basically, I want to retrieve content from wikipedia. But I want to display it inside my Android Apps directly. Not immidiately redirect to the internet browser, but to display it inside my apps first.

Currently, I manage to request the Wikipedia API and get only the main content by using http://en.wikipedia.org/w/api.php?action=parse&prop=text&format=xml&page=Bla_Bla_Bla. and because I parse the data, I will use WebView to render in the Android. It successfully rendered. But only to those unprotected article...

If it is protected such as Mona Lisa, the output was not rendered properly in the WebView Android.

I want to know has anybody try to retrieve a wikipedia content and display it in your android apps, easily and beautifully?

Thank you :)

like image 852
Yeo Avatar asked May 22 '11 11:05

Yeo


People also ask

Is the Wikipedia app open source?

Wikipedia | F-Droid - Free and Open Source Android App Repository.

How to get mobile version of Wikipedia?

The official mobile version of English Wikipedia is located at https://en.m.wikipedia.org, with the official desktop version of English Wikipedia located at en.wikipedia.org. A toggle switch between mobile and desktop view is available at the bottom of every page.

Is Wikipedia app offline?

Once you install it on your Android device, you can actually use it to download the whole website, and access its millions of articles even when you're offline (or when you don't want to use your data plan).


1 Answers

I have managed to find an answer. I think I over complicated this thing. We can actually retrieve the content perfectly without calling the mediawiki API.
Wikipedia already provides a mobile interface.

I just need to use a WebView to load http://en.m.wikipedia.org/wiki/ and add the topic at the end of the url.
For example the Mona Lisa site: https://en.m.wikipedia.org/wiki/Mona_Lisa

References: http://en.wikipedia.org/wiki/Help:Mobile_access#Official_online_version

like image 84
Yeo Avatar answered Sep 28 '22 07:09

Yeo