Skip to content

Instantly share code, notes, and snippets.

@NamtarR
NamtarR / build.gradle
Last active February 12, 2023 07:53
Android resource generation task
apply from: './task.gradle'
android.applicationVariants.all { variant ->
def file = project.file("build/generated/res/res-task/main")
def files = project.files(file)
files.builtBy(generateStringsFile)
variant.registerGeneratedResFolders(files)
}
@NamtarR
NamtarR / User.kt
Created March 22, 2019 12:57
Android Room SQLite UPSERT without using actual https://www.sqlite.org/lang_UPSERT.html
package com.namtarr.upsert
import androidx.room.Entity
import androidx.room.PrimaryKey
@Entity
class User(
@PrimaryKey
val id: Long,
val name: String