Android/Library(3)
-
Lint - Android Studio 내장 Lint vs. Ktlint
Lint : 정적 소스 분석기로 구조적 품질 문제를 식별하고 수정할 수 있음 Linting is the automated checking of your source code for programmatic and stylistic errors. This is done by using a lint tool (otherwise known as linter). A lint tool is a basic static code analyzer. https://www.perforce.com/blog/qac/what-lint-code-and-why-linting-important What Is Lint Code? And Why Is Linting Important? | Perforce Software Linting is..
2022.04.23 -
Dagger2 사용법
Android Dagger2 사용방법 3가지 Component Module Scope를 모두 직접 기술해서 사용하는 방법 DispatchingAdnroidInjector를 제공하는 방법 : AndroidInjectionModule, HasAndroidInjector, DispatchingAndroidInjector 안드로이드 기반클래스(DaggerApplication, DaggerActivity, DaggerFragment 등)로 제공하는 방법 : AndroidSupportInjectionModule, DaggerApplication, DaggerActivity, DaggerFragment Component Module Scope 직접 기술 public class MainActivity : AppComp..
2022.03.18 -
Dagger2
Dagger2란? Dependency Injection을 도와주는 Framework 구성요소 : annotation으로 구분 핵심요소 @Module : 실제 객체를 생성해서 공급(@Provides)해주는 역할 @Component : 객체를 생성하기 위해 제공되는 interface(객체 생성을 위한 통로) @Inject : 객체 생성 주입 대상을 알림 부수요소 @Named : 객체 생성을 위해 리턴 타입만으로 대상을 판단할 수 없을 때 구분자로 사용 @BindsInstance : Dagger내에서 객체 생성이 불가능한 경우, 외부로부터 입력받아 사용(예로, android의 context) @Singleton : 싱글톤(한 컴포넌트 내에서만 유효한 생명주기, 즉, 동일 컴포넌트를 재생성한 경우 서로 다름) ..
2022.03.17