1

I'm using Retrofit in my Android project to handle REST web service calls. Now I need to add support HAL JSON to be able to implement dynamic adding items to my list (load more on scrool). HalJson: http://stateless.co/hal_specification.html

Does anybody know how to handle it with Retrofit?

Lyubomyr Shaydariv
  • 20,327
  • 12
  • 64
  • 105
user1209216
  • 7,404
  • 12
  • 60
  • 123

1 Answers1

1

Gson-HAL Implementation (Library Link)

Above library will explain the object creation

Gson gson = new GsonBuilder()
.registerTypeAdapterFactory(new HalTypeAdapterFactory())
.create();

Retrofit Implementation

RestAdapter restAdapter = new RestAdapter.Builder()
            .setEndpoint(BASE_URL)
            .setConverter(new GsonConverter(gson))
            .build();

It has some Missing components which can be work around by modifying the library

Vikas Rathod
  • 374
  • 2
  • 14
  • 1
    It looks unfinished and abandoned. Isn't there anything else? – user1209216 May 12 '17 at 10:16
  • I found this the most simplest impl, other then this u have to write your own ApapterFactory and Destabilization logic. other lib but need some work https://github.com/Nykredit/jackson-dataformat-hal – Vikas Rathod May 12 '17 at 11:54