Dev/Kotlin

Kotlin - 기록

healthyryu 2021. 10. 12. 16:10

1. joinToString()

https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/join-to-string.html

 

joinToString - Kotlin Programming Language

 

kotlinlang.org

println(listOf('a', 'b', 'c').joinToString(seperator="", prefix="(", postfix=")")
--> (abc)

 

2. Debug Keystore 생성

$ keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 -storetype JKS

 

이유

The -storetype JKS tag is only required for Java 9 or newer. As of the Java 9 release, the keystore type defaults to PKS12.

https://stackoverflow.com/a/68773266/3897810

 

Error building AAB - Flutter (Android) - Integrity check failed: java.security.NoSuchAlgorithmException: Algorithm HmacPBESHA256

I am trying to build an AAB for my flutter app. I generated the keystore using the following below command: keytool -genkey -v -keystore ~/pc-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 ...

stackoverflow.com

 

 

3. ViewBinding

지금도 가끔씩 Activity 에 ViewBinding 을 하면서 setContentView() 처리 하는걸 까먹곤 한다.

(평소에 BaseActivity 에 미리 셋팅해놓고 작업하기 때문에... 새롭게 프로젝트 생성할때 가끔씩 까먹는다.... ^^;;;)

 

 

[Process]

 

1. Gradle(모듈) 설정

- viewBinding 설정

 

android {
    ....
    buildFeatures {
        viewBinding true
    }
}


2. Activityd의 xml레이아웃 작업
- 파일 최상단, 최하단에 <layout> </layout> 처리

<?xml version="1.0" encoding="utf-8"?>
<layout>
    <androidx.constraintlayout.widget.ConstraintLayout
        ....
    />
    ....
</layout>


3. Activity 화면에서 설정 하기
- binding 변수 설정
- binding 에 inflate 처리
- setContextView(binding.root) 처리

lateinit var binding: ActivityMainBinding

override fun onCreate(savedInstanceState: Bundle?) {
	super.onCreate(savedInstanceState)
	binding = ActivityMainBinding.inflate(layoutInflater)
	setContentView(binding.root)
    ....
}

 

 

4. 추가 Glide Cache 설정 작업

https://parkho79.tistory.com/162?category=724800
https://gift123.tistory.com/31
https://futurestud.io/tutorials/glide-caching-basics
반응형