Useful Codes

Useful Codes

Jan. 16, 2019 by

Useful for small background tasks // Declear in class private final Handler handler = new Handler(); new Thread(new Runnable() { @Override public void run() { // Try to sleep the thread for 20 milliseconds try { Thread.sleep(20); //3 seconds }

RxJava2

RxJava2

Jan. 14, 2019 by

Converting callback async calls to RxJava APIs usually offer one of these two options when dealing with expensive operations: A synchronous blocking method call (expected to be called from a background thread) An asynchronous non-blocking method call that uses callbacks (and/or listeners, broadcast receivers, etc)

Must Have Libraries For Android Developer

Must Have Libraries For Android Developer

Jan. 11, 2019 by

There are many third-party libraries for Android but several of them are “must have” libraries that are extremely popular and are often used in almost any Android project. Each has different purposes but all of them make life as a

Android Gradle

Android Gradle

Jan. 9, 2019 by

How to recompile with -Xlint:deprecation adding this to build.gradle allprojects { … gradle.projectsEvaluated { tasks.withType(JavaCompile) { options.compilerArgs << “-Xlint:deprecation” } } } Removing unused resources and Java classes via resource shrinking The Gradle build system for Android supports resource shrinking at

Libs And Tools

Libs And Tools

Jan. 5, 2019 by

EasyFlipViewPager https://github.com/wajahatkarim3/EasyFlipViewPager Hauler Hauler is a library containing custom layout which enables to easily create swipe to dismiss Activity. Implementation is based on code from project Plaid. https://github.com/thefuntasty/hauler Easy CSV Creates csv file for android https://github.com/hsmnzaydn/easy-csv Text Scanner from image This library

Shared element transitions in activities and fragments

Shared element transitions in activities and fragments

Dec. 13, 2018 by

Transitions between activities and fragments in Android involved animating the entire view hierarchy. However, with Material Design, it is now easier to animate selected Views during a transition to emphasize continuity, and guide users to content in the target Activity/Fragment.

Android Room Migration

Android Room Migration

Dec. 12, 2018 by

Scenario 1: keep the database version unchanged — app crashes java.lang.IllegalStateException: Room cannot verify the data integrity. Looks like you’ve changed schema but forgot to update the version number. You can simply fix this by increasing the version number. Scenario 2: version

Private Library

Private Library

Dec. 11, 2018 by

Create an Android library An Android library is structurally the same as an Android app module. It can include everything needed to build an app, including source code, resource files, and an Android manifest. Why use Library Module When building

Enjoy this blog? Please spread the word :)