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.ui.camera

import android.Manifest
import android.content.pm.PackageManager
import android.os.Bundle
import android.util.Log

CameraX for camera functionality

kotlin android camerax
by Alex Chen 1 tab
kotlin
package com.example.myapp.ui.player

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.example.myapp.databinding.ActivityVideoPlayerBinding
import com.google.android.exoplayer2.ExoPlayer

ExoPlayer for media playback

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

import android.content.Context
import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.*
import androidx.datastore.preferences.preferencesDataStore

DataStore for modern preferences

kotlin android datastore
by Alex Chen 2 tabs
kotlin
package com.example.myapp.utils

import android.content.Context
import android.graphics.drawable.Drawable
import android.widget.ImageView
import com.bumptech.glide.Glide

Glide for image loading and caching

kotlin android glide
by Alex Chen 2 tabs
kotlin
package com.example.myapp.services

import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.PendingIntent
import android.content.Context

Firebase Cloud Messaging for push notifications

kotlin android firebase
by Alex Chen 2 tabs
kotlin
package com.example.myapp.data.repository

import com.example.myapp.data.local.PostDao
import com.example.myapp.data.local.PostEntity
import com.example.myapp.data.remote.ApiService
import com.example.myapp.models.Post

Unit testing with JUnit and MockK

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

import android.content.Context
import android.content.SharedPreferences
import androidx.security.crypto.EncryptedSharedPreferences
import androidx.security.crypto.MasterKey

Encrypted SharedPreferences for secure storage

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

import androidx.paging.PagingSource
import androidx.paging.PagingState
import com.example.myapp.data.remote.ApiService
import com.example.myapp.models.Post

Paging 3 library for data pagination

kotlin android paging
by Alex Chen 3 tabs
kotlin
package com.example.myapp.ui.theme

import androidx.compose.material3.Typography
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.Font
import androidx.compose.ui.text.font.FontFamily

Material Design 3 theming

kotlin android material-design
by Alex Chen 2 tabs
kotlin
package com.example.myapp.workers

import android.content.Context
import androidx.hilt.work.HiltWorker
import androidx.work.*
import dagger.assisted.Assisted

WorkManager for background tasks

kotlin android workmanager
by Alex Chen 2 tabs
kotlin
package com.example.myapp.ui.adapters

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.ListAdapter

RecyclerView with DiffUtil for efficient lists

kotlin android recyclerview
by Alex Chen 2 tabs
xml
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/nav_graph"
    app:startDestination="@id/postsFragment">

Navigation Component for app navigation

kotlin android navigation
by Alex Chen 3 tabs