<?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 Angga.K on Medium]]></title>
        <description><![CDATA[Stories by Angga.K on Medium]]></description>
        <link>https://medium.com/@anggakusumo2?source=rss-4331804c0b43------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*C-zoWT1s1ijzKej4sDBeAQ.png</url>
            <title>Stories by Angga.K on Medium</title>
            <link>https://medium.com/@anggakusumo2?source=rss-4331804c0b43------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 19:53:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@anggakusumo2/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[Android Design Pattern — ViewHolder Pattern]]></title>
            <link>https://medium.com/@anggakusumo2/android-design-pattern-viewholder-pattern-f707de7c7c66?source=rss-4331804c0b43------2</link>
            <guid isPermaLink="false">https://medium.com/p/f707de7c7c66</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[androidev]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[recyclerview]]></category>
            <dc:creator><![CDATA[Angga.K]]></dc:creator>
            <pubDate>Tue, 02 Jul 2024 11:52:52 GMT</pubDate>
            <atom:updated>2024-07-02T11:52:52.556Z</atom:updated>
            <content:encoded><![CDATA[<h3>Android Design Pattern — ViewHolder Pattern</h3><p>In the World of Software Engineer we tend to know word <strong>“Design Pattern” . </strong>by definition, <strong>Design patterns</strong> are typical solutions to common problems in software design. Each pattern is like a blueprint that you can customize to solve a particular design problem in your code.</p><p>by now, theres 22 classic design pattern that we know, and its grouped into 3 catalog.</p><ol><li>Creational Patterns</li><li>Structural Patterns</li><li>Behavioral Patterns</li></ol><p>in this articles i wont dive into all 22 pattern, you can read it on <a href="https://refactoring.guru/design-patterns">https://refactoring.guru/design-patterns</a> , but i want to show you android specific design pattern called ViewHolder Pattern.</p><p>Maybe as Android developer you already know this pattern. this pattern used when create ReyclerView Adapter for you ReyclerView.</p><p>Let’s start thinking if we don’t have this pattern</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*eozd4WdfN0Awctw8BESSZw.gif" /></figure><p>if we don’t have this pattern what happend on RecylerView are</p><ul><li><strong>Lag on Scrolling:</strong> Inflating layouts on the fly can cause stuttering and dropped frames, making scrolling feel unresponsive.</li><li><strong>Memory Heavy:</strong> By continuously creating new View objects puts pressure on your app’s memory resources.</li></ul><p>So, they invented this pattern callled ViewHolderPattern</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/1*umbuhXxsZPzOjl-bk8QjFQ.gif" /></figure><p>let’s see how ViewHolder Pattern works:</p><ol><li><strong>ViewHolderClass </strong>will hold reference to the view on our list for example view like TextView, ImageView, etc and takes the inflated views [this are the layout that you inflate on <strong>onCreateViewHolder</strong>], find the view by Id and stores them in member variables</li><li>When we called function <strong>onCreateViewHolder </strong>we inflate the layout of our item and create a ViewHolder Instance and passing the inflated view to its constructor</li><li>The ViewHolder instance will <strong>cache </strong>and <strong>reused</strong></li></ol><p>4. When RV adapter need to bind data to a View in function <strong>onBindViewHolder, </strong>using RecyclerView recycling mechanism<strong> </strong>the ViewHolder will check if a ViewHolder already exists for that position. if the ViewHolder exists it will retrives view from the recycled pool and update the data within the referenced views, if no ViewHolder exists, a new one will created using the cached from <strong>onCreateViewHolder</strong></p><p>if we see it from our code sides it will looks like</p><ul><li>The <strong>MyViewHolder </strong>class stores references to the views in your list item layout.</li><li>In <strong>onCreateViewHolder</strong>, you inflate the layouts and create ViewHolder objects.</li><li>In <strong>onBindViewHolder</strong>, you update the data of the existing ViewHolders based on their position in the list.</li></ul><p>Finally, we understand how they works and see each part from our code. The ViewHolder patterns will gives us more efficient managing views and reducing the redudant layout inflation. By using this pattern we ensure our list application will more less laggy and memory friendly for our user.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f707de7c7c66" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Become The Android Developer that Uncle Bob Proud Of]]></title>
            <link>https://medium.com/@anggakusumo2/become-the-android-developer-that-uncle-bob-proud-of-a195b94a0f8b?source=rss-4331804c0b43------2</link>
            <guid isPermaLink="false">https://medium.com/p/a195b94a0f8b</guid>
            <category><![CDATA[clean-architecture]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[androiddev]]></category>
            <dc:creator><![CDATA[Angga.K]]></dc:creator>
            <pubDate>Mon, 03 Jun 2024 04:11:42 GMT</pubDate>
            <atom:updated>2024-06-03T04:11:42.483Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Become the Android Developer That Uncle Bob Would Be Proud Of</strong></h3><h4><strong>Do We Already Make Uncle Bob Proud? Let’s Find Out!</strong></h4><p>In this modern era of software development, we are challenged with implementing specific code patterns across various tech stacks. These patterns offer numerous benefits and provide a solid structure for teamwork. However, is simply implementing patterns enough to make our code better?</p><p>For me, the answer is both yes and no. As an Android developer, you might already be familiar with patterns like MVP, MVC, and even MVVM. Each of these patterns has its own advantages when used in the appropriate project.</p><p><strong>Here’s a breakdown of the patterns:</strong></p><ul><li><strong>MVC (Model-View-Controller):</strong> This pattern consists of a Model, View, and Controller. While functional, it can be difficult to test. It’s suitable for smaller projects.</li><li><strong>MVP (Model-View-Presenter):</strong> This pattern also includes a Model, View, and Presenter. The presenter acts as an intermediary between the View and Model. It prepares data for the View, handles user interactions, and updates the Model as needed. This pattern is easier to test than MVC.</li><li><strong>MVVM (Model-View-ViewModel):</strong> Google itself has declared this pattern as the primary pattern for Android development. While more complex to code compared to MVC or MVP, this pattern is often preferred due to its benefits.</li></ul><p>After learning about these patterns, many developers utilize them in conjunction with a concept called <strong>Clean Architecture</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*q8cmJtBO5U8dZeV0XmhVHA.jpeg" /><figcaption>Our Uncle Bob ( <strong>Robert C. Martin </strong>)</figcaption></figure><p>Clean Architecture, founded by Robert C. Martin (Uncle Bob), promotes a layered architecture that makes our code more robust, readable, maintainable, and well-separated in terms of concerns. While this article won’t delve into the definition or implementation of this concept, I want to share an example of how to implement an MVVM project structure with Clean Architecture.</p><p><strong>My Personal Project Structure Approach</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*fHjMYkrmCT_EIPXEWiILHQ.png" /><figcaption>My Personal Way too Make Project Structure</figcaption></figure><p>Let’s delve into why I organize my project structure in the following way :</p><ol><li>Data : This package represents the data layer of the Clean Architecture concept. Here, we will organize all files related to data in a single location. We can further separate data usage within sub-packages, such as “local” for local data or “remote” for remote data.</li><li>DI : This package will house all files related to Dependency Injection. Typically, this package won’t have any sub-packages.</li><li>Domain : This layer will contain your repository interfaces / abstraction and models directly related to your view.</li><li>Presentation : This package will contain all of your UI classes. In this example, I only have one screen. For projects with multiple screens, this package can have sub-packages named after the screens, such as “beer_list” or “beer_detail.”</li></ol><p>As you can see, each package clearly describes its purpose, promoting better understanding and easier file navigation.</p><p><strong>Challenges and Considerations :</strong></p><p>Now, a question arises: Can we still use this structure when dealing with larger projects? The answer is yes, but there might be more suitable structures for such projects. You can watch <a href="https://www.youtube.com/@PhilippLackner">Philipp Lackner</a> for further <a href="https://www.youtube.com/watch?v=ek682t-z2gQ">insights</a></p><p><strong>Conclusion :</strong></p><p>While all the project structures mentioned above are valuable, the best approach ultimately lies in experimentation and finding the structure that works best for your specific project. When working in a team, communication and collaboration with your teammates are crucial to determine the most effective approach.</p><p>I believe that implementing MVVM, Clean Architecture, and a well-defined project structure with your team can earn you the praise of “Good work, my niece and nephew,” from Uncle Bob himself.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a195b94a0f8b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>