<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Gülçin Taş on Medium]]></title>
        <description><![CDATA[Stories by Gülçin Taş on Medium]]></description>
        <link>https://medium.com/@ce.gulcintas?source=rss-fbefc6812bcc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*KcGHePj-p8oDeq7OS-UaKA.jpeg</url>
            <title>Stories by Gülçin Taş on Medium</title>
            <link>https://medium.com/@ce.gulcintas?source=rss-fbefc6812bcc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 16:16:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ce.gulcintas/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[LiveData Property with Custom Getter vs.]]></title>
            <link>https://medium.com/@ce.gulcintas/livedata-property-with-custom-getter-vs-f313c808a929?source=rss-fbefc6812bcc------2</link>
            <guid isPermaLink="false">https://medium.com/p/f313c808a929</guid>
            <dc:creator><![CDATA[Gülçin Taş]]></dc:creator>
            <pubDate>Tue, 18 Jul 2023 16:03:01 GMT</pubDate>
            <atom:updated>2023-07-18T16:04:00.941Z</atom:updated>
            <content:encoded><![CDATA[<h3>LiveData Property with Custom Getter vs. LiveData Property without Custom Getter: A Detailed Comparison</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZAwjREFkaBsrnpR1dx6mbQ.jpeg" /></figure><p><em>Note: This article aims to compare the two declarations of LiveData properties in Kotlin, namely </em><em>val movies: LiveData&lt;MoviesListResponse&gt; get() = _movies and </em><em>val movies: LiveData&lt;MoviesListResponse&gt; = _movies. The comparison will delve into how the custom getter, denoted by </em><em>get(), offers more flexibility and additional benefits.</em></p><h4>Introduction</h4><p>In Kotlin, LiveData is a powerful data holder class designed to observe changes in data and update the UI automatically when the underlying data changes. LiveData is widely used in Android development, especially in combination with ViewModel, to achieve the MVVM (Model-View-ViewModel) architecture.</p><p>When working with LiveData, we often declare properties with the LiveData type in our ViewModel. Two common ways to declare LiveData properties are:</p><ol><li>val movies: LiveData&lt;MoviesListResponse&gt; = _movies</li><li>val movies: LiveData&lt;MoviesListResponse&gt; get() = _movies</li></ol><p>Let’s explore the differences between these two declarations and understand how the custom getter, get(), provides additional advantages.</p><h4>LiveData Property without Custom Getter:</h4><pre>val movies: LiveData&lt;MoviesListResponse&gt; = _movies</pre><p>In this declaration, we are directly assigning the _movies object to the movies property. The _movies object is a MutableLiveData object that holds the MoviesListResponse data. Any changes made to the _movies object will directly reflect in the movies property since LiveData properties are read-only and cannot be reassigned.</p><p>However, this approach has a limitation. If we need to modify the movies property before returning it, like filtering, mapping, or any other data transformation, we cannot achieve it with this straightforward assignment.</p><h4>LiveData Property with Custom Getter:</h4><pre>val movies: LiveData&lt;MoviesListResponse&gt; get() = _movies</pre><p>With this declaration, we are using a custom getter for the movies property. The custom getter allows us to perform additional operations before returning the LiveData object.</p><p>The key advantage of using a custom getter is that it provides a place to perform data transformation or validation before exposing the LiveData to external observers. For instance, we can apply filters, map the data, or perform any other data manipulation before returning the LiveData object. This customization is not possible with the direct assignment method.</p><p>Moreover, since LiveData is an observable data holder, using a custom getter allows us to implement more sophisticated logic inside the getter, such as handling caching mechanisms, lazy initialization, or other forms of data pre-processing.</p><h4>Example: Applying Data Transformation with Custom Getter:</h4><pre>private val _rawMovies = MutableLiveData&lt;MoviesListResponse&gt;()<br>val rawMovies: LiveData&lt;MoviesListResponse&gt; get() = _rawMovies</pre><pre>val filteredMovies: LiveData&lt;MoviesListResponse&gt; get() {<br>    // Apply a filter to select only specific movies based on a condition<br>    val filteredList = _rawMovies.value?.movies?.filter { it.popularity &gt; 7.5 }</pre><pre>    // Create a new LiveData containing the filtered list<br>    return MutableLiveData(MoviesListResponse(filteredList))<br>}</pre><p>In this example, we have two LiveData properties: _rawMovies, which holds the original list of movies, and filteredMovies, which is a custom getter property. The filteredMovies property applies a filter to the original data and returns a new LiveData object containing the filtered movies.</p><h4>Conclusion</h4><p>Using a custom getter for LiveData properties provides enhanced flexibility and control over data transformation and validation. By applying data manipulation inside the getter, we can preprocess the data before it reaches the UI, improving code organization and maintainability.</p><p>In contrast, direct assignment of LiveData properties limits the ability to apply data transformation directly within the property declaration. As a result, developers might need to handle data transformation and filtering at the UI level, which can lead to less modular and harder-to-maintain code.</p><p>In conclusion, when working with LiveData in Kotlin, consider using custom getters to take full advantage of its flexibility and to enhance the codebase’s robustness and maintainability.</p><p>#Kotlin #LiveData #MVVM #AndroidDevelopment #DataTransformation</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f313c808a929" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring const val in Kotlin: Usage and Applications]]></title>
            <link>https://medium.com/@ce.gulcintas/exploring-const-val-in-kotlin-usage-and-applications-bb42a1876a4e?source=rss-fbefc6812bcc------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb42a1876a4e</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[const-val]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[companion-object]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Gülçin Taş]]></dc:creator>
            <pubDate>Sun, 09 Jul 2023 08:42:57 GMT</pubDate>
            <atom:updated>2023-07-09T08:42:57.815Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z7LJ4quumZoeQ7Z4CHpQ-A.jpeg" /></figure><h4>Introduction</h4><p>Kotlin is a modern programming language that provides various features to make development easier and more efficient. One of these features is the ability to define constants using the const val keyword. However, there are some limitations on where this keyword can be used. In this article, we will explore the usage of const val in Kotlin, specifically focusing on its usage within companion objects.</p><h4>Understanding const val and Companion Objects</h4><p>In Kotlin, the const keyword is used to define compile-time constants. These constants must have a value that is known at compile-time and cannot be changed during runtime. The val keyword is used to declare read-only properties in Kotlin.</p><p>Companion objects in Kotlin are objects that are tied to a class and can be accessed without an instance of the class. They are defined within the class using the companion object block. The const val declarations inside a companion object are associated with the class itself and can be accessed directly without an instance of the class.</p><h4>Reason for Using Companion Objects</h4><p>Companion objects provide a way to define class-level properties and functions that can be accessed without creating an instance of the class. Since const val declarations are compile-time constants, they are known at compile-time and can be accessed directly through the companion object.</p><p>On the other hand, dynamic classes like Activity in Android applications cannot have const val declarations. This is because the values of these declarations may not be known at compile-time and can change during runtime.</p><h4>Conclusion</h4><p>In this article, we explored the usage of const val in Kotlin and its availability within companion objects. We learned that const val can be used within companion objects to define compile-time constants that are associated with the class itself. However, it cannot be used in dynamic classes like Activity, where the values may not be known at compile-time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb42a1876a4e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Secrets Gradle Eklentisi]]></title>
            <link>https://medium.com/@ce.gulcintas/android-projeleri-i%C3%A7in-gizli-bilgilerin-ve-yap%C4%B1land%C4%B1rmalar%C4%B1n-g%C3%BCvenli-kullan%C4%B1m%C4%B1-secrets-gradle-fc34d17891b9?source=rss-fbefc6812bcc------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc34d17891b9</guid>
            <dc:creator><![CDATA[Gülçin Taş]]></dc:creator>
            <pubDate>Mon, 08 May 2023 20:16:06 GMT</pubDate>
            <atom:updated>2023-05-09T06:19:53.253Z</atom:updated>
            <content:encoded><![CDATA[<h4>Android Projeleri için Gizli Bilgilerin ve Yapılandırmaların Güvenli Kullanımı: Secrets Gradle Eklentisi</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rW9kCV6diDRtUib6K5i8VA.jpeg" /></figure><p>Android projelerinde, API anahtarları, OAuth istemci kimlikleri ve diğer hassas bilgiler gibi gizli bilgiler ve yapılandırmalar genellikle BuildConfig veya AndroidManifest.xml dosyalarında saklanır. Bu tür bilgilerin kaynak kodda açık bir şekilde bulunması güvenlik açısından sakıncalıdır ve kötü amaçlı kullanıcılar tarafından bu bilgilere erişilmesine neden olabilir.</p><p>Bu makalede, Kotlin ile yazılmış bir Gradle eklentisi olan “Secrets Gradle Plugin” ile ilgili detayları öğreneceğiz. Bu eklenti, gizli bilgilerin ve yapılandırmaların güvenli kullanımını sağlamak için adanmış properties dosyalarından gizli bilgileri ve yapılandırmaları okur ve projenin BuildConfig ve AndroidManifest.xml dosyalarına enjekte eder.</p><h4>Secrets Gradle Eklentisinin Yapısı</h4><p>1. Extensions.kt: Bu dosya, eklenti tarafından kullanılan yardımcı fonksiyonlar içermektedir. Proje türünü almak (uygulama veya kütüphane), properties dosyalarını yüklemek ve enjekte edilecek değerlerin biçimlendirilmesini sağlayan fonksiyonlar içermektedir.</p><p>2. SecretsPlugin.kt: Bu dosya, eklentinin ana sınıfını içermektedir. Eklentinin uygulanması sırasında, projeye özel yapılandırma nesnesi başlatılır ve tüm desteklenen bileşenler üzerinde işlemler gerçekleştirilir. Varsayılan ve build/flavor özel properties dosyaları yüklenir ve enjeksiyon işlemleri yapılır.</p><p>3. SecretsPluginExtension.kt: Bu dosya, eklentinin yapılandırma nesnesini tanımlamaktadır. İçinde, properties dosyasının adını, yoksayılacak anahtarların listesini ve varsayılan değerler içeren bir properties dosyasının adını yapılandırabileceğiniz özellikler bulunmaktadır.</p><h4>Secrets Gradle Eklentisinin Kullanımı</h4><p>Eklentiyi kullanarak gizli bilgileri ve yapılandırmaları güvenli bir şekilde yönetmek için aşağıdaki adımları takip edin:</p><ol><li>Eklentiyi projenize ekleyin: Eklentiyi projenizin build.gradle dosyasına ekleyin (app düzeyinde).</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B347CLSW9Si2-dzwjcKShA.png" /></figure><p>2. Properties dosyalarını hazırlayın: Projenizin kök dizininde local.properties adında bir properties dosyası oluşturun ve gizli bilgilerinizi ve yapılandırmalarınızı bu dosyada saklayın. Özel build type veya flavor dosyaları oluşturarak, ilgili bileşenlere özel yapılandırmalar ekleyebilirsiniz.</p><p>3. Eklentiyi yapılandırın: Eklenti için yapılandırma nesnesini projenizin build.gradle dosyasında kullanarak özelleştirebilirsiniz. Örneğin, farklı bir properties dosyası adı veya yoksayılacak anahtarlar belirtmek istiyorsanız:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aq6aVVS8Rwg8ki924N1c8A.png" /></figure><p>4. Gizli bilgileri ve yapılandırmaları kullanın: Artık gizli bilgileriniz ve yapılandırmalarınız BuildConfig ve AndroidManifest.xml dosyalarında güvenle kullanılabilir. Örneğin, BuildConfig’de API_KEY adlı bir anahtarınız varsa, şu şekilde kullanabilirsiniz:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*ELNyToy5O3RtSjPxbpa0Gg.png" /></figure><p>AndroidManifest.xml’de ise şu şekilde kullanılabilir:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gZ9P7uo7-VjLexD9PVVNiw.png" /></figure><p>Secrets Gradle Eklentisi, Android projelerinde gizli bilgilerin ve yapılandırmaların güvenli kullanımını sağlayarak, hassas verilerin kötü amaçlı kullanıcılardan korunmasına yardımcı olur. Gradle eklentisi, projenin BuildConfig ve AndroidManifest.xml dosyalarına enjeksiyon yaparak gizli verileri proje kaynak kodundan ayrıştırır. Bu sayede, geliştiriciler güvenlik açısından daha fazla kontrol sağlarlar ve projelerindeki hassas bilgilerin güvenliğini artırırlar.</p><p>Yukarıda gördüğünüz makale yazımı ve kod analizi ChatGPT’den faydalanılarak yapılmıştır. ChatGPT ile kod analizi ve doküman yazmak oldukça keyifli. Hem bir sürü yeni bilgi öğrenebilir hem de bilgilendirici makaleler yazabilirsiniz. İyi çalışmalar dilerim.</p><h4>Kaynakça :</h4><ul><li><a href="https://github.com/google/secrets-gradle-plugin">GitHub - google/secrets-gradle-plugin: A Gradle plugin for providing your secrets to your Android project.</a></li><li><a href="https://developers.google.com/maps/documentation/android-sdk/secrets-gradle-plugin?hl=tr">Secrets Gradle eklentisi | Maps SDK for Android | Google Developers</a></li><li><a href="https://openai.com/">OpenAI | Research &amp; Deployment</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc34d17891b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android Jetpack Navigation Component]]></title>
            <link>https://medium.com/developer-multicamp/android-jetpack-navigation-component-fbf5de3cb5b2?source=rss-fbefc6812bcc------2</link>
            <guid isPermaLink="false">https://medium.com/p/fbf5de3cb5b2</guid>
            <category><![CDATA[navigation-component]]></category>
            <category><![CDATA[jetpack]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Gülçin Taş]]></dc:creator>
            <pubDate>Fri, 18 Mar 2022 16:03:29 GMT</pubDate>
            <atom:updated>2022-03-18T20:01:49.550Z</atom:updated>
            <content:encoded><![CDATA[<p>Android Uygulamalarımızın Bel Kemiği Jetpack Navigation Component</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n1pUri-z46NbzfU1NelIsg.png" /><figcaption>Top-Level Navigation Graph</figcaption></figure><p>Herkese Merhaba! 🤩</p><p>Bu yazı da yukarıdaki alt başlıkta da belirttiğim gibi android uygulamalarının olmazsa olmazı belki de en sevilen kütüphanelerden birisi olan Jetpack Navigation Component ile ilgili bir yazı yazmak istedim. Gelin hep beraber daha yakından inceleyelim.</p><p>Android dünyasında fragmentler ile çalışmak bazen hepimiz için bir kâbusa dönüşebiliyor. Bir de ortalama veya büyük denilebilecek bir projede yönlendirme işlemlerini fragment manager ile yapmak kâbusun tam kendisi olabilir. Jetpack Navigation Component, fragment manager ve backstack ile ilgili işlemleri arka planda bizim yerimize handle ediyor. Hem de çok güzel bir arayüz imkanı ile birlikte. 🥳</p><h4>Jetpack Navigation Component`in Avantajları</h4><p><em>💚 : </em><strong><em>Navigation editör</em></strong><em> ile basit ve anlaşılır bir kullanıcı arayüzüne sahip olması,</em></p><p><em>💙: </em><strong><em>Fragment transactionlar</em></strong><em> ile ilgili adımları bizim yerimize arka planda kendisinin ele alması,</em></p><p><em>💚: </em><strong><em>Deeplink</em></strong><em> kullanımı kolaylaştırması,</em></p><p><em>💙 : </em><strong><em>Safe Args</em></strong><em> (Gradle ile birlikte) navigasyon ve veri taşıma işlemlerinde t</em><strong><em>ype-safety</em></strong><em> sağlaması,</em></p><p><em>💚 : Fragment geçişleri arasında standart bir animasyon yapısı kullanmamıza olanak sağlaması,</em></p><p><em>💙 : Navigation Component sayesinde classlar içerisinde yer alan </em><strong><em>boilerplate</em></strong><em> diye adlandığımız kod kalabalığını da azaltmış olması,</em></p><p><em>💚: </em><strong><em>Global action</em></strong><em>, </em><strong><em>nested graph</em></strong><em> ve </em><strong><em>dialog fragment</em></strong><em> gibi ilgili ihtiyaca yönelik özellikleri de bulunuyor.</em></p><p><em>💙 : </em><strong><em>Navigation drawer</em></strong><em>, </em><strong><em>action bar</em></strong><em> menü gibi kompleks menülerin yönlendirme işlemlerinde de navigation component kullanabiliyoruz.</em></p><h4>Safe Args</h4><p>Safe Args plugini fragmentler arasında veri taşırken <strong>type safety</strong> olarak veri taşınmasını sağlar. Bundan dolayı da Google tarafında da navigation component ile birlikte kullanılması önerilir.</p><blockquote>The recommended way to navigate between destinations is to use the Safe Args Gradle plugin. This plugin generates simple object and builder classes that enable type-safe navigation and argument passing between destinations.</blockquote><p>Safe Args pluginini kullanmak için <strong>build. gradle </strong>dosyasina aşağıdaki tek satırı eklemeniz ve projenizde Gradle kullanmanız yeterlidir.</p><pre>plugins {<br>  id &#39;androidx.navigation.safeargs&#39;<br>}</pre><p>Safe Args ile navigation graph icerisinde argument ile transfer etmek istedigimiz verileri tanimlayabiliriz. Fragmentler arasinda veri tasimak icin <strong>bundle</strong> yapisi kullanilir. Safe Args`ta arka planda bundle yapısını kullanıyor ancak buna ek olarak diyelim ki HomeFragment`e veri gonderecegiz arka planda HomeFragmentArgs adında bir class oluşturuyor.</p><p>Navigation Component ile tanımladığımız actionlara class tarafında ID ile erişmek yerine yine Safe Args`in oluşturduğu <strong>HomeFragmentDirections</strong> class sayesinde daha güvenli bir yönlendirme yapabiliriz. Daha ne yapsın değil mi ? :)</p><p>Safe Args primitive tipleri desteklemekle beraber parcelable ve serializable yöntemleriyle kompleks veri yapılarını da kullanabiliriz.</p><p><strong>Navigation Component</strong></p><p>Navigation Component`i kullanabilmek için build. gradle dependency içerisinde aşağıdaki <strong>implementation</strong> adımlarını uygulamalıyız.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wdymi2viL5mEUEQ0ktPvlQ.png" /><figcaption>Set up your environment</figcaption></figure><p>Navigation Component ile yönlendirme yapabilmemiz için <em>zorunlu</em> üç temel yapı taşı aşağıda yer alıyor.</p><p>🔧 <strong>Navigation graph: </strong>res/navigation dosyasının altında yer alan xml dosyasıdır. Bu dosya içerisinde navigasyon ile ilgili fragmentler, actionlar, argumentler, deeplink kullanımı, animasyonlar gibi nice özellik design tabından veya xml kodları içerisinden eklenebilir.</p><p>🔧 <strong>NavHostFragment: </strong>Bu yapının işlevi navigation graph içerisindeki destinationlar arasındaki yönlendirmelere ev sahipliği yapmaktır. Bizim navigasyon işlemlerimizi gösteren boş bir konteyner olarak hayal edebiliriz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1mpo4GmVm5hatKQwV9i8Yg.png" /></figure><p>🔧<strong> NavController: </strong>NavHostFragment ile birlikte çalışarak uygulamadaki navigasyon işlemlerini yönlendirir. NavGraph içerisinde StartDestinastion olarak belirtilmiş olan fragment içerisinde tanımlanır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BMlkehxlf_pPTkWGfacDTA.png" /><figcaption>NavController</figcaption></figure><p>En sevdiğim Jetpack kütüphanelerinden biri olan Navigation Componentin genel hatlarıyla bahsetmek istedim. İlerleyen zamanlar yine başka bir Jetpack kütüphanesinin yazısında görüşmek üzere o zamana kadar kendinize çok iyi bakin Android ile kalın. 💚💙</p><h4><strong>Kaynakça</strong></h4><ol><li><a href="https://developer.android.com/guide/navigation">https://developer.android.com/guide/navigation</a></li><li><a href="https://developer.android.com/codelabs/android-navigation">https://developer.android.com/codelabs/android-navigation</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fbf5de3cb5b2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/developer-multicamp/android-jetpack-navigation-component-fbf5de3cb5b2">Android Jetpack Navigation Component</a> was originally published in <a href="https://medium.com/developer-multicamp">Developer MultiGroup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>