JSON format

59 views
Skip to first unread message

Gregory Kornienko

unread,
Nov 5, 2015, 4:21:20 AM11/5/15
to Android Bootstrap
Hello, 

First of all, thanks a lot. AB is good start for android newbies. I learned a lot.

I'am trying to make simple app. It has own api, with own json response like:
[
  { "id": 1, "name": "test1"},
  { "id": 2, "name": "test2"}
]

I got an error "Retrofit Expected BEGIN_OBJECT but was BEGIN_ARRAY" (I am not alone with this problem http://stackoverflow.com/questions/24154917/retrofit-expected-begin-object-but-was-begin-array)

How can I implement callback function, to make custom parse?

Donn Felker

unread,
Nov 5, 2015, 8:27:46 PM11/5/15
to android-...@googlegroups.com
Jake gave the answer right here: http://stackoverflow.com/a/24155082/5210 

Instead of returning YourObject, return a List<YourObject> and that will do it. 

Donn Felker
Android GDE
Best Selling Mobile Author

--
You received this message because you are subscribed to the Google Groups "Android Bootstrap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-bootst...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gregory Kornienko

unread,
Nov 5, 2015, 11:55:00 PM11/5/15
to Android Bootstrap, do...@donnfelker.com
Please, can you provide example?

Seong Bae

unread,
Apr 3, 2016, 1:37:00 AM4/3/16
to Android Bootstrap, do...@donnfelker.com
Hi Gregory,

Did you figure this out?  I'm having the exact same issue.

Seong

Gregory Kornienko

unread,
Apr 3, 2016, 1:55:36 AM4/3/16
to android-...@googlegroups.com
Hello, 

Can you write me in skype?

-> w1thoutnickname

I will try to help you


3 апр. 2016 г., в 11:37, Seong Bae <bae....@gmail.com> написал(а):

--
You received this message because you are subscribed to a topic in the Google Groups "Android Bootstrap" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-bootstrap/DSv9PafQ7HI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to android-bootst...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages