Skip to main content

Posts

Butter Knife View Library for Android

Android  ButterKnife  library is a view injection library that injects views into android activity / fragments using annotations. For example,  @BindView  annotation avoids using  findViewById()  method by automatically type casting the view element. Not just view binding, butterknife provides lot of other useful options like binding  strings ,  dimens ,  drawables ,  click events  and lot more.  1. Adding ButterKnife Dependency First thing you have to do is, add ButterKnife in your project by adding the below dependencies in your project’s  app/build.gradle  file. Once added, sync your project, you are good to go. android { .. . // Butterknife requires Java 8. compileOptions { sourceCompatibility JavaVersion . VERSION_1_8 targetCompatibility JavaVersion . VERSION_1_8 } } dependencies { implementation ' com.jakewharton:butterknife:10.2.2 ' annotationProcessor ' com.jakewharton:butterknife-com...

Convert your apk into Android App Bundle

Android App Bundle In Google I/O 2018, a new publishing format has been introduced for Android applications called Android App Bundle. It is a new upload format that includes all your app’s compiled code and resources, but defers APK generation and signing to Google Play. Traditionally, Android apps are distributed using a special file called an Android Package(.apk). How to build an app bundle? You can easily build your app bundle using Android Studio(3.2 Canary 14+) or using command line interface. The generated app bundle will be stored at app/build/outputs/bundle/buildVariant/bundle.aab. Android Studio : Go to Build > Build Bundle(s)/APK(s) and select Build Bundle(s). Console : ./gradlew bundle Dynamic Delivery with Split APKs A fundamental component of Dynamic Delivery is the split APK mechanism available on Android 5.0 (API level 21) and higher. Split APKs are very similar to regular APKs — they include compiled DEX bytecode, resources, and an Android manifest. However, the ...

How to Use Kotlin in Your Android Projects

How to Use Kotlin in Your Android Projects Introduction Kotlin , the open source programming language designed by  JetBrains , is becoming increasingly popular among Java developers. It is often touted as Java's successor. Compared to Java, it offers a richer development experience, because it is more modern, expressive, and concise. If you are looking for an alternative programming language for Android development, you should give Kotlin a try. It can easily be used instead of or alongside Java in your Android projects. In this tutorial, I will show you how to use Kotlin and Kotlin plugins in your Android Studio projects. Prerequisites To follow along with me, you need to have: the latest version of  Android Studio a basic understanding of Kotlin syntax If you're unfamiliar with the Kotlin programming language, then I recommend reading the  Getting Started section of the  Kotlin reference  to get up to speed with the language. ...