Apps-android-commons: Tech-improvement: JSON based Wikimedia API

Created on 23 Sep 2017  Â·  10Comments  Â·  Source: commons-app/apps-android-commons

Move to the JSON based WIkimedia API as XML is officially deprecated by Wikimedia as a format. We already include OkHttp and GSON in the build, so no new libraries would be needed.

code-quality

Most helpful comment

Something to consider as you are working on this -

  • The app uses several different networking libraries, some of which are _obsolete_. This is our chance to clean up and consolidate around a single (modern) network stack
  • I called out OkHttp as I believe that to be the best way forward for us
  • The main Wikipedia app uses the awesome Retrofit library which sits as a layer over OkHttp to encode/decode http parameters on REST calls. I'm not sure how much utility it brings to our API though.
  • Some of the Wikimedia services we call are reporting that they are deprecated & our new implementation should switch (eg getting "edit tokens")

I have extensive experience with OkHttp & Retrofit (and have done a bit of research on the migration effort) if you have any questions, always happy to help!

All 10 comments

I start working on this

Something to consider as you are working on this -

  • The app uses several different networking libraries, some of which are _obsolete_. This is our chance to clean up and consolidate around a single (modern) network stack
  • I called out OkHttp as I believe that to be the best way forward for us
  • The main Wikipedia app uses the awesome Retrofit library which sits as a layer over OkHttp to encode/decode http parameters on REST calls. I'm not sure how much utility it brings to our API though.
  • Some of the Wikimedia services we call are reporting that they are deprecated & our new implementation should switch (eg getting "edit tokens")

I have extensive experience with OkHttp & Retrofit (and have done a bit of research on the migration effort) if you have any questions, always happy to help!

Hi Paul ,
I have no experience with OkHttp, but found it very friendly to learn and to used.
I will use the OkHttp lib.
I let you know how it goes.
Thanks for your help!

hi,
Sorry for the delay to commit my changes...
I have question regarding the test. In the project there is a ApacheHttpClientMediaWikiApiTest, I want to add OkHttpClientMediaWikiApiTest. How do I preform testing?
Thanks!

@kerenpas - How're things going with this issue? Have you been able to make any progress?

Hi,
Sorry I been busy and put it aside... I will finish it teal Wednesday
next week, thanks for the reminder!

On Jan 13, 2018 1:00 AM, "Paul Hawke" notifications@github.com wrote:

@kerenpas https://github.com/kerenpas - How're things going with this
issue? Have you been able to make any progress?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/commons-app/apps-android-commons/issues/885#issuecomment-357377957,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ANDonMdPpNhYWi2hqCabuGGnGL7i8i7bks5tJ-QKgaJpZM4PhZ6Z
.

Hi Paul,
I having some problem to test the LogEvens
https://commons.wikimedia.beta.wmflabs.org/w/api.php?action=help&modules=query%2Blogevents
API. I need an example for logEvents response that contains the field "
lestart".
All the request that I made do not contain this field here is a link
https://commons.wikimedia.beta.wmflabs.org/w/api.php?action=query&list=logevents
to example response.
I just want to make sure that I extract this field from the JSON response
correctly.
Thanks,
Keren

On Sat, Jan 13, 2018 at 1:50 PM, Keren pastov kerenpas@gmail.com wrote:

Hi,
Sorry I been busy and put it aside... I will finish it teal Wednesday
next week, thanks for the reminder!

On Jan 13, 2018 1:00 AM, "Paul Hawke" notifications@github.com wrote:

@kerenpas https://github.com/kerenpas - How're things going with this
issue? Have you been able to make any progress?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/commons-app/apps-android-commons/issues/885#issuecomment-357377957,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ANDonMdPpNhYWi2hqCabuGGnGL7i8i7bks5tJ-QKgaJpZM4PhZ6Z
.

Hi Again,
I figure out what was the problem... I have not pass the lestart parm at
the get query string...
Thanks,
Keren

On Tue, Jan 16, 2018 at 11:34 PM, Keren pastov kerenpas@gmail.com wrote:

Hi Paul,
I having some problem to test the LogEvens
https://commons.wikimedia.beta.wmflabs.org/w/api.php?action=help&modules=query%2Blogevents
API. I need an example for logEvents response that contains the field "
lestart".
All the request that I made do not contain this field here is a link
https://commons.wikimedia.beta.wmflabs.org/w/api.php?action=query&list=logevents
to example response.
I just want to make sure that I extract this field from the JSON response
correctly.
Thanks,
Keren

On Sat, Jan 13, 2018 at 1:50 PM, Keren pastov kerenpas@gmail.com wrote:

Hi,
Sorry I been busy and put it aside... I will finish it teal Wednesday
next week, thanks for the reminder!

On Jan 13, 2018 1:00 AM, "Paul Hawke" notifications@github.com wrote:

@kerenpas https://github.com/kerenpas - How're things going with this
issue? Have you been able to make any progress?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/commons-app/apps-android-commons/issues/885#issuecomment-357377957,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ANDonMdPpNhYWi2hqCabuGGnGL7i8i7bks5tJ-QKgaJpZM4PhZ6Z
.

Hi Paul,
I getting Server Error... (Our servers are currently under maintenance or
experiencing a technical problem. Please try again
https://codebeautify.org/htmlviewer/in a few minutes.)
I am waiting for this issue to be solved, so I may be late for commit my
code.
Thanks,
Keren

On Sat, Jan 13, 2018 at 1:50 PM, Keren pastov kerenpas@gmail.com wrote:

Hi,
Sorry I been busy and put it aside... I will finish it teal Wednesday
next week, thanks for the reminder!

On Jan 13, 2018 1:00 AM, "Paul Hawke" notifications@github.com wrote:

@kerenpas https://github.com/kerenpas - How're things going with this
issue? Have you been able to make any progress?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/commons-app/apps-android-commons/issues/885#issuecomment-357377957,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ANDonMdPpNhYWi2hqCabuGGnGL7i8i7bks5tJ-QKgaJpZM4PhZ6Z
.

This will be handled via #1092

Was this page helpful?
0 / 5 - 0 ratings

Related issues

neslihanturan picture neslihanturan  Â·  3Comments

madhurgupta10 picture madhurgupta10  Â·  4Comments

jidanni picture jidanni  Â·  3Comments

Opsylac picture Opsylac  Â·  3Comments

nicolas-raoul picture nicolas-raoul  Â·  3Comments