2
azuredivay
311d

Retrofit + Gson is faster than Volley + my static helper class for parsing JSONArrays -.-

I feel defeated //android

Comments
  • 4
    Never try to reinvent the wheel.
    Android has very usefull amd optimized libraries.
  • 1
    @magicMirror JSONArray is part of android/Java tho :/ Gson is external repo, so ideally ud want to avoid anything from outside unless necessary no?

    + external API isnt the best, so only parsing a couple of properties ignoring the dozens other where needed, I assumed wud be faster + lighter (since i did sign em nullable)

    Il look at gson's GH, im curious what they do, probably each nested JSONArray in its own thread or some parallel processing coz nothing else explains something so straightforward giving such different performance -.-
  • 1
    @azuredivay
    I did not mean the Android Framework. I meant Android libraries in general. The community created some great tools.
    I just wish Gradle was not part of the compile chain....
  • 2
    @azuredivay retrofit is pretty much the standard for api requests in professional android apps. gson is like java in general : widely used but pretty much a legacy. volley used to be like gson, but now even legacy projects seem to not have volley and instead use retrofit. moshi nd jackson are better options than gson

    networking and parsing are 2 concepts which are usually library based in every framework : express,spring ktor and ofcourse the android. i always prefer writing code by my own instead of relying on libs, but for networking and parsing, i straight up add retrofit+moshi in an app without looking back
Add Comment