Google IO is a a mega event and annual developers conference organized and hosted by Google at their California headquarters where they share the updates about their new products, hardware, software, platform, innovations etc. Android has grown into a very huge product for Google over the years. And each year Google IO event contains lots of new updates and feature announcements for Android. As an Android developer working for almost a decade, 8 years to be precise, I have always wondered what its like to attend the event in person.

Continue reading

A quick tip to fix AssertionError Exception when updating ConstraintLayout from 1.0.2 to later versions. This article is part of Today I Learned series and was originally posted at my TIL Github Repository and my website at wajahatkarim.com These days, I am working on an android app with very old code base. So, as I am adding new functionality and fixing bugs, I am improving the code base with latest APIs.

Continue reading

Kotlin Extensions for simpler, easier and fun way of launching Activities in Android Reposted on my Medium profile. Few days ago, I was reading this awesome article by Elye about a Kotlin keyword reified . Soon after reading the article, I started exploring it and I realized that we can simply lots of reusable tasks of Android development using reified and Kotlin extension methods. For example, launching Activities.

Continue reading

A very quick and effective trick to boost Android Studio As an android developer, we get to spend a huge chunk of our time on Android Studio, the Google’s official compiler for developing native Android apps. Over the years, it has evolved into a very powerful IDE with lots of features and functionalities. But there are still some problems, which hasn’t been fixed yet for a lots of developers due to various reasons such as Gradle build time, Android Studio speed etc.

Continue reading

Today, I opened a very old project for a quick update. After upgrading the support libraries, gradle plugins and other tools, I saw this strange issue for the first time. The app was building and running successfully, but when I opened any code file, I was getting huge list of compile errors mostly about Unresolved Reference etc. Initially, I cleaned project, rebuild it, restarted Android studio few times, but couldn’t fix it.

Continue reading

When debugging apps, we sometimes start putting logging statements all over the code to figure out what’s going on. class MainActivity : AppCompatActivity() { lateinit var retrofit: Retrofit override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) setupToolbar() Log.d("MyApp", "Toolbar Set") initRetrofit() Log.d("MyApp", "Retrofit Initialized") var myButton = findViewById<Button>(R.id.search_close_btn) myButton.setOnClickListener { Log.d("MyApp", "My Button Clicked") } Log.d("MyApp", "Activity Creation Done!") } } That works, but it happens that we forget to remove the logs before committing, and they either get flagged in the code review, or they’re still there when we release.

Continue reading

Code completion can improve your productivity by reducing how much you have to type, but there are situations when a more powerful tool is needed. Thanks to Android Studio and IntelliJ, live templates make it much easier to focus on just the things you care about. You guessed it right. I am talking about Live Templates. For example, to show a simple Toast in android apps, we use something like this:

Continue reading

Author's picture

Wajahat Karim

Android Developer. Open Source Contributor. Writer. Speaker

Senior Android Developer

Karachi, Pakistan