<?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 Vishnu Satis on Medium]]></title>
        <description><![CDATA[Stories by Vishnu Satis on Medium]]></description>
        <link>https://medium.com/@satis.vishnu?source=rss-667973da6af3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*MFxpVDC-iBEwnrzl.</url>
            <title>Stories by Vishnu Satis on Medium</title>
            <link>https://medium.com/@satis.vishnu?source=rss-667973da6af3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 17:10:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@satis.vishnu/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[Kotlin Multiplatform Library 101]]></title>
            <link>https://medium.com/@satis.vishnu/kotlin-multiplatform-library-101-a34e906f58c?source=rss-667973da6af3------2</link>
            <guid isPermaLink="false">https://medium.com/p/a34e906f58c</guid>
            <category><![CDATA[kotlin-multiplatform]]></category>
            <category><![CDATA[kotlin-beginners]]></category>
            <dc:creator><![CDATA[Vishnu Satis]]></dc:creator>
            <pubDate>Wed, 10 Jun 2020 06:31:39 GMT</pubDate>
            <atom:updated>2020-06-10T06:31:39.503Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zXX8o8hZLmmS_AHYIff3Wg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@louis993546?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Louis Tsai</a> on <a href="https://unsplash.com/s/photos/kotlin?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h4>Kotlin multi-platform has been gaining popularity as a framework for developing common libraries for iOS, Android, Js, and other platforms. In this article, I will try to get you started on the basics of developing a Kotlin multiplatform library.</h4><h3>Scope of this story</h3><p>This story will only provide you the ability to create a multi-platform library (not an app), which can be used to:</p><ol><li>Add as a dependency to another multi-platform project</li><li>Build into a framework and use as a dependency in android or iOS</li></ol><p>I will not be talking about Js platform in this story, as I developed my library for iOS and JVM (which can essentially run in Android), but it is pretty straightforward once you go through this story.</p><blockquote>The reason I decided to create this is because it took lot of research for me to develop my first multi-platform library, hope this article makes it easy for you.</blockquote><h3><strong>Structuring of this story</strong></h3><p>I have also divided this article into logical sub-sections</p><ol><li>Setting up the project and <em>gradle.build</em></li><li>Writing multi-platform code</li><li>Understanding the build outputs and publishing to bintray.</li></ol><blockquote>Hope you enjoy, here I start !!</blockquote><h3>Project Structure</h3><p>The easiest way to start creating a project structure is to use an IDE generated project structure. Intellij has an awesome Kotlin multi-platform plugin, which can help create one. Here you go with my project structure:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/327/1*1rmTk0SV2n54bsBxqCRg5g.png" /></figure><p>You can tweak the project structure in the way you want. You just have to change the sourceSet accordingly in your <em>gradle.build</em></p><h3>Build.gradle</h3><p>Here is my build.gradle</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/62c457bd9d1e012ac399c6a40a937a44/href">https://medium.com/media/62c457bd9d1e012ac399c6a40a937a44/href</a></iframe><p>Let me explain:</p><ul><li>You can see the multi-platform plugin and other useful plugins added.</li><li>First, we defined all the native binaries that we want to build. In this project, we are just building from iOS and JVM(for android)(You can create other such native targets, <a href="https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#supported-platforms">refer here</a>.)</li><li>Next, we define sourceSets. The sourceSets define the different source code that will be built for different targets defined in the above step.</li><li>As you see can create the sourceSets for different architectures using dependsOn, if the source codes are the same</li></ul><p>Now you have a fine project to work with.</p><h3>Coding</h3><p>Now you can write your code. All your common logic which is platform-independent can go inside the common module. The platform-dependent stuff can be written as expect functions or classes and implemented as actuals in the platform. I have added a simple example below which implements date formatting in platforms.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ae284dc3d779fde7eca20650063c50ac/href">https://medium.com/media/ae284dc3d779fde7eca20650063c50ac/href</a></iframe><p>To know more, refer <a href="https://kotlinlang.org/docs/reference/platform-specific-declarations.html">here</a>. Once you are done, build the code and get your jars generated</p><h3>Building</h3><p>Now you can <em>./gradlew build</em> the project and it will generate the binaries. You have to run the <em>publishToMavenLocal</em> to see all the binaries generated. Here are the binaries that should get generated</p><ul><li>projectName-android-0.0.1-sources.jar</li><li>projectName-iosx64–0.0.1-sources.jar</li><li>projectName-android-0.0.1.jar</li><li>projectName-metadata-0.0.1-sources.jar</li><li>projectName-iosarm32–0.0.1-sources.jar</li><li>projectName-metadata-0.0.1.jar</li><li>projectName-iosarm64–0.0.1-sources.jar</li></ul><p>As you see there are jars generated for each architecture that can be used in another multiplatform project under corresponding architectures.</p><h3><strong>Publishing</strong></h3><p>Here you have a sample for bintray publish setting.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e7815d01c010d968af0658bc0bc39f35/href">https://medium.com/media/e7815d01c010d968af0658bc0bc39f35/href</a></iframe><p>Once you have these added to<em> build.gradle</em> run <em>bintrayPublish</em></p><h3>Concluding Notes</h3><p>Kotlin multi-platform is quite awesome for writing common logic which you would like to run across different platforms. Though this is a great advantage, these are some of the problems I faced while developing my library.</p><ul><li>Lack of community support as there are only a few issues raised in stack overflow and fewer developers who can answer your questions.</li><li>There was a minor hiccup when I tried to run the framework file from one of my multi-platform projects in iOS extension.</li><li>One of the major short-coming I noticed is lack of date support in the common module, so you have to implement platform-specific date or use some other multi-platform date lib.</li></ul><p>You can find the Kyuga multi-platform project <a href="https://github.com/messai-engineering/Kyuga">here</a>. This is a multi-platform version of the date parsing library <a href="https://github.com/messai-engineering/Yuga">Yuga</a>. It’s a simple library that can return the platform Date object by parsing any date string. Do check it out !!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a34e906f58c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beginners tool guide to developing an Android SDK]]></title>
            <link>https://medium.com/@satis.vishnu/beginners-tool-guide-to-developing-an-android-sdk-eb34320c7ba8?source=rss-667973da6af3------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb34320c7ba8</guid>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[android-sdk]]></category>
            <category><![CDATA[sdk]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Vishnu Satis]]></dc:creator>
            <pubDate>Tue, 16 Apr 2019 13:03:42 GMT</pubDate>
            <atom:updated>2019-04-16T13:03:42.312Z</atom:updated>
            <content:encoded><![CDATA[<h4>SDKs, in general, has become a common way of abstracting your code and delivering your service to customers/third-parties. Here I will share with you a couple of handy tools and libraries that will help you build and publish such an Android SDK.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cbX-hBGwo45AOcg_N6P7WQ.jpeg" /></figure><p>Most of the things I am about to say here are based on my experiences. I have been building SDKs for the last 2 years and I have managed to make my life easy with some of these decisions and tools that I used.</p><p>Let’s start with the database layer, here we had a couple of good options and finally ended up with a short list of <a href="https://realm.io/">Realm</a> and <a href="https://developer.android.com/topic/libraries/architecture/room">Android Room</a>. Both of these are really good options but we choose Android Room over Realm as we thought not all clients would want a third-party database in their app. This was the sole reason for choosing Android Room as we knew Realm was far superior. Make your choice wisely and depending on your use cases.</p><p>Network libraries are abundantly available for Android. We had no doubt about choosing <a href="https://square.github.io/retrofit/">Retrofit</a> as all our backend APIs were REST Web Services.</p><blockquote>Use Retrofit if you are communicating with a Web service. Use the peer library Picasso if you are downloading images. Use OkHTTP if you need to do HTTP operations that lie outside of Retrofit/Picasso.</blockquote><h3>Development &amp; Distribution</h3><p>We tried to abstract and decouple our code as far as possible. It was very important for us as most of this code was later to be reused at the server. By the end of our development cycle, we had 3 different jars and the SDK aar had a dependency on these jars. These same jars could then be reused at the server making us happy !!</p><h4>Building an AAR</h4><p>Though this is very much a trivial thing to do, we had a lot of issues building a jar with dependent libraries. So let me just point of a couple of possible hurdles that you to circumvent when building such an AAR.</p><p>We did not have any binary hosting repositories (like nexus or artifactory) when we started building the jar for the first time. We use to put in all our jars into the libs folder and add them as jar dependency through build.gradle into our SDK module thus building a fat aar. We were able to build the jar in this way but the jar the problem was the build process was removing all the resource files from all the jars (Apparently this is expected behavior). So we had to move all these files to the Android layer and interface them in. Just in case if you are facing the same issue beware of this.</p><h4>Distributing an AAR</h4><p>Another issue with building such an aar was to provide external dependencies. If you are building a fat aar you will end up writing all the external dependencies along with the aar in your client code. This is a bad experience, so we decided to set up an <a href="https://jfrog.com/artifactory/">Artifactory</a> Server. With artifactory in place, we were able to build and distribute at ease.</p><h3>Tracking &amp; Telemetry</h3><p>The last component in SDK development is to have a telemetry framework in place. The easiest solution is to go and integrate with <a href="https://get.fabric.io/">fabric</a>. This is still the most recommended solution, but as we were developing an enterprise SDK, we needed an open source on-premise solution. With some research, we found <a href="https://sentry.io/">Sentry</a>, which helped us achieve our goal. It was easy to integrate and was reliable to report telemetric events.</p><p>This is a beginners guide to Android SDK development and is intended towards anyone looking for a quick ramp-up on SDKs.</p><p>Hope this helps !!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb34320c7ba8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How fin-tech should evolve to respect data privacy]]></title>
            <link>https://medium.com/@satis.vishnu/how-fin-tech-should-evolve-to-respect-data-privacy-ee0c617e576e?source=rss-667973da6af3------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee0c617e576e</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[privacy]]></category>
            <category><![CDATA[fintech]]></category>
            <category><![CDATA[credit-score]]></category>
            <category><![CDATA[loans]]></category>
            <dc:creator><![CDATA[Vishnu Satis]]></dc:creator>
            <pubDate>Sat, 14 Jul 2018 12:39:34 GMT</pubDate>
            <atom:updated>2019-03-25T09:59:11.428Z</atom:updated>
            <content:encoded><![CDATA[<h4>Solving data privacy in alternate data analytics through an offline distributed machine learning architecture.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lay8Epek--jRLsvEspinkQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/V4mNfkDmiX4?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">arvin febry</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><blockquote>“Arguing that you don’t care about the right to privacy because you have nothing to hide is no different than saying you don’t care about free speech because you have nothing to say.”</blockquote><blockquote>- Edward Snowden</blockquote><p>My journey with machine learning(ML) started 5 years back when I first heard of a brain-inspired learning algorithm, the perceptron-based neural networks. Fascinated by this amazing technology which could learn on its own and perform human-like tasks, I started to build my own ML PaaS platform. The objective of the platform was for users to create machine learning apps with ease and enable them to use it on the fly. In a span of 3 months,I integrated popular regression algorithms, different types of neural networks, data classifiers &amp; more as part of the platform. The end result, a platform which enabled hundreds of users to create ML apps and use just REST APIs to train and make predictions for their apps.</p><p>I joined my friends at <a href="https://messai.in/"><strong>Mho &amp; MessAI</strong></a> who were building a mobile-first Alternate Data Engine.</p><p><a href="https://messai.in/">MessAI - The Power of AI on Alternate Data Sources</a></p><p>At the time, we required a similar ML platform which could support real-time decision making. Even though machine learning was the last piece of our text-to-decision puzzle, it’s “prodigal” nature brought along problems of its own. The costs incurred were always high, from data pre-processing, training the algorithm, to obtaining the predictions/results. The lack of infrastructure at client side had always restricted ML algorithms to be run on the server side. The problem we wanted to address was the ability for businesses to make decisions based on customer data available on their devices at an affordable price but while respecting user privacy. Therefore, we came up with two flavours for addressing the issue.</p><h4><strong>An online decision-making server</strong></h4><p>MessAI was integrated with my ML PaaS platform, enabling clients to use REST API calls to send normalised vectors(devoid of any personally identifiable information) created from the customer metadata from our proprietary <a href="https://dashboard.messai.in/demo"><strong>MessAI Parser</strong></a>. The trained ML model(business-specific model) on the server returns the output as a REST response based on which enterprises could make multiple customers targeted decisions on-the-go. This approach ensured that no personally identifiable information of the customers was compromised. With this solution, we had overcome a hurdle of customer data privacy but, was it good enough? How much would our server costs amount to? How much time will the decision-making take? With a data processing and aggregation task running before the decision making, is making a network call to get the decision the best possible solution? We are in one of the most competitive niches of the fin-tech market and both server-cost and time was a major concern.</p><blockquote>Thus, we faced our next hurdle — finishing data processing, business logic/signal creation and decision making in under 30 seconds and with minimal load on the server. Overcoming this paved the way for our next solution.</blockquote><p><strong>Offline decision making at the client</strong></p><p>To facilitate this change, we decided to integrate <a href="https://www.tensorflow.org/">Google’s TensorFlow </a>into our machine learning PaaS platform. We hoped that with this approach we could make decisions within the client devices and thus bringing down the decision-making time to less than 30s. If all things went as expected, we would be able to able to conquer offline decision making, reduce server costs, adhere to data privacy and remove network latency, all in one go. But as you all know, ideation &amp; design is just the first step to solving any problem. It took us days for us to create a proof of concept(POC) for this approach.</p><p>We set out on building a decision model which predicts loan eligibility for a user against different factors like revolving credit balances, average account balance, annual income, etc. Fortunately, we were able to get our hands on an open-source data set that had most of the metrics we were looking for.</p><p>The major challenge was to choose the right algorithm for the current data set. As we were trying to solve a classification problem between loan approvals and rejections we decided to go with artificial neural networks(ANN). We chose ANN so that we could scale our platform to cater to more complex scenarios in customer environments. We started training the ANN with the data we had and everything was going well. The training loss started from around ~0.3 and came down to as low as ~0.06, thus giving an accuracy of nearly ~94%. When we checked TensorBoard, graphs were showing a steady decrease in training and cross-validation errors.</p><blockquote>When we finally tested the model with real world scenarios, everything went for a toss.</blockquote><p>The results were always giving very high probability values for loan eligibility. When we tried varying different features, the probability was changing but at very low rates (~0.00002), with very high probability for loan getting approved(always above ~97%). Looking at the training stats from TensorBoard we were sure that there was nothing wrong with the training process. It had to be something wrong with the dataset and so we started digging deep into it. Once we started looking we found that the data set was highly skewed, with 270,000 out of 300,000 records having fully approved loan eligibility. This was causing the ANN to overfit and we had to find a way to further normalise this dataset before using it for training the model. Doing lot of research on imbalanced classification problems took us to <a href="https://jair.org/index.php/jair/article/view/10302">Synthetic Minority Over-sampling Technique</a> (or commonly known as SMOTE). By performing SMOTE over our data we created a non-skewed dataset to train the model.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3a960aea215f9f7e06dd106a14614c2e/href">https://medium.com/media/3a960aea215f9f7e06dd106a14614c2e/href</a></iframe><p>So with all this effort, we were able to create a model which was giving promising results. The model was showing patterns that we were hoping for, the probability of loan approval was responding well to changes in the individual features. Now we had to convert the model into a frozen model file(.pb file) so that we could port the same on to Android. Finding the right documentation for the same was strenuous, and we ended up spending hours scrambling through numerous GitHub bugs and StackOverflow answers to find the right APIs to freeze the graph. Once frozen, we placed the .pb file in our B2B Android demo app (<a href="https://play.google.com/store/apps/details?id=com.messagenie.msgenielearn">Meteor</a>) to test our scenarios.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/768ef977d0cd9a9497b15d91b2292c80/href">https://medium.com/media/768ef977d0cd9a9497b15d91b2292c80/href</a></iframe><blockquote><strong>At this point, we thought that we cracked it.</strong></blockquote><p>Unfortunately, our first round of end-to-end testing gave unexpected results. The model that we had trained gave different output probabilities when running on Android. We quickly came to the conclusion that there was something wrong with our code for freezing the model. After a lot of research and finally being able to load the frozen model into TensorBoard it was obvious that there were a lot of missing layers in the model. On loading the frozen model into python and predicting the outputs, the results remained the same as that in android. This meant that the code we were using to freeze the model was altering it as well. We had to continue our research to find the right method to freeze the model. Finally, we figured out a workaround to freeze TensorFlow models and this gave us a frozen file which was giving right results when tested in python as well. We tried the same in android and it finally worked!</p><p><a href="https://dashboard.messai.in/demo">Demo | MessAI</a></p><p>Although the whole process was cumbersome and stressful, it was definitely worth it. We were able to create a demo app which could take your SMS inbox as input and our <a href="https://messai.in/"><strong>MessAI SDK</strong></a><strong> </strong>could <strong>predict your loan eligibility completely offline</strong>. This was a breakthrough for us and the fin-tech industry, with enterprises now being able to make business decisions over customer data without compromising data privacy. Adding to this was the reduced pricing through lowered server costs. Most of the current solutions in the market upload their customer data to servers and run analytics on the cloud, thus compromising data privacy and incurring hefty server costs.</p><p>This was how 4 passionate tech folks from NIT Calicut, enabled machine learning to overcome the lack of data privacy in Alternate Data in India, <strong>thus paving the way to a new perspective towards customer targeting and instant decision making</strong>.</p><p><a href="https://github.com/messaiengineering">MessAI Engineering</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee0c617e576e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>