WikiWhere the Video
Here is the fully functioning WikiWhere Application.
Feel free to add / remove / update or delete the app as you see fit!
Programming with Android Part 4 – Finishing WikiWhere
Continuing from Part 3 we are going to spend the 30 minutes or so to finish the WikiWhere application. So far we have a mapping and location application on the device. The final step is integrating the Wiki sites and displaying them on the map.
1:45 Foosball, Reddit, Digg and Google Reader Break
1:55 Getting the XML feed for the Wiki sites
Now that you've had a long break we can get to the more complicated sections of the code. The Wiki information is collected and provided as a web service by Geonames.org. We will be using the wikipediaBoundingBox XML API to get the information from the service. By making a call to http://ws.geonames.org/wikipediaBoundingBox?north=51.1&south=50.1&east=-113&west=-115 you can get the XML feed of the Wiki Entries in the bounding box in the following format:
-
<geonames>
-
<entry>
-
<lang>en</lang>
-
<title>Max Bell Centre</title>
-
<summary>The Max Bell Centre (often referred to as the Max Bell
-
Arena) is an ice hockey arena in Calgary, Alberta, Canada in the
-
community of Radisson Heights. It seats 2,121 for hockey with a
-
standing room capacity of over 3,000. It is named after George
-
Maxwell Bell, a philanthropist who helped fund the arena's
-
construction (...)</summary>
-
<feature>landmark</feature>
-
<countrycode>CA</countrycode>
-
<population>0</population>
-
<elevation>0</elevation>
-
<lat>51.0422</lat>
-
<lng>-114.0036</lng>
-
<wikipediaurl>http://en.wikipedia.org/wiki/Max_Bell_Centre
-
</wikipediaurl>
-
<thumbnailimg />
-
</entry>
-
...
-
</geonames>
So to get our wiki items displayed on the map we need to:
1. Call the Geonames XML API
2. Parse the XML
3. Display the icons on a MapOverlay
4. Implement the "Search For Wiki Entries" Button
