Android — JSON to POJO (Plain Old Java Object)

You might’ve interested on automating this task?

Mochamad Iqbal Dwi Cahyo
1 min readFeb 8, 2017

--

Yes, you can. In fact, you don’t have to check for Web API Scheme Object. Just go to this sites:

Oh, don’t forget. Here’s my recommendation to check a few item before generating your desired POJO.

1.0 — simple configuration

The truth is, I forgot to check that primitive types, due to its crucial part. The POJO sites will generate Class Type instead.

E.g, the above code will produce like this without “Use primitive types” checked.

1.2 — POJO with Class types

And here’s with “Use primitive types” checked

1.3 — POJO with Primitive Types

Notice the difference?

Yeah, I won’t repeat the same mistake again :D

Happy coding guys!

--

--

Mochamad Iqbal Dwi Cahyo
Mochamad Iqbal Dwi Cahyo

Written by Mochamad Iqbal Dwi Cahyo

A geek enthusiast. Sometimes photographer, culinary seeker or traveler. He ready to craft ideas!