반응형

Android 6

[Android/Kotlin] Kotlin Flow를 활용한 비동기 데이터 스트림 처리

안드로이드 앱 개발에서 비동기 처리는 중요한 부분입니다. 사용자의 경험을 부드럽게 유지하기 위해 백그라운드에서 데이터를 가져오고, 데이터베이스 작업을 실행하고, 네트워크 호출을 수행해야 합니다. 이러한 비동기 작업을 관리하는 데 Kotlin Flow가 새로운 해결책을 제시합니다. Kotlin Flow란 무엇인가요? Kotlin Flow는 Kotlin 코루틴을 기반으로 한 cold stream으로, 연속적인 데이터를 처리할 수 있는 비동기 데이터 스트림 라이브러리입니다. Flow는 비동기적으로 여러 값들을 반환할 때 유용하며, 라이프사이클 인식 및 코루틴과의 뛰어난 호환성을 제공합니다. Kotlin Flow를 사용한 간단한 데이터 가져오기 예제 다음은 네트워크에서 데이터를 가져와 화면에 표시하는 간단한 예..

프로그래밍 2024.04.22

[Android/Kotlin] Jetpack Compose의 강력한 기능 활용하기

안드로이드 개발은 끊임없이 진화하고 있으며, 최신 트렌드 중 하나는 Jetpack Compose입니다. 이번 포스팅에서는 Jetpack Compose를 사용하여 사용자 인터페이스를 간단하게 구현하는 방법을 소개하고자 합니다. 이 도구는 선언형 UI 패러다임을 도입하여 더욱 직관적이고 반응적인 앱을 만들 수 있게 해줍니다. Jetpack Compose란 무엇인가요? Jetpack Compose는 안드로이드의 모던 UI 툴킷으로, Kotlin을 기반으로 합니다. 개발자가 더 적은 코드로, 더 효율적으로 UI를 구성할 수 있도록 도와줍니다. XML 레이아웃을 대체하여 레이아웃 코드와 로직이 Kotlin 파일 내에 공존하게 되므로, UI 구성 요소의 상태를 더 쉽게 관리할 수 있습니다. 간단한 예제로 배워보기 ..

프로그래밍 2024.04.22

[Android] Intent를 이용하여 GMail 보내기

1 2 3 4 5 6 7 8 9 Intent intent = new Intent(Intent.ACTION_SEND); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setType("text/plain"); intent.setPackage("com.google.android.gm"); intent.putExtra(Intent.EXTRA_EMAIL, new String[]{받을 이메일 주소}); intent.putExtra(Intent.EXTRA_SUBJECT, 이메일 제목); intent.putExtra(Intent.EXTRA_TEXT, 이메일 내용); startActivity(intent); Colored by Color Scripter cs

프로그래밍 2019.04.23

[Android] 메테리얼 탭(Material Sliding Tabs)

※ 반드시 앱 테마를 NoActionBar로 지정하세요! In this tutorial we are going to implement sliding tabs in material design style by using the SlidingTabLayout from Google iosched app, The SlidingTabLayout is also provided on the Google developer page as well but it isn't updated with some methods such as setDistributeEvenly() and this method is actually needed to make fixed tabs, the Google ioshed version is mo..

프로그래밍 2015.10.11
반응형