Retrofit 2: Code walkthrough

Retrofit is an open source library by Square that turns annotated java interfaces into REST clients. The library is currently in its second beta and changed quite a bit from its first version to better support the Ok stack. In this post we will go through its code, explaining its main techniques and inner workings. This post assumes some knowledge of the library as a user of it. Continue reading

Git logo

Git: Committed on master instead of forking a branch

Git Logo by Jason Long is licensed under the Creative Commons Attribution 3.0 Unported License.

Sometimes we start working on a feature but mistakenly commit on the master branch. We realize the mistake too late and would like to “move” this commit or commits to a new feature branch. In this post I explain the fastest way to do this, if the commits have not been pushed to upstream yet.

Continue reading

Categories: Git

The retained fragment trick

The first tough problem a new Android developer faces is how to manage work in the background. Spawning a new Thread is easy, but once UI objects need to be notified with the result, the situation becomes tricky: the UI objects might have been replaced by the system because of a configuration change. In this post we explore how to bind and rebind to the new UI objects with a retained Fragment. Continue reading