0

I wrote an app that displays my location in a popup on a map, and also other locations from a database. I want to get some information from Wikipedia and present portions of it as location information.

But, I have no idea how to do this. I am new at Android, and I hope I can find some answers here.

Extra Savoir-Faire
  • 6,026
  • 4
  • 29
  • 47
srnty
  • 21

2 Answers2

1

You could use this Wikilocation API. It uses your current location to bring up nearby articles. Here is a sample:

http://api.wikilocation.org/articles?lat=51.500688&lng=-0.124411&limit=1

Will return

{
    "articles": [
        {
            "id": "7290308",
            "lat": "51.5006",
            "lng": "-0.124611",
            "title": "Big Ben",
            "url": "http:\/\/en.wikipedia.org\/w\/index.php?curid=7290308",
            "distance": "17m"
        }
    ]
}

Showing you that you are nearby Big Ben. See here for more docs

davehale23
  • 4,374
  • 2
  • 27
  • 40
0

You could redirect the user to the wikipedia mobile page if you use this as your search term:

http://en.wikipedia.org/wiki/" + search

or if you don't want to display it in a WebView or in the browser, you could use the Wikimedia API to display only relevant parts of the description.

Ahmad
  • 69,608
  • 17
  • 111
  • 137