<?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 Nikhilesh Patve on Medium]]></title>
        <description><![CDATA[Stories by Nikhilesh Patve on Medium]]></description>
        <link>https://medium.com/@nikhilesh.patve?source=rss-e7ebc41c84ec------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*QjQbHxIR5IwAk3XQ.</url>
            <title>Stories by Nikhilesh Patve on Medium</title>
            <link>https://medium.com/@nikhilesh.patve?source=rss-e7ebc41c84ec------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 19:41:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nikhilesh.patve/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 — Now deeper insights into your logcat]]></title>
            <link>https://medium.com/@nikhilesh.patve/android-now-deeper-insights-into-your-logcat-136b14038fd6?source=rss-e7ebc41c84ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/136b14038fd6</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[logcat]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[analysis]]></category>
            <dc:creator><![CDATA[Nikhilesh Patve]]></dc:creator>
            <pubDate>Fri, 29 Jul 2022 04:28:59 GMT</pubDate>
            <atom:updated>2022-07-29T05:49:09.197Z</atom:updated>
            <content:encoded><![CDATA[<h3>Android — Now deeper insights into your logcat</h3><p>Hey guys every app goes through a lifecycle that first features in the app are being brainstormed the best fit architectures for the app are decided if everything seems perfect finally developer blows life to a new being called the app, once it is tested then the app is rolled out to playstore, yes these are the steps which are commonly being followed.</p><p>But,</p><p>There are always <strong>two sides to the story</strong>, not always but sometimes along with the features <strong>some critical bugs also get shipped with the app</strong> due to some miss, now the ball comes to the developer&#39;s court to fix this asap and yes here the developer wants the <strong>response time should be so quick</strong> to fix the bug and release a build for the users, this is <strong>very critical time</strong>.</p><blockquote>Now I think a good developer is one who becomes <strong>DVM(Dalvik VM)</strong> and starts executing the app&#39;s flow internally in his brain to find out the issue cause.</blockquote><p>Sometimes we are lucky and sometimes we are not, then we predict some of the steps and execute them to reproduce the issue, <strong>some issues are very complicated and consume a lot of developer time</strong>.</p><p>Why?</p><p>Because there can be various <strong>factors involved </strong>that can affect the app and can cause a bug like</p><ul><li>Multithreading</li><li>Concurrency</li><li>Device Compatibility</li><li>Network Speed</li><li>System Time, etc</li></ul><p>Here the general tendency of an app developer is to reproduce the issue and check the logs for the analysis.</p><p>Now this is how our logs look like….</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*48X6m_qhjldaZAJNHvPzuA.png" /></figure><blockquote>Yes we can import this logs in android studio for analysis but follow me even i have much better way for logs analysis</blockquote><p>We already have very critical time to fix this asap and here <strong>there are very big chances for the developer to miss the imp info which might be present in the log</strong>, but due to</p><ul><li><strong>Unfriendly nature of logs</strong></li><li><strong>Logs getting disappear</strong> in logcat (Due to new logs has come up) in Android Studio</li></ul><p><strong>Can we do better? || How do I debug such issues?</strong></p><p>Motivation from here, I have made<strong> this tool to convert the logcat extracted dump to CSV form to get a much deeper analysis</strong> of the logs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YFp62ggfxOOVqXaOWHLmXg.png" /></figure><p>What we have to do is just download the logcat dump with the help of the below command</p><blockquote>&gt;<strong>adb logcat -d &gt; logcat.log</strong></blockquote><p>Once the dump is extracted put the system path of dump in the tool, the tool will generate the CSV file and place it in the same location.</p><p>Now open the CSV file I have created the CSV file with <strong>custom separator</strong> <strong>^ </strong>open CSV by separating with this custom separator.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qXFRlagvglTZfpW5Vowx3A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3dajbwSqn4ldUC1qbNj31w.png" /></figure><p>Let&#39;s say I just wanted to focus on <strong>zygote64</strong> information of the <strong>kill keyword. Press CMD+A to select all rows &amp; columns.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k4oQmaSZ746YTYZJi9OBIA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I9C9hBRetH_e_ijSksXgDw.png" /></figure><p>Once you apply the conditional highlight rule rows will be automatically updated with the color you have selected based on the added condition.</p><p><strong>Condition 1:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7ZoGftXsTdAonXxxELWnWg.png" /></figure><p>Now with the help of <strong>filtering and conditional row highlighting</strong> of the <strong>Numbers app</strong> on mac, I am able to get much deeper insights into logs as pie charts and graphs represent data in a much more attractive way, this coloring highlights information to get much deeper insights.</p><p>You can also <strong>choose multiple other colors</strong> for your different use-case/<strong>conditions</strong> as below.</p><p><strong>Condition 2 :</strong></p><p>Now along with the kill information I also want to focus on the intent of <strong>handleMessage </strong>then I can add like,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X9_4J1awgvdNyiAMSbpgbw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VTDRBRL4VgTYqHBHa1gN2Q.png" /></figure><p>Thats it.</p><p><a href="https://drive.google.com/file/d/1HOxFg5IW7TVpbncXrG-ccItIshB5NwGa/view?usp=sharing">Download the tool from here — Link</a></p><p><strong>Run&gt;</strong>java -jar LogcatToCSVConverter.jar</p><p><strong>Your Approach?</strong></p><p>Any thoughts on how you debug such scenarios or any inputs to make this more interesting are more welcomed in the comments.</p><p><strong>Future Scope:</strong> I am thinking of how can make this more representable with the help of graphs and all, as in <strong>debug build</strong> analytics logs(Screen View) also get logged to logcat, we can create a nice graph from that. Instead of QA providing steps to reproduce any bug manually in jira tickets, such steps can be directly extracted from these logs will reduce the QA efforts in logging such issues.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=136b14038fd6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[No more recyclerview custom adapters management now]]></title>
            <link>https://medium.com/@nikhilesh.patve/no-more-recyclerview-custom-adapters-management-now-91e94f4856b2?source=rss-e7ebc41c84ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/91e94f4856b2</guid>
            <category><![CDATA[adapter-recyclerview]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[recyclerview]]></category>
            <dc:creator><![CDATA[Nikhilesh Patve]]></dc:creator>
            <pubDate>Fri, 01 Jul 2022 03:43:03 GMT</pubDate>
            <atom:updated>2022-08-01T10:00:36.337Z</atom:updated>
            <content:encoded><![CDATA[<p>There should not be any android developer on this earth now who doesn&#39;t know what recyclerview is and how much benefits recyclerview has given us for creating and rendering different kinds of list items(view types).</p><p>But as our project size grows our number of screen count increases and we start creating custom adapters as per our screen requirement, the list of custom adapter class goes on increasing, and so on...</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*azwFFnJlERcCkH7f34mCdg.jpeg" /></figure><p>Now let us take a step to evaluate this problem and list down requirements why do we really extend the recyclerview adapter class most of the time.</p><ol><li>To create a view (onCreateViewHolder)</li><li>To bind data in view (onBindViewHolder)</li><li>To create variety of different views (getItemViewType)</li><li>To add click listeners on components of <strong>item view </strong>or <strong>an item</strong></li></ol><p>Will you believe if I say in our project we have <strong>62 different kinds of screens</strong> and each screen shows a <strong>variety of different viewTypes</strong> with <strong>different states</strong> in them and we literally have <strong>only 1 generic recyclerview adapter class </strong>handling those all those cases with <strong>no extra adapter class code management.</strong></p><p>Yes, it&#39;s true…..</p><p><strong>How?</strong></p><p>Simple with the use of delegation, we have actually <strong>delegated the responsibility of presenting</strong> the item to a different class called <strong>AdapterRowPresenterManager</strong> as pointed out in the below screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oz7nOnuywcq07oCSEGWSVA.png" /></figure><p><strong>How AdapterRowPresenterManager work?</strong></p><p>The responsibility of this recycler view row presenter manager is to simply <strong>hold a list of different item presenters or view types </strong>(which the developer initialize while initializing the recycler view adapter) and <strong>send callee appropriate presenter</strong> based on the requested parameters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Hij9VvT087c21dpG_oDlw.png" /></figure><p>Before we go on understanding how <strong>AdapterRowPresenter </strong>works lets first see how to set up the recyclerview this will help us in understating how things are getting worked internally in <strong>AdapterRowPresenter</strong></p><p><strong>How do we set up recyclerview now?</strong></p><ol><li>Create an instance of predefined adapter class <strong>by passing an instance of presenter manager</strong> to <strong>ItemizedPagedNonPagedRecyclerAdapter</strong></li><li>Add different types of presenters you want to present, to the presenter manager by using the <strong>addViewPresenter </strong>method,<strong> </strong>in this step you will have to specify 2 things <strong>one is the condition</strong> on which this item has to be presented and the <strong>second is layout to be used (</strong>Check item 1 and item 2 added to presenter manager)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hvHnMIkbPFSUlG60MIm53w.png" /></figure><p><strong>How to submit items to recyclerview adapter?</strong></p><p>Very simple and clean just create different view objects and submit to recyclerview adapter</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*roxfMufDVnKNZB6a6UG2ng.png" /></figure><p><strong>How AdapterRowPresenter work?</strong></p><p><strong>ItemPresenter</strong> you saw at the time of initialization of recyclerview is just a wrapper over <strong>AdapterRowPresenter </strong>to simplify the things to just accept just 2 inputs from developer ie <strong>condition </strong>and <strong>layout </strong>to which <strong>AdapterRowPresenterManager </strong>can utilize to identify correct presenter to create UI and bind data to views by utilizing the data binding feature of android.</p><p>With the use of this implementation, we literally can create UI ranging from <strong>very simple to very very complex UI’s</strong> and this <strong>saves us from code management of adapter class </strong>and <strong>code simplification </strong>as</p><ol><li>Every UI is now generated from View Object (ex- <strong>CardProductVo</strong>)</li><li>Conditional logic to decide <strong>viewType</strong> is now only specific to <strong>ItemPresenter </strong>class</li><li>Which layouts to be presented is now bounded up to <strong>ItemPresenter </strong>class</li></ol><pre>Cannot share the exact implementation designed in company due to company policy but tried to replicated the same concept in my this small project</pre><p>Please checkout — <a href="https://github.com/MeNiks/GithubSamplePaging3/blob/main/app/src/main/java/com/niks/githubapp/ui/pr/PullRequestListActivity.kt#L70">Sample Github Repo</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91e94f4856b2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Espresso UI testing made easy with kotlin extensions]]></title>
            <link>https://medium.com/@nikhilesh.patve/espresso-ui-testing-made-easy-with-kotlin-extensions-5b782d44906?source=rss-e7ebc41c84ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b782d44906</guid>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[instrumentation]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[espresso]]></category>
            <dc:creator><![CDATA[Nikhilesh Patve]]></dc:creator>
            <pubDate>Sat, 19 Feb 2022 05:02:31 GMT</pubDate>
            <atom:updated>2022-02-19T05:02:31.356Z</atom:updated>
            <content:encoded><![CDATA[<p>There is a normal human tendency that a person can manage stuff only limited to a certain manageable limit and once our project grows beyond a certain size generally companies adopt automation frameworks to put off their manual testing QA burden.</p><p>And for us(android developers) our 1st and foremost choice is the Espresso test framework. I personally have found <strong>espresso test case writing to be more complex</strong> as we have to <strong>remember a lot of classes</strong> to verify the text, visibility, color, etc things, even our <strong>code becomes more unfriendly to be readable</strong>. Let&#39;s have a look at the below screenshot.</p><p><strong>*Current Way</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hNNijMqXAjVz_nDPHTMxgQ.png" /></figure><p>Thanks to kotlin that with the use of its very simple construct called kotlin extensions, <strong>I have created a very very helpful set of extension functions</strong> that <strong>take off this overhead</strong> so that we can now more focus on covering more use cases &amp; flows to make our app more healthy. Have a look at how I have drilled the same previous stuff to its new look.</p><p><strong>*With Extensions</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*obcM60YUS-0yssDL8FcCiw.png" /></figure><p><strong>*Now code faster with Autosuggestion</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ShlgXCBcLxnYzEMje8rBYw.png" /></figure><p>Compared to how we were writing the test cases earlier now we are <strong>getting the below benefits</strong></p><ol><li>Short &amp; Simple test cases</li><li>Improved readability</li><li>Smart auto suggestions (As extensions are on <strong>ViewInteraction</strong> Class)</li><li>Dev can now focus more on covering flows and increasing your test cases count</li></ol><p>Simply use the below gist</p><p><strong>UI Testing Extensions</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f227dfeeafb2ec64b74949e789fb6956/href">https://medium.com/media/f227dfeeafb2ec64b74949e789fb6956/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b782d44906" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>