https://github.com/jreategui07/activitylifecycleapp_android
This Android application demonstrates the Activity Lifecycle in Android applications. It logs and showcases the execution of lifecycle events such as onCreate, onStart, onResume, onPause, onStop, onRestart, and onDestroy.
https://github.com/jreategui07/activitylifecycleapp_android
android intent java jetpack-compose kotlin lifecycle xml
Last synced: 3 months ago
JSON representation
This Android application demonstrates the Activity Lifecycle in Android applications. It logs and showcases the execution of lifecycle events such as onCreate, onStart, onResume, onPause, onStop, onRestart, and onDestroy.
- Host: GitHub
- URL: https://github.com/jreategui07/activitylifecycleapp_android
- Owner: jreategui07
- Created: 2024-12-15T20:49:06.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-16T04:21:56.000Z (over 1 year ago)
- Last Synced: 2025-05-14T23:08:09.528Z (about 1 year ago)
- Topics: android, intent, java, jetpack-compose, kotlin, lifecycle, xml
- Language: Kotlin
- Homepage:
- Size: 918 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README-es.md
Awesome Lists containing this project
README
# Android Activity Lifecycle Demo App
## Descripción
Esta aplicación de Android demuestra el Ciclo de Vida de una Actividad en aplicaciones Android. Muestra la ejecución de los eventos del ciclo de vida, como onCreate, onStart, onResume, onPause, onStop, onRestart y onDestroy. El proyecto está implementado utilizando Java, Kotlin con XML y Jetpack Compose.
## Características
- **Java**: Para demostrar el ciclo de vida de una actividad utilizando Java + XML.
- **Kotlin**: Para demostrar el ciclo de vida de una actividad utilizando Kotlin + XML.
- **Jetpack Compose**: Para demostrar el ciclo de vida de una actividad utilizando Compose.
- **Intent**: Para navegar entre actividades.
## Configuraciones necesarias
- No se requiere configuración adicional.
## Eventos del Ciclo de Vida y Ejemplos
Evento
Descripción
Casos de uso común
onCreate()
Se llama cuando se crea la actividad. Inicializa la interfaz de usuario, las estructuras de datos y otros componentes.
- Inicializar la interfaz de usuario (UI).
- Configurar ViewModels, adaptadores y bindings.
onStart()
Se llama cuando la actividad se vuelve visible para el usuario pero aún no es interactiva.
- Cargar datos ligeros.
- Iniciar animaciones.
onResume()
Se llama cuando la actividad está lista para interactuar con el usuario (en primer plano).
- Iniciar solicitudes a la API.
- Reanudar animaciones, reproducción o listeners de sensores.
onPause()
Se llama cuando la actividad ya no está en primer plano pero aún es parcialmente visible. Se utiliza para guardar el estado y liberar recursos temporales.
- Pausar animaciones o la reproducción de video.
- Guardar cambios no guardados.
onStop()
Se llama cuando la actividad ya no es visible para el usuario.
- Liberar recursos como conexiones de red.
- Guardar el estado de la aplicación.
onRestart()
Se llama cuando la actividad se reinicia después de haberse detenido.
- Reinicializar componentes o refrescar los datos si es necesario.
onDestroy()
Se llama cuando se destruye la actividad. Es el último método ejecutado.
- Liberar memoria y recursos.
- Limpiar listeners, hilos o ViewModels.
## Demostración
A continuación, algunas capturas de pantalla de la aplicación:
## License [](https://opensource.org/licenses/MIT)
The MIT License (MIT)
- **Copyright (c) 2024 Jonathan Reátegui**
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
## Notes
- This README is also available in Spanish [here](README-es.md)
- Este README también está disponible en español [aquí](README-es.md)