Alex Chen

30 code snips · on codesnips 5 months

Senior Android Developer specializing in Kotlin, Jetpack Compose, and modern Android architectures. Expert in building scalable, performant apps with clean architecture. 10+...

kotlin
package com.example.myapp

import android.app.Application
import dagger.hilt.android.HiltAndroidApp

@HiltAndroidApp

Dependency injection with Hilt

kotlin android hilt
by Alex Chen 3 tabs
kotlin
package com.example.myapp.data.remote

import com.squareup.moshi.Moshi
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor

Retrofit for REST API networking

kotlin android retrofit
by Alex Chen 2 tabs
kotlin
package com.example.myapp.data.local

import android.content.Context
import androidx.room.*
import androidx.sqlite.db.SupportSQLiteDatabase
import kotlinx.coroutines.CoroutineScope

Room database for local persistence

kotlin android room
by Alex Chen 2 tabs
kotlin
package com.example.myapp.ui.detail

import androidx.lifecycle.SavedStateHandle
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import dagger.hilt.android.lifecycle.HiltViewModel

MVVM architecture with ViewModel and LiveData

kotlin android mvvm
by Alex Chen 1 tab
kotlin
package com.example.myapp.data

import kotlinx.coroutines.*
import kotlinx.coroutines.flow.*
import retrofit2.http.GET
import retrofit2.http.POST

Kotlin coroutines for async operations

kotlin coroutines async
by Alex Chen 2 tabs
kotlin
package com.example.myapp

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.*

Jetpack Compose declarative UI fundamentals

kotlin android jetpack-compose
by Alex Chen 1 tab