Índice de contenido
Bienvenidos a este curso donde daremos nuestros primeros pasos con Android Studio usando Jetpack Compose. Esta es la forma moderna y recomendada de desarrollar aplicaciones Android.
Si vienes de Flutter, tienes suerte: los conceptos son muy similares y entenderás la lógica rápidamente. De hecho, si te apasiona el desarrollo móvil, te recomiendo que en algún momento también explores el ecosistema de Flutter, ya que te proporcionará una perspectiva global muy valiosa para tu carrera.
Recursos adicionales
- Blog de Android: https://www.desarrollolibre.net/blog/android
- Curso Kotlin en YouTube: Ver lista de reproducción
- Curso de composición para Android en YouTube: Ver lista de reproducción
- Repositorio de libros: https://github.com/libredesarrollo/android-studio-blog
Lo que aprenderás con este libro
El libro está dividido en dos partes:
Parte 1: Fundamentos esenciales
- Capítulo 1: Introducción a Kotlin
- Sentamos las bases del lenguaje moderno para Android. Cubrimos variables, funciones, clases, clases de datos y la crucial seguridad nula.
En esta sección, vamos a aprender lo básico de Kotlin. Nuestro objetivo principal es dominar este lenguaje para poder desarrollar aplicaciones modernas en Android.
Kotlin es un lenguaje de programación moderno que incorpora funciones avanzadas, como Null Safety. Durante el curso, abordaremos los pilares fundamentales:
- Uso de variables y constantes.
- Estructuras condicionales.
- Funciones.
- Programación Orientada a Objetos (Clases), que será la mayor parte de nuestro aprendizaje.
Puedes consumir el curso en el orden que prefieras, aunque es lógico seguir una secuencia: por ejemplo, entender variables antes de pasar a las propiedades de la clase.
Parte 2: Android moderno con Compose
- Capítulo 2: Componibles y Layouts Fundamentales
- Configuramos Android Studio y creamos nuestro primer proyecto. Entendemos la estructura de una aplicación con Compose y el paradigma declarativo de la interfaz.
- Exploramos los bloques básicos de la interfaz: , , . Aprendemos a organizar la pantalla con , , y .
TextButtonTextFieldColumnRowBox
- Capítulo 3: Funciones avanzadas en Android con Jetpack Compose
- We display web content with and communicate with the user through Notifications, including permission and channel management.
WebView - API Consumption with Retrofit: We fetch data from the internet using Retrofit. We model JSON responses, handle loading and error states, and display the data in the UI.
- Web Integration and Notifications: We display web content with and communicate with the user through Notifications, including permission and channel management.
WebView
- We display web content with and communicate with the user through Notifications, including permission and channel management.
- Chapter 4: Integration of External Services in Jetpack Compose
- Audio and Video Playback: We integrate multimedia capabilities, playing audio with and embedding YouTube videos, correctly managing the lifecycle.
MediaPlayer - Access to Device Sensors: We take advantage of the device hardware, focusing on the accelerometer to detect the phone's movement and orientation.
- Custom Drawing with Canvas: We unleash creativity by learning to draw directly on the screen with the Composable to create custom graphics and components.
Canvas - Bringing the Interface to Life with Animations: We explore Compose's powerful animation API to animate visibility, color, size, and position, creating a fluid user experience.
- Audio and Video Playback: We integrate multimedia capabilities, playing audio with and embedding YouTube videos, correctly managing the lifecycle.
- Chapter 5: Practical Project - Creating a To-Do List App
- It's time to bring it all together! In this chapter, we will build a complete to-do list application from scratch, applying concepts of state, navigation, ViewModel, and animations.
What are we going to learn?
In this book, we will focus on how to work with Android taking advantage of the fact that we already know Kotlin. Being a very visual technology, we will learn to create components from the most basic to the most complex:
- Base components: Creating buttons and texts.
- Organization: Using columns and rows to structure the interface (what we knew in classic Android as ListViews or RecyclerViews).
- Advanced components: Implementation of Cards, visual alerts (Snackbars), progress bars, and Bottom Sheets.
From Widgets to Composables
If you come from Flutter, you will be used to Widgets; here in Android, we work with Composables. In practice, they are almost the same: a reusable piece of code.
A Composable is nothing more than a Kotlin function with the @Composable decorator. This tells the system that this function defines a part of the interface. Unlike a simple button, components like the Bottom Sheet have their own lifecycle and can contain multiple elements, allowing us to delve deeper into both the Kotlin language and the Android ecosystem.
Why Jetpack Compose? (Goodbye to XML)
If you knew old Android development, you will remember XML views. Personally, I abandoned Android years ago because working with XML was tedious and forced.
The great news is that with Jetpack Compose, views are 100% code. We no longer need XML files to define the interface (except in very specific cases of legacy code or extremely specific behaviors). This modernization is what has made many developers enjoy Android again.
Who this book is for
This book is for all those developers who want to learn how to create native applications for Android using the modern tools recommended by Google. It is assumed that the reader has prior knowledge of programming, though not necessarily in mobile development.
We will start from the bases of the Kotlin language and gradually build complete and functional applications with Jetpack Compose.
The journey of Android development is continuous, but with what you have learned in this book, you already have the most important tools in your belt; it is a basic book to take the first steps with Modern Android and will have more content in the future.