id: 161 View:category
Tutorials  Build  Gradle
Gradle Script Kotlin

Yup - use Kotlin in Gradle Script

As you know, we use Groovy to write our Gradle build scripts and it has pros and cons. Groovy is a dynamic language which means that it’s not statically typed, making difficult to write or modify our gradle scripts without making many mistakes as we don’t have autocomplete there.

Last year, Gradle decided to start using Kotlin to writing Gradle build scripts creating, what they call, Gradle Kotlin Script. The project is moving fast (0.9.0 version at the time of writing this article) but, on the other hand, there is practically no documentation.

So, I want to show you how to use Gradle Kotlin Script to create Gradle build scripts written in Kotlin in one Android project.

Full article


Tutorials  Language  Kotlin
Kotlin

First class support throughout

Hardcore Android developers have been aware Koltin could be used alongside Java for some time, but many have been held back by the lack of official support. That ended at Google I/O 2017, when it was announced it will now be fuly supported from Android Studio 3.0 onwards, and that's right through from the IDE syntax checkers to the Gradle build system and beyond.

How has Kotlin been implemented on Android?

Since Android is powered at it's heart by a JVM, that's Java Virtual Machine, in theory, anything which can create the bytecode it expects can be used to run software on it. Koltin is such a beast, and AS 3.0 now has the toolchain needed to generate it. So it's a hat tip to the designers of the original JVM for creating a system with such longevity.

Uniquely, Kotlin is not an "all or nothing" swap in for Java, the way other languages would be (or at least not without a few very complicated hoops to jump through). It actually sits side by side in the source tree and is even interoperable with Java, so it can call Java methods directly and vice-versa. Migrating existing projects over just lost what is traditionally the largest hurdle they face.

Tutorials  Security
Fingerprint authentication

Place your fingertip on the fingerprint reader

There are a number of ways to authenticate a user to access an application, or a certain feature within an application, such as checkout, and fingerprint is one of them. For this post instead of going through the code step by step, i have added in-code comments, and will be letting the code speak for itself.

First things first, the permission.

The good thing is that we do not need to ask for this permission at runtime.

This project only has one activity, the MainActivity. Lets take a look at the code.

Full article


Tutorials  UI  Animation
Spring

SpringAnimation with examples

Have you ever wanted to do a bouncy animation like one of these on Android? If you have, you’re in for a treat!

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 view animations.

You might say “whatever, I’m just gonna slap a BounceInterpolator or an OvershootInterpolator on my animation and be good”Well, in reality these two often don’t look that great. Of course, you could always write your own interpolator or implement a whole custom animation – but now there’s a much easier way.

Full article


Tutorials  Build  Libraries
Building SDK/libraries

Re-invent the wheel the right way, and only if really necessary

It all starts when some android developer tries to figure out a solution to a problem he/she is having while building their “Awesome Android App”. During the process, most developers would encounter a couple of issues and in tandem, to those, they would come up with possible solutions.

Now here is a thing, if you are like me, who believes that if the problem was big enough for me to spend some time on it and there wasn’t an existing solution out there, I would abstract the whole solution in a modular manner, which eventually turns out to be an android library. Just so that whenever in future I encounter this problem again, I can reuse this solution easily.

So far, so good. So you have built the library and probably started using it completely privately or if you think someone else could make use of the same solution you release the code as an android library i.e.you open source the code. I believe (..or rather that is what it looks like..) at this point everyone thinks they are done.

Full article


Tutorials  UI  Animation
RxJava

Workcation App

Welcome to the first of series of posts about my R&D (Research & Development) project I’ve made a while ago. In this blog posts, I want to share my solutions for problems I encountered during the development of an animation idea you’ll see below.

As we can see in the animation, there is a lot of going on:

  1. After clicking on the bottom menu item, we are moving to the next screen, where we can see the map being loaded with some scale/fade animation from the top, RecyclerView items loaded with translation from the bottom, markers added to the map with scale/fade animation.
  2. While scrolling the items in RecyclerView, the markers are pulsing to show their position on the map.
  3. After clicking on the item, we are transferred to the next screen, the map is animated below to show the route and start/finish marker. The RecyclerView’s item is transitioned to show some description, bigger picture, trip details and button.
  4. While returning, the transition happens again back to the RecyclerView’s item, all of the markers are shown again, the route disappears.

Full article