How to create a lifecycle aware custom class in Android.We all know, each component in Android has its lifecycle, be it Activity, Fragment or Service. Each component gets created and destroys (and a few other stages in between). To create a custom class that is lifecycle aware inherently, we can use a set...Aug 17, 2023·2 min read·268
How to run Multiple Transitions in Android at OnceTransitions in Android help users navigate from one screen to another with a smooth animation. There are mainly 2 ways you can create and attach a transition. Create a res/anim resource and attach it to fragment transaction via setCustomAnimations ...Jan 23, 2023·3 min read·102
Android Studio/IntelliJ: How to break on NullPointer or any other ExcetionHow to debug 'test should never throw an exception to this level'Nov 15, 2022·1 min read·84
Mockito: ArgumentMatcher vs ArgumentCaptorThe two ways to mock your methods inOct 19, 2022·3 min read·564
PowerMock: Understanding @PrepareForTestPrepareForTest is very powerful tool that unlocks class manipulation capabilities by modifying class to byte code level.Oct 18, 2022·3 min read·1.8K
Powermock CheatSheet: Tldr and TipsWhy we need Powermock? Although Mockito is most popular Mocking Library for Java Developers, But there are certain cases where Simple Mockito does not work. For Example, if your codebase uses any Singleton, you cannot mock them with Simple Mockito. T...Oct 17, 2022·8 min read·539
Mockito CheatSheet: Tldr and TipsThese are some of the useful methods and classes provided by Mockito 1. Mockito.mock() Creates a mock of any class. By default, it will return default value for methods and fields when not mocked. For Example: Primitive data types such as byte, short...Oct 12, 2022·2 min read·993