AndroidX migration and ConstraintLayout

I migrated an Android app to AndroidX with the help of the Refactor option from Android Studio. After all the references in the java files were updated, I ran into the below error when I tried running my app.

  android.view.InflateException: Binary XML file line #2 in <>: Error inflating class androidx.constraintlayout.ConstraintLayout  
    Caused by: android.view.InflateException: Binary XML file line #2 in <>: Error inflating class androidx.constraintlayout.ConstraintLayout  
    Caused by: java.lang.ClassNotFoundException: androidx.constraintlayout.ConstraintLayout  



After a bit of head scratching and internet search, I was able to fix it by simply changing the declaration in the layout XML file. androidx.constraintlayout.ConstraintLayout to androidx.constraintlayout.widget.ConstraintLayout

I was expecting atleasst the IDE to throw an error, but had to find and fix it the hard way.

Swap two numbers without a temporary variable

For no reason, I was reminded of a simple code snippet to swap (interchange) two numbers that I had discovered in my early programming days. I may have used it once or twice in my 10 years of being a professional software developer.

Swapping two numbers is a common use case when working with some algorithms and the like.

Revisiting Assassins Creed 1

Replaying a video game from long time back, and make some notes.

Android error on Toast

Solving an error when using a Toast from within a Fragment

Pipeline Design Pattern

To simplify a process, I had to quickly build a utility app to create report based on status from a large number of emails on a daily basis.

I had always planned to refactor the single Java source file into a proper design when I found some free time. That’s how I got to implement my version of the Pipeline Design Pattern.

Year 2019 in Review