As decided in T119278, we will be using Method D: Search for existing pics at that location" strategy (with expanding radius) on the Commons MediaWiki API.
**Meeting with @Niedzielski (20 Dec): **
Discussed options for implementing the http requests asynchronously. The options we considered were:
1) Use either a) Volley or b) MwApi + AsyncTask
2) add a third networking library to the project
1a) appears to be the ideal option, however the project doesn't have any good examples of using that and might need some refactoring to expose request queue. 1b) is less ideal but the project has a number of examples that could easily be mimicked to achieve the requests needed. 2) might be venturing further into uncharted waters and adding another networking lib to the project may convolute networking even more
We decided on trying 1a) first, then reverting to 1b) as backup if the former proves to be too difficult to implement in time. Also discussed output format, which will be XML for ease of use with current implementation. I plan to reuse the current XPath retrieval code in org.mediawiki.api.MWApi.java .
**Edit 21 Dec 15** : Will try JSON for response format instead, as it is more standard for Android apps and Volley seems to have inbuilt support for JSON objects but not XML. Trying to construct a Category model for responses.
**Edit 22 Dec 15** : Current state of code can be found at https://github.com/misaochan/apps-android-commons/tree/api-calls
**Edit 23 Dec 15** : Code works now. Pull request submitted at https://github.com/nicolas-raoul/apps-android-commons/pull/33 . Tested without an internet connection as suggested, no problems except for the usual logcat errors thrown by original app.
Example output:
```
12-23 04:56:17.606: D/fr.free.nrw.commons.upload.MwVolleyApi$LogResponseListener(11272): query=pages=
12-23 04:56:17.606: D/fr.free.nrw.commons.upload.MwVolleyApi$LogResponseListener(11272): PAGEID=23644793 ns=6 title=File:Palermo BW 2012-10-09 12-04-52.jpg
12-23 04:56:17.606: D/fr.free.nrw.commons.upload.MwVolleyApi$LogResponseListener(11272): CATEGORIES= ns=14 title=Category:Piazza del Duomo (Palermo)
12-23 04:56:17.606: D/fr.free.nrw.commons.upload.MwVolleyApi$LogResponseListener(11272): ns=14 title=Category:Side views of the Cathedral of Palermo
12-23 04:56:17.606: D/fr.free.nrw.commons.upload.MwVolleyApi$LogResponseListener(11272): PAGEID=23644966 ns=6 title=File:Palermo BW 2012-10-09 12-07-39.JPG
12-23 04:56:17.606: D/fr.free.nrw.commons.upload.MwVolleyApi$LogResponseListener(11272): CATEGORIES= ns=14 title=Category:Saint Rosalia by Vincenzo Vitaliano
12-23 04:56:17.606: D/fr.free.nrw.commons.upload.MwVolleyApi$LogResponseListener(11272): PAGEID=23644994 ns=6 title=File:Palermo BW 2012-10-09 12-08-06.JPG
12-23 04:56:17.606: D/fr.free.nrw.commons.upload.MwVolleyApi$LogResponseListener(11272): CATEGORIES= ns=14 title=Category:Saint Rosalia by Vincenzo Vitaliano
12-23 04:56:17.606: D/fr.free.nrw.commons.upload.MwVolleyApi$LogResponseListener(11272): PAGEID=23645069 ns=6 title=File:Palermo BW 2012-10-09 12-09-53.JPG
12-23 04:56:17.606: D/fr.free.nrw.commons.upload.MwVolleyApi$LogResponseListener(11272): CATEGORIES= ns=14 title=Category:Porch of the Cathedral of Palermo
12-23 04:56:17.606: D/fr.free.nrw.commons.upload.MwVolleyApi$LogResponseListener(11272): PAGEID=23645121 ns=6 title=File:Palermo BW 2012-10-09 12-10-28.JPG
12-23 04:56:17.606: D/fr.free.nrw.commons.upload.MwVolleyApi$LogResponseListener(11272): CATEGORIES= ns=14 title=Category:Church towers of the Cathedral of Palermo
12-23 04:56:17.606: D/fr.free.nrw.commons.upload.MwVolleyApi$LogResponseListener(11272): PAGEID=27936145 ns=6 title=File:Palermo Cathedral2.JPG
12-23 04:56:17.606: D/fr.free.nrw.commons.upload.MwVolleyApi$LogResponseListener(11272): CATEGORIES= ns=14 title=Category:Side views of the Cathedral of Palermo
12-23 04:56:17.606: D/fr.free.nrw.commons.upload.MwVolleyApi$LogResponseListener(11272): PAGEID=28378903 ns=6 title=File:Catedral de Palermo - Zoom 1 (2786776020).jpg
12-23 04:56:17.606: D/fr.free.nrw.commons.upload.MwVolleyApi$LogResponseListener(11272): CATEGORIES= ns=14 title=Category:Piazza del Duomo (Palermo)
12-23 04:56:17.606: D/fr.free.nrw.commons.upload.MwVolleyApi$LogResponseListener(11272): ns=14 title=Category:Side views of the Cathedral of Palermo
12-23 04:56:17.606: D/fr.free.nrw.commons.upload.MwVolleyApi$LogResponseListener(11272): PAGEID=28379021 ns=6 title=File:Catedral de Palermo (2544992621).jpg
12-23 04:56:17.606: D/fr.free.nrw.commons.upload.MwVolleyApi$LogResponseListener(11272): CATEGORIES= ns=14 title=Category:Piazza del Duomo (Palermo)
12-23 04:56:17.606: D/fr.free.nrw.commons.upload.MwVolleyApi$LogResponseListener(11272): PAGEID=28379336 ns=6 title=File:Catedral de Palermo - Zoom 3 (1037666674).jpg
12-23 04:56:17.606: D/fr.free.nrw.commons.upload.MwVolleyApi$LogResponseListener(11272): CATEGORIES= no categories exist
12-23 04:56:17.606: D/fr.free.nrw.commons.upload.MwVolleyApi$LogResponseListener(11272): PAGEID=28379338 ns=6 title=File:Catedral de Palermo - Zoom 2 (1037666802).jpg
12-23 04:56:17.606: D/fr.free.nrw.commons.upload.MwVolleyApi$LogResponseListener(11272): CATEGORIES= no categories exist
```