Introducci贸n a la Integraci贸n Nativa en Android

1

Integra APIs Nativas en Android

2

Creaci贸n proyecto base

Google Maps SDK

3

C贸mo crear una API key para Google Maps en Google Cloud

4

Creaci贸n de marcadores en Google Maps con Jetpack Compose

5

C贸mo dibujar rutas en mapas usando polil铆neas en Jetpack Compose

6

C贸mo enfocar autom谩ticamente mapas usando Camera Update Factory

Quiz: Google Maps SDK

Servicios de Localizaci贸n

7

Uso de Flows en Kotlin para Controlar Intervalos de Tiempo y Emisi贸n de Datos

8

C贸mo simular ubicaci贸n en emuladores y dispositivos reales

9

Creaci贸n de Modelos y C谩lculos de Localizaci贸n con Clean Architecture

10

Implementaci贸n de Localizaci贸n en Android Usando Flows

11

Inyecci贸n de dependencia para seguimiento de localizaci贸n en Android

12

Uso de StateFlows para rastrear ubicaci贸n en aplicaciones Android

13

Location Tracker

14

Implementaci贸n de Location Tracker con Inyecci贸n de Dependencias

Quiz: Servicios de Localizaci贸n

Integraci贸n Maps con Localizaci贸n

15

Integraci贸n de mapas din谩micos con CameraPositionState en Android

16

Creaci贸n y uso de polil铆neas en mapas con datos reales

17

Creaci贸n de una pantalla de mapa con Intents y estados en Jetpack Compose

18

Creaci贸n de un ViewModel para Seguimiento de Localizaci贸n en Android

Quiz: Integraci贸n Maps con Localizaci贸n

Manejo de permisos

19

Gesti贸n de permisos en Android para localizaci贸n, c谩mara y notificaciones

20

C贸mo implementar di谩logos para solicitar permisos en Android

21

Manejo de permisos de localizaci贸n y notificaci贸n en Android

22

C贸mo gestionar permisos en Android con Jetpack Compose

Quiz: Manejo de permisos

Integraci贸n c谩mara

23

Integraci贸n de c谩mara en Android con Photo Handler y manejo de permisos

24

Convierte Bitmaps a ByteArrays en Android con Kotlin

25

Creaci贸n de intents y estados UI para c谩mara en Android con Kotlin

26

Implementaci贸n de funciones clave en ViewModel para c谩mara Android

27

Integrar C谩maraX en Jetpack Compose para Android

28

Captura y previsualizaci贸n de fotos en Android con Jetpack Compose

29

C贸mo Mostrar Fotos en Marcadores de Ubicaci贸n en Mapas con Jetpack Compose

Quiz: Integraci贸n c谩mara

Servicios en Android

30

Implementaci贸n de servicios en Android: normal services y foreground services

31

Implementar Foreground Services en Android para Persistencia en Segundo Plano

Quiz: Servicios en Android

Transmisiones en Android (Broadcast)

32

Implementaci贸n de BroadcastReceiver en Android para Escuchar Eventos del Sistema

33

Pruebas finales y cierre

You don't have access to this class

Keep learning! Join and start boosting your career

Aprovecha el precio especial y haz tu profesi贸n a prueba de IA

Antes: $249

Currency
$209
Suscr铆bete

Termina en:

0 D铆as
12 Hrs
48 Min
14 Seg

Creaci贸n de una pantalla de mapa con Intents y estados en Jetpack Compose

17/33
Resources

Starting the development of a main screen for Android map applications involves carefully defining inputs and outputs through the use of Intents and states. This approach facilitates clear and organized management within the application using Jetpack Compose, as we will see in detail.

What is an Intent and why is it important in our application?

An Intent in Android is a user action or intent expressed within a screen. Specifically, we work with Tracking Intent, which defines actions such as start, pause and resume a tracking process:

  • Start: First action to begin tracking.
  • Pause: Temporary pause action of the tracing.
  • Resume: Resume a trace that has been previously started.

If you are not yet familiar with this term, it is recommended to consult basic courses such as Jetpack Compose or MVVM on Android beforehand.

How do we define the states for our map interface?

In Jetpack Compose we will use a dataclass called Tracking Location State to handle the different situations or visual outputs on our map screen. This state will include:

  • isTracking: Indicates whether tracking is currently being performed(boolean, false initially).
  • isPaused: Status of the tracking pause (boolean, false initially).
  • currentLocation: Current location(starts at null**).
  • selectedLocation: Selected location including a timestamp(for future use not yet implemented).
  • trackingDataSegments: List that stores location data segments(initializes empty).

This structured scheme allows an agile and clear management of the information during the use of the app.

How do we implement a basic screen in Jetpack Compose?

The main screen called MapScreen is a composable function, not a class, allowing its simple and dynamic integration into the application. The basic construction involves:

  • Create a Scaffold that will contain UI elements.
  • Insert a Floating Action Button located in a central position(FabPosition.Center).
  • Change the button icon according to the current state(Play or Pause):
  • If paused, it will display the beach icon indicating that it can be continued.
  • If active, the button will show the pause icon.
FloatingActionButton(onClick  =  {  /* action pending */  })  {    if (state.isPaused)  {        Image(imageVector  =  Icons.Default.PlayArrow,              modifier  = Modifier.size(36.dp))     } else  {        Image(imageVector  =  Icons.Default.Pause,              modifier  = Modifier.size(36.dp))     } }}

We use PaddingValues to avoid overlapping content with the status bar and navigation, adjusting the interface for a better user experience.

Box(modifier  = Modifier.fillMaxSize().padding(paddingValues))  {    MapSection(        currentLocation  = state.currentLocation,        isTrackingFinish  = false,        locations  = state.trackingDataSegments,        modifier  = Modifier.fillMaxSize()     )}

Proper implementation of these elements contributes to more order and efficiency in practical development with Jetpack Compose.

Interested in sharing your experience or have a specific question about this process in Jetpack Compose? Let us know and keep learning!

Contributions 0

Questions 0

Sort by:

Want to see more contributions, questions and answers from the community?