My GSoC journey — week #3

Rohan Sharma
3 min readJun 17, 2019

Week 3 was amazing because finally, I pushed the MVP for my project which has the core functionality implemented in it. My mentor was happy enough to see this implemented at a relatively early stage than planned. We had planned to connect to the API just via Postman this week but thanks to both of my mentors, that task got completed within a day and I had enough time to connect the API calls via an android app.

This week wasn’t much about new learnings but about implementing what I had learned in the previous two weeks and diving deeper into concepts. I learned a lot about Retrofit 2.0 which has many new and insanely helpful functionalities. I had never performed POST requests with retrofit, but had to perform a complex post request this time. Required hours of debugging but voila! HTTP STATUS code: 201(Created). I also got to know about some tools that serve like heaven on earth. One of my favorites being the JSONtoPOJO converter for your retrofit calls.

Just paste the JSON response you will be getting via the API response and press generate, and Voila no headache of creating POJOs. It even adds the necessary Gson annotations and handles nested data models too, so yeah, its heaven. A big cheers to its developers!!!!!!!!!!

One of the things that I really like about my project is that it was started from scratch this year by myself and thus I get to choose and design the architecture and develop the required number of classes accordingly. I have worked on various open-source projects but all of that was adding code to existing classes. Rarely I have created a complete package of classes for a module/functionality. But this week for the first time ever I created a complete architecture(MVVM pattern) complex enough to be called “architectured code”.

Also exploring jetpack architecture components and Kotlin continues. I don’t have much to share this week so let’s end with our traditional highlight learning of the week award.

Highlight learning of the week

So the highlight learning of the week award goes to…………………………….

Adding auth to retrofit requests via adding custom okHttp interceptors as a client to the retrofit build. An awesome blog explaining this is attached below

A thing to note here is to make sure about the encoding type for your API call credentials which is mostly Base64 or there even maybe no encoding at all. This is something, I spent almost a day figuring out, so don’t commit the same mistake.

Till then,

Happy Coding

--

--

Rohan Sharma

Developer | OpenSource enthusiast | DTU’ 21 | GSOC’19