Image for post
Image for post

Jetpack Compose es el nuevo Toolkit Declarativo de UI para Android. Está diseñado con la eficiencia y facilidad de uso en mente.

El API declarativa de Jetpack Compose nos permite crear interfaces de forma rápida y, generalmente, utilizando menos código que sí lo hiciéramos utilizando un método imperativo convencional.

Modelo Imperativo

Normalmente en Android, representamos una interfaz gráfica como un árbol de View s, en el cual cada una las views que se muestran en pantalla es un nodo de dicho árbol.

Por lo general, hacer cambios en nuestro UI es un proceso de dos partes:

  1. Necesitamos obtener una referencia al objeto al que deseamos hacer cambios y lo más común es hacerlo usando findViewById para recorrer el árbol hasta encontrar el nodo que deseamos manipular. …


Image for post
Image for post

Recently I’ve been studying discrete mathematics and one of the things that amazed me was how difficult is for humans (at least this one) to get a grasp of the concept of infinity. The discovery made by Cantor was really groundbreaking at the time and it’s amazing to think about how he was able to come up with it, seeing beyond a concept so complex as infinity.

I decided to give a try explaining this in order to consolidate my understanding and hoping that somebody finds my explanation useful.

Before jumping right into the theorem itself, let me give you a little bit of background on set theory. …


Image for post
Image for post

You have probably come across the term “Reactive Programming” more than once at this point; it has been gaining a lot of popularity over the last few years and I’ve been wanting to talk about Reactive Programming and the options on how to use it in Android for a couple of weeks now. …


Image for post
Image for post

Hello guys, it has been a while since the last time I posted something in here, I’ve been busy with some projects going on and honestly have been wanting to write about this topic for a while. I feel it’s one of those that since is so extensive, new developers have troubles grasping it (I know I had some problems understanding this at the beginning) and when trying to make some research you end up jumping back and forth in the documentation, so I would like to try to explain them as short and concise as I can.

What is a Service?

An Android Service is an application component capable of performing long-running operations, it doesn’t provide a UI and can be started (or bound) by other components, and continue running even when the user exits the application. They can be used to perform Inter-Process Communication between components of the same app running on different processes or even between independent applications. …


Image for post
Image for post

Coroutines are a really nice feature with the objective of simplifying async tasks, making them easier to implement and understand.

Traditionally in order to handle async operations you would need to use Threads, Tasks, Executors or Callbacks. All these mechanisms work to some extent. Yes, they get the job done but in some cases the code you write can get really messy and hard to read. …


Image for post
Image for post
PHOTO CREDIT: FLICKR USER MOR10 VIA CREATIVE COMMONS.

What’s up guys? Another Google IO has passed and with it some exciting announcements for all the Android developers out there in terms of software and hardware. Here I list some of the changes and additions that I had the chance to check out at the IO and think are worth to mention, if I’m missing anything let me know in the comments

Android Q

Technically, this was not an IO announcement since it has been around for some months already and many developers have been using it to test their apps, still it’s worth to mention as the next wave of features will come with this new Android version. …


Image for post
Image for post

Hello, guys, this is the last part of the Gentle series, in which we have been looking at the Android Architecture Components framework. In case you have not, check out my articles about LiveData and ViewModel. In this last part we will talk about Room, what it is and why you should be using it to replace that old SQLiteOpenHelper.

Android has supported SQLite out of the box since the beginning, but it has not been always as pleasant to work with, specially on projects of increasing complexity. Some of the most troublesome issues when working with SQLite on Android:

  1. Lack of compile time SQL queries verification; one name of a table or column written wrong and you will end up with a runtime crash. …


DN … What?

If you have ever surfed the Internet then you have used DNS without even knowing it; The DNS (Domain Name System) is a hierarchical and decentralized nomenclature system for those devices that are connected to an IP network, such as the Internet. The most important function of DNS is to “translate” domain names (such as simplemail.com), which are much more meaningful and easy to remember for people, in binary identifiers associated with computers connected to the network, in order to to be able to locate these teams worldwide.

Great, but how does it work?

The DNS translation process begins when a user wants to navigate to their favorite website, suppose that our user wants to navigate to simplemail.com, he enters the domain name in his browser and expects to see all his emails displayed . The browser first checks its cache to verify if the user has previously visited this site, if so, the browser has surely saved the search result and could address it immediately, in the case of not having this information the browser in case you just do not know which address to request the emails of our user; but he knows who to ask. …


Image for post
Image for post

Hello, guys, I had so much fun writing my previous article about LiveData that I started to think about the next one right away, the obvious choice for the topic was the next component of the Android Architecture Components framework so I thought about making it a series where we will cover all of them, so this is the second part of the series where we will talk about ViewModel

Overview

ViewModel is a class that has been designed with the main goal of storing data that is related to the UI in a lifecycle aware manner, it’s implemented in such a way that it outlives any configuration change, such as device rotation. …


Image for post
Image for post

LiveData is an observable class that holds data, it’s part of the Android Architecture Components and unlike other observables it has the advantage that it is lifecycle-aware, this means that it respects the lifecycle of other components (like activities, fragments and services) and will dispatch updates to it’s observers only when their components are on an active state.

An Observer is considered active if it’s on the ::STARTED:: or ::RESUMED:: state, any observer that is inactive will not be notified about the updates. You register the observer along with the lifecycle owner which is simply an object that implements the LifecycleOwner interface, the relationship between lifecycle owner and observers allows LiveData to safely remove observers whose lifecycle has reached the ::DESTROYED:: state. …

About

Oscar Presidente

Android & Blockchain Engineer, amateur Body Builder and full time animal lover.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store