Android gson streaming parser or android.util.jsonreader? Android gson streaming parser or android.util.jsonreader? json json

Android gson streaming parser or android.util.jsonreader?


It doesn't much matter: android.util.JsonReader and com.google.gson.stream.JsonReader are the same code. The two classes have the same API and the same behavior.

That said, there are some tiny differences:

  • Android's JsonReader is only available in Android 3.0 and later. The Gson one is available in a standalone jar file that you can use on any version of Android.
  • Gson's may be a tiny bit faster simply because it always has the latest optimizations. The version on shipping Android devices is always slightly older than the latest and greatest. For most applications you won't notice this difference.