Posts

Showing posts from 2017

How to Use Kotlin in Your Android Projects

Image
One great news of moving to Kotlin is, do not need to start from a new project. You could add it to your existing Java Android project. The language is interoperable with Java. So you could use steps below either for a new or existing project. Setting up Your Environment By default, Android Studio has no idea what to do with Kotlin, so the first step is to install the Kotlin plugin and configure Kotlin in your project. Installing the Kotlin Plugin Launch Android Studio and install the kotlin plugin. In Android Studio's quick start menu, select Configure >> Plugins . click on Install JetBrains plugin… Search for and select Kotlin from the list and click Install . When the installation completes, restart Android Studio to activate the plugins. Configuring Your Project to Use Kotlin Now IDE can understand and run Kotlin code, but need to configure kotlin for every project. Create a new project in Android Studio from File >> New

Kotlin: Do more with less code

Image
Java is the most widely used language for Android development, but that doesn’t mean it is always the best choice.The biggest problem with Java is that it is old , verbose , not a “ modern language ” and don’t forget the infamous NullPointerException . Java 8 , bringing some modern flavors to the language but Android certainly doesn’t use all the features of Java 8 and we are still stuck in the old Java 7 and 6.That's where Kotlin comes in: This relatively new open source language, based on the Java Virtual Machine (JVM), is gaining traction with Android software engineers. What is Kotlin? Kotlin is a statically-typed programming language(sometimes referred to as Swift for Android) that runs on the JVM, developed by the JetBrains team , and is now in its 1.1 version. What makes it useful in Android development is that it compiles to JVM bytecode. It is fully compatible with Java, and Kotlin code can be simply converted to Java code and vice versa (there is a plugin

Introduction to Spring Animation

Image
When writing an application, it's important to consider exactly what your graphical demands will be. Varying graphical tasks are best accomplished with varying techniques. Android provides a variety of powerful APIs for applying animation to UI elements and drawing custom 2D and 3D graphics. Dynamic-animation is a new module introduced in revision 25.3.0 of the Android Support Library . It provides a small set of classes for making realistic Physics-based Animations . What is Physics-based Animation Physics-based animation uses the fundamentals of physics to build animations. An animation is driven by force. The animation comes to rest when the force reaches equilibrium. The new set of animation APIs embeds physics to render a more natural-looking and flexible animation. Spring Animation Spring Animation is one of the animation API provided by the Dynamic-animation module. Physics-based animations are driven by force. Spring force, is one such force that guides in