Realtime applications using Android Architecture Components with Kotlin

Android Architecture Components version 1.0.0 has now been released, this means their API’s are now stable and you should be more comfortable with adopting it in your projects.

What are Android Architecture Components?

Android Architecture components (AAC) are a set of Android libraries that help you structure your application in a way that is robust, testable, and maintainable.

In this post, we are going to discuss how to structure an Android Application’s code for realtime updates using Android Architecture Components. We will be talking specifically about using ViewModel and LiveData to build an Android application that will be updating in realtime.

https://blog.pusher.com/realtime-applications-using-android-architecture-components-kotlin/

Advertisements

Javalin – Simple REST APIs for Java and Kotlin

Javalin is a very lightweight web framework for Kotlin and Java, inspired by Sparkjava and koa.js. Javalin is written in Kotlin with a few functional interfaces written in Java. This was necessary to provide an enjoyable and near identical experience for both Kotlin and Java developers.

Javalin is really more library than framework; you don’t need to extend or implement anything and there are very few “Javalin-concepts” you have to learn.

REST API Simplicity

Javalin started as a fork of the Spark Java and Kotlin web framework but quickly turned into a ground-up rewrite influenced by koa.js. All of these web frameworks are inspired by the modern micro web framework grandfather: Sinatra, so if you’re coming from Ruby then Javalin shouldn’t feel too unfamiliar.

Javalin is not aiming to be a full web framework, but rather just a lightweight REST API library. There is no concept of MVC, but there is support for template engines, websockets, and static file serving for convenience. This allows you to use Javalin for both creating your RESTful API backend, as well as serving an index.html with static resources (in case you’re creating an SPA). This is practical if you don’t want to deploy to apache or nginx in addition to your Javalin service. If you wish to use Javalin to create web-pages instead of just REST APIs, there are some simple template engine wrappers available for a quick and easy setup.

If you want a more established Java web framework, you could try Spark. If you want a more established Kotlin web framework, you can try the Spark Kotlin Wrapper.

https://javalin.io/

 

How to make complex requests simple with RxJava in Kotlin

It is a common problem in Android development when your API is not sending you exactly the same data, what you want to show in your views, so you need to implement more complex requests. Possibly your app needs to make multiple requests, that wait for each other, or call multiple requests after the previous one finished. Sometimes you even need to combine these two approaches. This can be challenging in plain Java and will often result in unreadable code, what is also painful to test.

Today I’m going to show you in a simple example how this can be achieved in a clean way using RxJava. The example is written in Kotlin, what makes the code more concise and easy to read. If you are completely new to RxJava or Kotlin, I suggest you catch up on the basics. There are some great resources here as well.

https://blog.mindorks.com/how-to-make-complex-requests-simple-with-rxjava-in-kotlin-ccec004c5d10

Kotlin and Groovy JVM Languages with AWS Lambda

When most people hear “Java” they think of Java the programming language. Java is a lot more than a programming language, it also implies a larger ecosystem including the Java Virtual Machine (JVM). Java, the programming language, is just one of the many languages that can be compiled to run on the JVM. Some of the most popular JVM languages, other than Java, are Clojure, Groovy, Scala, Kotlin, JRuby, and Jython (see this link for a list of more JVM languages).

Did you know that you can compile and subsequently run all these languages on AWS Lambda?

AWS Lambda supports the Java 8 runtime, but this does not mean you are limited to the Java language. The Java 8 runtime is capable of running JVM languages such as Kotlin and Groovy once they have been compiled and packaged as a “fat” JAR (a JAR file containing all necessary dependencies and classes bundled in).

In this blog post we’ll work through building AWS Lambda functions in both Kotlin and Groovy programming languages. To compile and package our projects we will use Gradle build tool.

To follow along, please clone the Git repository available at GitHub here. Also, I recommend using an Integrated Development Environment (IDE) such as JetBrain’s IntelliJ IDEA, this is the IDE I used while working on these projects.

https://aws.amazon.com/pt/blogs/compute/kotlin-and-groovy-jvm-languages-with-aws-lambda/

Should I learn Kotlin or stick to Java?

Google announced Kotlin as an official language for Android development. Some famous developer companies, like square, started using kotlin as their production language long before the official announcement was made.

Now one of the most trending questions juggling around the minds of many experts and most beginners is should I learn kotlin or stick to java? Here’s some point should be made based on three stages of a developers like really really beginner, ninja apprentice, totally ninja.

https://blog.mindorks.com/should-i-learn-kotlin-or-stick-to-java-3a73c3580ac3

What do 17 Google Developers Experts for Android think about Kotlin?

Google has already expressed several times that they don’t have anything against Kotlin, and that they’re not preventing us from using it while the compiler still generates valid bytecode.

But many people is still waiting for an official support, something that could never happen.

While we wait until that moment though, I thought it would be nice to know what the Google Developers Experts for Android think about it.

If you hadn’t heard about it, Google Developers Experts (GDEs) is a program that recognizes outstanding developers the effort to be a reference on the field they are involved in.

I contacted some of these Android Experts (the list is huge!), and I got answers from 17 of them. Thanks a lot for being so nice and taking your time to answer!

I’ve just asked them to tell us a bit about them, and what they think about Kotlin. The answers are obviously unmodified, so you will find voices for and against (or not so for) the language.

I really hope this helps you form an idea of how Kotlin is being a game changer, and that, at least, is a language to take into account if you are an Android developer.

Without further delay, here it is the opinion of our GDEs in no particular order:…

https://antonioleiva.com/google-kotlin/