小编And*_*ler的帖子

Problems retrieving info from firebase and parsing with Retrofit and RxJava using REST

Well, I've being struggling with Firebase response using the REST API response. The thing is I don't want to use Android's libs for Firebase and instead use raw rest api. Long story short, the response from Firebase is:

{
    "object1": {
        "param1": true,
        "param2": "05",
        "param3": "String",
    },
    "object2": {
        "param1": true,
        "param2": "09",
        "param3": "String",
    }
}
Run Code Online (Sandbox Code Playgroud)

Retrofit interface:

public interface ApiCalls {
    @GET("/objects.json")
    Observable<List<MyObject>> getObjects();
}
Run Code Online (Sandbox Code Playgroud)

Gson Builder, Retrofit Builder and RxJava:

    Gson gson = new GsonBuilder()
            .setLenient() …
Run Code Online (Sandbox Code Playgroud)

rest android firebase retrofit rx-android

3
推荐指数
1
解决办法
541
查看次数

标签 统计

android ×1

firebase ×1

rest ×1

retrofit ×1

rx-android ×1