I have a JSON text file in /res/raw
. After reading its text content, I would like to use Retrofit to parse JSON text to Object. But it seems Retrofit only accept input from file in server.
Is there anyway to reuse Retrofit's JSON parser module in this case?
You can configure Gson instance once and then just use it both for local parsing and for Retrofit via
RestAdapter.Builder.setConverter(new GsonConverter(customGson)