Posts

Jetpack Compose Login UI

Image
In this tutorial, we will implement a login screen’s UI using Jetpack Compose. Open a new Empty Compose Project, name it Compose Login, and add the Compose navigation dependency to your module’s build.gradle file:   build.gradle (Module) // Navigation implementation "androidx.navigation:navigation-compose:2.5.0" MainActivity.kt package com.popularpenguin.composelogin import android.os. Bundle import androidx.activity. ComponentActivity import androidx.activity.compose.setContent import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.material.MaterialTheme import androidx.compose.material.Surface import androidx.compose.runtime. Composable import androidx.compose.ui. Modifier import androidx.compose.ui.tooling.preview. Preview import androidx.lifecycle.viewmodel.compose.viewModel import androidx.navigation.compose.NavHost import androidx.navigation.compose.composable import androidx.navigation.compose.rememberNavController import com.popularpenguin.compo...

A simple crypto app with Nomics API

Image
This blog post will show you how to create a simple MVVM cryptocurrency app using the Nomics API. Some familiarity with Jetpack Compose is strongly recommended; the purpose of this tutorial is to show developers how to create a fully functional app using Compose as well as dependency injection and REST API calls. The end of this post has links to the reference documentation for the various libraries used in the project. The complete project can be found here:  https://github.com/PopularPenguin/CryptoApp Setup First start by going to New Project > Empty Compose Activity. Minimum API level can be set at 21: Android 5.0 Lollipop, the minimum that is required for Jetpack Compose. Now, we need to start adding our dependencies. We first add kotlin-kapt for annotation processing in the build script block. This is used to convert our Hilt annotations (like @HiltAndroidApp and @AndroidEntryPoint, more on this later) into generated code. We need Retrofit for HTTP requests, Moshi for JSON ...