안드로이드 프로그래밍[Kotiln Code]/안드로이드 부분 함수(권한얻기,인텐트, 데이터바인딩) 17

[Kotlin] 잡스케쥴

안녕하세요. 훈츠 입니다. 잡스케쥴 하는 방법입니다. 권한 설정 ( Manifests ) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 //훈스 블로그---------------------------------------------------------------------------------------------------코드// http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter http://colorscripter.com/info#e" target="_blank" style="text-decoration:none;color:..

[Kotiln] 화면 오버레이 권한 획득

안녕하세요. 훈츠 입니다. 화면 오버레이 권한 획득 방법입니다. 권한 설정 ( Manifests ) 1 2 3 4 5 //훈스 블로그---------------------------------------------------------------------------------------------------코드// http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter http://colorscripter.com/info#e" target="_blank" style="text-decoration:none;color:white">cs 권한 요청 ( re..

[Kotiln] 안드로이드 죽지 않는 서비스 사용하기 (라이프 싸이클 이용)

안녕하세요. 훈츠 입니다. 안드로이드의 죽지 않는 서비스 구현 하는 방법 입니다. 앱의 런닝 상태인지, 혹은 UI 가 안보이는 상태인지 APP 이 꺼졌는지 확인할수 있는 방법에 대해 포스팅 합니다. Android Jetpack - Lifecycle Livecycle: Lifecylce을 나타내는 객체입니다. LivecycleOwner: Activity객체를 말하며 Lifecycle객체에 액티비티 상태를 제공해줍니다. LifecycleObserver: Lifecylce로부터 액티비티 상태변화에 대한 이벤트를 받습니다. LifecycleOwner, Lifecycle LifecycleOwner는 Activity를 의미하고, 내부에 Lifecycle을 갖고 있습니다. Lifecycle은 액티비티의 상태를 저장하..

[Kotiln] 유저가 View 만드는 코드

View 만드는 코드 Kotiln code open class InfoView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : LinearLayout(context, attrs, defStyleAttr){ init { View.inflate(context, R.layout.view_info, this) } } info_view.xml code AlarmInfoView.kt class AlarmInfoView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) :..

[Kotiln] 앱 띄울때 시스템 UI를 숨기고 전체화면 표시

안드로이드 앱을 띄우는 Window의 속성을 변경하여 시스템 UI를 숨기고 전체화면으로 표시하는 코드 window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LOW_PROFILE or View.SYSTEM_UI_FLAG_FULLSCREEN or View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION

[Kotiln] handler and runnable

안녕하세요. 훈츠 입니다. hanlder 와 runnable 간단하게 메모하고 갑니다. var handler : Handler? = null var runnable : Runnable? = null //Runnable이 실행되면 ListActivity로 이동하는 코드 runnable = Runnable { val intent = Intent(applicationContext, ListActivity::class.java) startActivity(intent) } //Handler 를 생성하고 2초후 runnable을 실행 handler = Handler() handler?.run{ postDelayed(runnable, 2000) }

[Kotiln] Work Manager

안녕하세요. 훈츠 입니다. 금일은 Work Manger 대해 포스팅 합니다. Work Manager에 대한 내용은 다른 블로그나 개발자 홈페이지에 잘나와있으니, 간단하게 사용법에 대해 기록합니다. Work Manager 비동기 1회성 작업 또는 주기적으로 실행되는 작업을 예약 할수 있습니다. 네트워크 가용성 또는 충전 상태 같은 작업에 대한 제약 조건을 추가 할수 있으며, 작업을 순차적으로 실행 시키는 체이닝 또한 가능합니다. WorkManager 는 앱 프로세스가 사라지더라도 안전하게 종료되어야 하는 진행 중인 백그라운드 작업 또는 즉시 실행해야 하는 작업을 대상으로 하지 않습니다. 사용법 정리 Dependency 추가 Worker 만들기 WorkRequest 만들기 제약 걸기 시간 예약 기타.. Wo..

[Kotlin] Coroutine 코루틴

안녕하세요. 훈츠 입니다. 금일은 코루틴에 대해 포스팅 합니다. Kotlin 코루틴 코루틴을 사용하여, 비동기 코드를 작성할수 있습니다. 코루틴에 대한 자세한 설명은 개발자 페이지를 참조하세요. 사용법 정리 Dependency 추가 코루틴 스코프의 종류 ViewModelScope LifecycleScope liveData Dependency 추가 dependencies { def lifecycle_version = "2.2.0" def arch_version = "2.1.0" // ViewModel implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version" // LiveData implementation "androidx...

UI 관련 Tips and Trick

안녕하세요. 훈츠 입니다. UI 관련 Tips and Trick 포스팅 합니다. 1. Dependency 추가 implementation "com.google.android.material:material:1.1.0" 2. Style 변경 3. ConstraintLayout View 들의 위치 지정시 위처 정보의 네점은 parent로 두고, Vertical_bias 혹은 Horizontal_bias로 조정 합니다. View 의 위치를 자석으로 붙일때는 Top_toBottomOf 를 이용합니다. View 의 text size 지정시, textAppearance 를 이용 합니다. = Headline, Body, Display ... View 의 xml 화면 에서 글씨를 미리 보려면, tools:text ="..