<?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 Nikhil Chaudhari on Medium]]></title>
        <description><![CDATA[Stories by Nikhil Chaudhari on Medium]]></description>
        <link>https://medium.com/@mrcurious?source=rss-fa132b10dd5d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*qszfGBpdfG4iteyaNB4Vaw.png</url>
            <title>Stories by Nikhil Chaudhari on Medium</title>
            <link>https://medium.com/@mrcurious?source=rss-fa132b10dd5d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 08:16:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mrcurious/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[How Indian Classical Music Is Written: A Guide to Sargam Notation]]></title>
            <link>https://mrcurious.medium.com/how-indian-classical-music-is-written-a-guide-to-sargam-notation-65a062b2c019?source=rss-fa132b10dd5d------2</link>
            <guid isPermaLink="false">https://medium.com/p/65a062b2c019</guid>
            <category><![CDATA[classical-music]]></category>
            <category><![CDATA[carnatic-music]]></category>
            <category><![CDATA[music]]></category>
            <category><![CDATA[music-notation]]></category>
            <category><![CDATA[indian-classical-music]]></category>
            <dc:creator><![CDATA[Nikhil Chaudhari]]></dc:creator>
            <pubDate>Sun, 02 Aug 2026 06:54:03 GMT</pubDate>
            <atom:updated>2026-08-02T07:10:20.710Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q1L6SuemBXLtGUzUIJ0Hvw.png" /></figure><p>Music is often called a universal language. Yet every musical tradition develops its own way of describing melody, rhythm, movement, and expression. Western musicians may read notes from a five-line staff. A student of Hindustani classical music is more likely to begin with another vocabulary: <strong>Sa, Re, Ga, Ma, Pa, Dha, Ni</strong>.</p><p>These seven syllables are more than Indian names for notes. They form a relative musical language called <strong>Sargam</strong>, which describes notes around the tonic and communicates a composition. When that musical language is written down, one of the most widely used systems is <strong>Bhatkhande lipi</strong>, the notation method associated with Pandit Vishnu Narayan Bhatkhande.</p><p>This guide explains how the two ideas fit together. We will begin with the foundations of Indian classical music, compare Sargam with Western notes and movable Do-Re-Mi, learn the practical signs used in Bhatkhande notation, and finally look at what it takes to turn a handwritten notation page into a structured digital document.</p><p><em>Indian classical music has a written language of its own: swar, taal, matra, ornaments, and lyrics arranged as one musical page.</em></p><h3><strong>Understanding Indian Classical Music</strong></h3><p>“Indian music” describes a vast field of classical, devotional, folk, regional, film, and contemporary traditions. Within Indian classical music, two major traditions are commonly discussed: <strong>Hindustani classical music</strong>, associated mainly with northern India, and <strong>Carnatic music</strong>, associated mainly with southern India.</p><p>Both traditions use forms of swar and rhythmic cycles, but their terminology, repertoire, ornamentation, and notation practices are not identical. This article focuses on the Hindustani tradition and the Bhatkhande notation system used by many Hindustani musicians, teachers, students, and published music books.</p><p>Three ideas are especially useful when first approaching Hindustani music:</p><ul><li><strong>Swar</strong> is a musical note understood in relation to the tonic.</li><li><strong>Raag</strong> is a melodic framework with characteristic notes, movements, phrases, priorities, and emotional identity. It is not simply a Western scale.</li><li><strong>Taal</strong> is a repeating rhythmic cycle organized into beats and divisions.</li></ul><p>A performance brings these ideas to life through voice or instrument, ornamentation, timing, improvisation, and the musician’s training. Written notation does not replace those things. It gives the composition a readable structure: which swar appear, where they fall in the taal, how long they continue, where lyrics belong, and which important movements or ornaments should be remembered.</p><p>That distinction matters. A notation is a <strong>musical map</strong>, not the full journey.</p><p><strong>The Language of Swar: Sa Re Ga Ma Pa Dha Ni</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/409/1*HGFS4c6FLbNxosIRfXwLRA.png" /></figure><p>Together they are spoken or sung as:</p><p><strong>Sa Re Ga Ma Pa Dha Ni Sa</strong></p><p>The final Sa begins the next octave. In the same way, descending practice may be sung as:</p><p><strong>Sa Ni Dha Pa Ma Ga Re Sa</strong></p><p>For someone familiar with Western solfège, the nearest conceptual comparison is:</p><p><strong>Do Re Mi Fa Sol La Ti Do</strong></p><p>But the important word is <strong>movable</strong>. Sargam behaves more like movable Do than fixed pitch names. Sa identifies the tonic, the pitch that feels like home for the performance. A singer may choose Sa according to a comfortable vocal range. An instrumentalist may choose it according to tuning, instrument design, or the ensemble.</p><p>Two swar, <strong>Sa and Pa</strong>, remain fixed in their scale positions. Re, Ga, Dha, and Ni can appear in their natural form or a lowered <strong>Komal</strong> form. Ma can appear in its natural form or a raised <strong>Tivra</strong> form. This produces twelve practical pitch positions within the octave:</p><p><strong>Sa, Komal Re, Re, Komal Ga, Ga, Ma, Tivra Ma, Pa, Komal Dha, Dha, Komal Ni, Ni</strong></p><p>Which of these swar a musician uses, emphasizes, approaches, or avoids depends on the raag.</p><p><strong>Is Sa C#, C, or Do? Understanding the Movable Tonic</strong></p><p>One of the most common questions from pianists and Western-trained musicians is: <strong>What Western note is Sa?</strong></p><p>The answer is that Sa does not have one permanent Western pitch. Sa may be C, C#, D, or another tonic selected for the performance. It is the reference from which the other swar are understood.</p><p>If a digital keyboard is configured so that <strong>Sa = C#</strong>, the twelve Sargam positions map to its chromatic keys like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*6rmFV08escNJ3JGEXcUspw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PMeUsKUSImi4xSRUngFikg.png" /></figure><p><em>Sa is the movable tonic. This C# mapping is one keyboard example, not a permanent definition of Sa.</em></p><p>The seven Shuddha swar in this example broadly line up with movable solfège as Sa/Do, Re/Re, Ga/Mi, Ma/Fa, Pa/Sol, Dha/La, and Ni/Ti. The chromatic table also includes the Komal and Tivra positions between them.</p><p>This comparison is useful for finding keys on a piano, harmonium, MIDI controller, or software instrument. It should not be mistaken for a claim that every Hindustani performance follows equal-tempered piano tuning in every detail. Intonation, approach, oscillation, and emphasis can be shaped by the raag and the musician’s tradition. The keyboard map is a practical input reference; the musical identity still comes from how the swar are treated.</p><h3><strong>Shuddha, Komal, and Tivra: The Twelve Swar Positions</strong></h3><p>In everyday notation, the seven natural positions are called <strong>Shuddha swar</strong>. Five altered positions complete the practical chromatic set:</p><ul><li><strong>Komal Re</strong></li><li><strong>Komal Ga</strong></li><li><strong>Tivra Ma</strong></li><li><strong>Komal Dha</strong></li><li><strong>Komal Ni</strong></li></ul><p>Komal means that the swar occupies a lower pitch position than its Shuddha form. Tivra means raised; in this system, only Ma has a Tivra form. Sa and Pa do not take Komal or Tivra variants.</p><p>In Bhatkhande lipi, a Komal swar is traditionally distinguished by a mark below it, while Tivra Ma has a mark above it. The notation therefore carries two pieces of information at once: the swar name and its variant.</p><p>Octave is represented separately. A dot below a swar places it in the lower <strong>Mandra saptak</strong>. A swar without an octave dot belongs to the middle <strong>Madhya saptak</strong>. A dot above places it in the higher <strong>Taar saptak</strong>.</p><p>This compact system lets a reader distinguish lower Ni, middle Ni, and upper Ni without writing a separate word beside each note.</p><h3><strong>Why Pandit Vishnu Narayan Bhatkhande Created a Written System</strong></h3><p>Pandit <strong>Vishnu Narayan Bhatkhande (1860–1936)</strong> was a musicologist, scholar, and one of the central figures in the modern organization of Hindustani classical music education. He travelled, studied traditions and compositions, consulted musicians, and produced extensive writing on raag and musical practice.</p><p>His work emerged during a period when music education was increasingly being organized through institutions, curricula, books, and public study. A practical notation system helped compositions appear consistently on the printed page. Bhatkhande used his approach in the volumes of the <em>Hindustani Sangeet Paddhati Kramik Pustak Malika</em>, and the notation became widely used in teaching and publication.</p><p>Bhatkhande lipi is valuable because it is economical. It does not attempt to convert Hindustani music into Western staff notation. Instead, it begins with concepts musicians already use: swar, saptak, matra, vibhag, sam, khali, rhythmic grouping, and ornament.</p><p>It also respects a basic truth about Indian classical performance: a written symbol may indicate a movement, but the exact life of that movement comes from musical knowledge. The same murki or meend cannot always be reduced to one mechanical sequence. Its execution depends on the raag, phrase, instrument, voice, and artist.</p><h3><strong>How to Read Bhatkhande Lipi</strong></h3><p>A Bhatkhande notation page becomes much easier to understand when it is read in layers. First identify the swar. Then locate the octave and variant marks. After that, read the rhythmic structure underneath and the ornaments around the notes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6ihUlPa7UE54qdv-iewSNw.png" /></figure><p><em>A practical Bhatkhande lipi reference. Exact typography is rendered with the OME Bhatkhande Hindi font.</em></p><h4><strong>Swar and altered swar</strong></h4><p>The note body represents Sa, Re, Ga, Ma, Pa, Dha, or Ni. A mark below Re, Ga, Dha, or Ni identifies the Komal form. A mark above Ma identifies Tivra Ma. Sa and Pa remain unchanged.</p><p>These signs should be read as part of the note itself. Komal Ga is not an ornament added to Ga; it is a different pitch position used by the raag.</p><h4><strong>Mandra, Madhya, and Taar saptak</strong></h4><p>A dot below the swar means <strong>Mandra saptak</strong>. No octave dot means <strong>Madhya saptak</strong>. A dot above means <strong>Taar saptak</strong>.</p><p>The dot is small, but musically significant. Missing it can move a phrase by an entire octave. In handwritten notation, this is one of the details that can easily become faint or misaligned during scanning and retyping.</p><h4><strong>Taal, matra, vibhag, and avartan</strong></h4><p>A <strong>matra</strong> is a beat. A <strong>taal</strong> is a repeating rhythmic cycle made of a defined number of matras. One full repetition is an <strong>avartan</strong>. The cycle is divided into groups called <strong>vibhags</strong>.</p><p>For example, Teentaal contains 16 matras divided into four equal vibhags:</p><p><strong>4 + 4 + 4 + 4 = 16 matras</strong></p><p>Vibhag boundaries make a long notation line readable. They show where the internal sections of the cycle begin and help a musician relate the melodic phrase to the taal.</p><h4><strong>Sam, taali, and khali</strong></h4><p>The first beat of the cycle is <strong>sam</strong>, traditionally marked with <strong>x</strong>. Sam is the point where the cycle resolves and begins again. It often carries strong compositional importance.</p><p>Clapped divisions are indicated by their taali number, while an unaccented or waved division is <strong>khali</strong>, marked <strong>0</strong>. A standard Teentaal marker row is:</p><p><strong>x · 2 · 0 · 3</strong></p><p>These are vibhag markers, not note names. The x belongs to the first vibhag, 2 to the second, 0 to the khali vibhag, and 3 to the final clapped vibhag.</p><h4><strong>Sustain, empty beats, and duration</strong></h4><p>A dash after a swar means that the previous swar continues through another matra. Several dashes can extend it for several beats. A blank or rest-like position must be understood in context; it is different from sustaining the sound that came before it.</p><p>This matters in digital playback. A sustain mark should lengthen the previous note rather than trigger a new pitch.</p><h4><strong>Chhand and rhythmic grouping</strong></h4><p>Sometimes one matra contains two, three, four, or more swar. Bhatkhande notation groups those swar as <strong>chhand</strong>, allowing the reader to see that the notes belong inside one beat instead of occupying separate matras.</p><p>Two notes in one matra may be understood as dugun, three as tigun, four as chaugun, with larger groupings continuing according to the phrase. The visual grouping must stay attached to the correct notes, especially when the notation is edited or wrapped across a page.</p><h4><strong>Kan</strong></h4><p><strong>Kan swar</strong> is a grace-note touch around a principal swar. It is commonly written smaller and raised beside the main note. The kan is not assigned the same visual weight as the principal note, and its interpretation depends on the phrase.</p><h4><strong>Meend and ghaseet</strong></h4><p><strong>Meend</strong> is a continuous glide or connection from one swar to another. Its notation visually links the involved notes rather than presenting them as unrelated attacks.</p><p><strong>Ghaseet</strong> describes a dragged or pulled movement, especially relevant to instrumental technique. A notation may indicate its start, continuation, stroke, and end. Digital layout must preserve the visual continuity across every note participating in the movement.</p><h4><strong>Murki, gamak, and krintan</strong></h4><p><strong>Murki</strong> is a quick ornamental turn involving nearby swar. The written sign signals the movement while leaving room for interpretation according to the raag and style.</p><p><strong>Gamak</strong> broadly refers to an oscillated or forceful ornamental movement. It is musically important, but its full execution cannot be captured by a label alone. The student still needs a heard example and informed guidance.</p><p><strong>Krintan</strong> uses repeated grace-note action, often associated with plucked-string technique. In notation it can combine a raised kan-like note with a repetition count.</p><p>These ornaments show why Indian classical notation needs more than plain letters. Writing S R G M can record pitch order, but it cannot by itself show the movement connecting those pitches.</p><h4><strong>Lyrics beneath the swar</strong></h4><p>In vocal compositions, lyrics are written below the relevant swar or matra. Their alignment helps the reader understand which syllable belongs with which musical event.</p><p>This is easy on a ruled handwritten page and surprisingly difficult in ordinary word processors. Add one extra space or resize one word, and the lyric can drift away from its swar. A proper notation layout treats the swar cell and lyric cell as parts of the same beat.</p><h3><strong>Reading a Complete Teentaal Notation</strong></h3><p>Consider a simple 16-matra teaching line in Teentaal. It is intentionally an exercise rather than an invented bandish:</p><p><strong>Sa Re Ga Ma | Pa Dha Ni Sa’ | Sa’ Ni Dha Pa | Ma Ga Re Sa</strong></p><p>The vertical dividers separate the four vibhags. The marker row beneath them is:</p><p><strong>x | 2 | 0 | 3</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CtJp6zZQp9GGpWhWJf9ohA.png" /></figure><p><em>Read the swar and the taal together: sixteen matras, four vibhags, sam at the beginning, and khali at the ninth beat.</em></p><p>Start with the first matra under x. Count four beats to the next vibhag, marked 2. Continue through the third vibhag, marked 0 for khali, and the fourth, marked 3. The upper Sa carries a Taar-saptak mark. If two swar are grouped inside one cell, they must be performed within that matra. If a dash follows a swar, keep the previous sound alive rather than playing a new note.</p><p>This layered reading is the essence of the page: melody on top, rhythmic organization around it, and lyrics or performance information aligned with the same beat structure.</p><h3><strong>Why Handwritten Indian Notation Is Difficult to Digitize</strong></h3><p>Handwritten notation is flexible. A musician can draw a longer curve, squeeze two swar into a matra, place a kan exactly where it makes sense, extend a divider, or align a lyric by instinct. The page adapts immediately to the musical thought.</p><p>Generic text editors do not understand that structure. They see characters, spaces, and line breaks. They do not know that:</p><ul><li>every row may represent one avartan of a selected taal;</li><li>vibhag boundaries must remain aligned across notes, lyrics, and markers;</li><li>multiple swar can belong to one matra;</li><li>a dash sustains the preceding swar;</li><li>a kan is attached to a main note;</li><li>a meend is a relationship across several notes;</li><li>sam, taali, and khali belong to rhythmic positions;</li><li>an octave dot must remain attached to the correct swar.</li></ul><p>This is the real digitization problem. Indian classical musicians already have a notation language. What is missing is an easy digital writing surface that understands its grammar.</p><p>The goal is not to replace handwritten notebooks, oral teaching, gharana knowledge, or the musician’s ear. It is to make a finished notation easier to correct, preserve, print, reopen, and share without rebuilding the entire page whenever something changes.</p><h3><strong>How Sargam.pro Turns Indian Notation into an Editable Digital Page</strong></h3><p><a href="https://sargam.pro/">Sargam.pro</a> is built around that specific problem. Instead of asking musicians to force Sargam into a Western staff or align everything manually in a document editor, it begins with a taal-aware notation grid.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CfiWm54Pky1ulxaZe8uF3A.png" /></figure><p><em>Sargam.pro treats notation as structured musical data while keeping the page readable in familiar Bhatkhande typography.</em></p><p>Choose a taal and the editor creates the appropriate matras and vibhag boundaries. Select the tonic and the piano shows how Sargam maps onto Western keyboard pitches. Notes can be entered from the on-screen piano, computer keyboard, or a connected MIDI keyboard.</p><p>The writing tools understand practical notation relationships:</p><ul><li>several swar inside one beat can be written as chhand;</li><li>Mandra, Madhya, and Taar notes keep their octave identity;</li><li>Komal and Tivra variants remain semantically distinct;</li><li>kan, meend, ghaseet, murki, and krintan retain their musical relationship to the notes;</li><li>sustain symbols continue the previous swar;</li><li>lyrics stay aligned with their matras;</li><li>taal markers remain attached to the correct vibhags.</li></ul><p>The notation can also be displayed with Western pitch labels for musicians who need that bridge. Changing the viewing scale transposes the displayed pitches without rewriting the original saved composition.</p><p>For live capture, the metronome and Taal Sync can place keyboard or MIDI input against the running taal. Playback lets the musician hear the written phrase, adjust tempo, and loop it for review. These tools are there to support writing and checking; they do not pretend that software can replace musical interpretation.</p><p>Once the notation is saved, it remains editable. It can be reopened from a profile, shared through a public link, viewed as a clean notation page, exported as a PDF for printing, or exported as MIDI for another music workflow.</p><p>Most importantly, the digital document is not just an image of a page. The notes, beats, lyrics, ornaments, taal, tempo, and placement remain structured. That creates a foundation for better playback, search, teaching material, archiving, and future musical tools.</p><h3><strong>Write, Play, Save, and Share Your First Notation</strong></h3><p>Indian classical music does not need to abandon its own written language to become digital. The familiar ideas are already there: Sa as the tonic, swar shaped by raag, phrases placed inside taal, lyrics aligned to matra, and ornaments that show how one note moves toward another.</p><p>The opportunity is to give that language a writing tool designed for it.</p><p>You can open the editor at<a href="https://sargam.pro/"> <strong>sargam.pro</strong></a> and begin writing immediately. Choose a taal, set your Sa, use the piano or keyboard, and watch the notation take shape as a structured digital page.</p><p>For a guided walkthrough, read the <a href="https://sargam.pro/getting-started"><strong>Sargam getting-started guide</strong></a>.</p><p><strong>References and Further Reading</strong></p><ul><li><a href="https://omenad.github.io/fonts/ome-bhatkhande-hindi/">Omenad Fonts: OME Bhatkhande Hindi glyph and usage reference</a></li><li><a href="https://www.indianclassicalmusic.com/bhatkhande-notation-script">Indian Classical Music: Bhatkhande notation script</a></li><li><a href="https://www.bhatkhandeuniversity.ac.in/en/page/history">Bhatkhande Sanskriti Vishwavidyalaya: institutional history</a></li><li><a href="https://www.cambridge.org/core/journals/modern-asian-studies/article/flybynight-ustad-problems-of-music-education-in-north-india-18631915/0AE9C2229C9163A2CF4FE2635C4297F9">Cambridge University Press: historical study discussing Bhatkhande and music education</a></li><li><a href="https://en.wikipedia.org/wiki/Sa_Re_Ga_Ma_Pa_Dha_Ni">Sa Re Ga Ma Pa Dha Ni and its relationship to solfège</a></li></ul><p><em>OME Bhatkhande Hindi is credited to Omenad Fonts. The font is used for notation rendering; Sargam.pro does not redistribute the webfont file.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65a062b2c019" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Publishing your Android/Kotlin library to maven-central in 2021]]></title>
            <link>https://mrcurious.medium.com/publishing-your-android-kotlin-library-to-maven-central-in-2021-df263a4f2cbc?source=rss-fa132b10dd5d------2</link>
            <guid isPermaLink="false">https://medium.com/p/df263a4f2cbc</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[release-management]]></category>
            <dc:creator><![CDATA[Nikhil Chaudhari]]></dc:creator>
            <pubDate>Sun, 16 May 2021 13:04:39 GMT</pubDate>
            <atom:updated>2021-05-16T13:04:39.490Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*CyYe_l54HdnZ6cph.png" /></figure><p>There are lot of blogs available on how to publish the java/android library to maven-central but all of them are suggesting you to write pom files, include nexus-gradle plugin etc, and lot of complex stuff. But Gradle provides a way to publish your repository to maven-central out of the box. In this article, we are going to publish a library to maven central using Gradle’s provided plugins.</p><p>Artifact managers available today — Jitpack.io, Nexus Sonatype, Bintray (which is closed now but they have custom solutions available). We are going to use OSSRH Nexus Sonatype Repository Manager. This also makes the dependency integration easier to developers as gradle provides out of the box support for maven. Let’s start with preparing a release meta work.</p><h4>Step 1. Creating ticket on OSSRH</h4><ul><li>Signup on <a href="https://issues.sonatype.org/">https://issues.sonatype.org/</a></li><li>We will first create a jira ticket on OSSRH jira board to let sonatype know that we want to release a library</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e3kO0kTvvhDkJunAIEAlDg.png" /></figure><ul><li>Write a summary</li><li>Enter your group id — which can be your domain/company name</li><li>Your project URL which can be github url. Then SCM url which again can be your .git URL</li><li>If you want to add more than one contributor to your repository, you can add comma separated usernames (make sure they also have created account on OSSRH)</li><li>Keep rest of the fields as default.</li><li>After creating the ticket wait for some time to OSSRH comment on your ticket</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gt-GWdd-pBkQzAsvV_cVaQ.png" /></figure><ul><li>They ask you to verify ownership of the domain(group-id) that you’ve entered.</li><li>For this, either you can add a TXT record on your DNS or you can setup a redirect to your github page.</li><li>In my case, my domain is on <a href="https://www.godaddy.com/">Godaddy</a> so I created a TXT record in my DNS management portal.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zQKNPBiqt9_blmQ7OBSd7Q.png" /></figure><ul><li>Add comment on the ticket once done.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bILnHqS4-Sa5HXJXgwGNNg.png" /></figure><ul><li>OSSRH will add comment saying your space has been prepared you can now publish the snapshot/release artifacts on sonatype.</li><li>Please note the approval may take a few minutes.</li></ul><h4>Step 2. Generating gpg keys</h4><p>Now we’ll setup gpg encryption.</p><ul><li>Create a key-pair by running following command gpg --gen-keys</li><li>It’ll prompt you to select the key type —</li></ul><pre>gpg (GnuPG) 2.0.14; Copyright (C) 2009 Free Software Foundation, Inc.<br>  This is free software: you are free to change and redistribute it.<br>  There is NO WARRANTY, to the extent permitted by law.<br>  <br>  gpg: keyring `/N/u/username/Machine/.gnupg/secring.gpg&#39; created<br>  gpg: keyring `/N/u/username/Machine/.gnupg/pubring.gpg&#39; created<br>  Please select what kind of key you want:<br>     (1) RSA and RSA (default)<br>     (2) DSA and Elgamal<br>     (3) DSA (sign only)<br>     (4) RSA (sign only)<br>  Your selection?</pre><p>Enter 1 to select the default key.</p><ul><li>GPG will prompt you to choose a keysize (in bits). Enter 2048.</li><li>You will see: Enter 0for no expiration</li></ul><pre>Requested keysize is 1024 bits<br>  Please specify how long the key should be valid.<br>           0 = key does not expire<br>        &lt;n&gt;  = key expires in n days<br>        &lt;n&gt;w = key expires in n weeks<br>        &lt;n&gt;m = key expires in n months<br>        &lt;n&gt;y = key expires in n years<br>  Key is valid for? (0)</pre><ul><li>GPG will prompt for information it will use to construct a user ID to identify your key. It’s pretty straight forward just enter your name, email address, and a comment. Enter all information and then it’ll ask you for confirmation- hit O if you are okay with changes.</li></ul><pre>You selected this USER-ID:<br>      &quot;Full Name (comment) &lt;username@&lt;domain&gt;.&lt;something&gt;&gt;&quot;<br><br>  Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit?</pre><ul><li>If you accept the user ID, GPG will prompt you to enter and <strong>confirm a password</strong>. Afterward, GPG will begin generating your key.</li></ul><pre>gpg: key 09D2BD39 marked as ultimately trusted<br>  public and secret key created and signed.<br>  <br>  gpg: checking the trustdb<br>  gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model<br>  gpg: depth: 0  valid:   4  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 4u<br>  gpg: next trustdb check due at &lt;expiration_date&gt;<br>  pub   1024R/09D2B839 2013-06-25 [expires: &lt;expiration_date&gt;]<br>        Key fingerprint = 6AB2 7763 0378 9F7E 6242  77D5 F158 CDE5 09D2 B839<br>  uid                  Full Name (comment) &lt;username@something.edu&gt;<br>  sub   1024R/7098E4C2 2013-06-25 [expires: &lt;date&gt;]</pre><ul><li>To find your generated key hit gpg --list-keys</li><li>The first line will be like pub XXXXX/YYYYYYYY &lt;date&gt;. The last 8 characterspart is your keyId.</li><li>Now, publish your keys: (please change with your keyId). You can use any of the key-server but make sure you upload on hkp://keyserver.ubuntu.com</li></ul><pre>$ gpg --keyserver hkp://keyserver.ubuntu.com --send-keys YYYYYYYY<br>$ gpg --keyserver hkp://pgp.mit.edu --send-keys 09D2BD39</pre><ul><li>To check if the keys are uploaded you can run</li></ul><pre>$ gpg --keyserver hkp://pgp.mit.edu --search-keys &lt;your-mail&gt;</pre><ul><li>Save your keys in secring.gpg file by running following — This file will be inside your ~/.gnupg folder.</li></ul><pre><em>gpg --export-secret-keys &gt; ~/.gnupg/secring.gpg</em></pre><p>Meta work is done! Let’s write some code for publishing release.</p><h4>Step 3. Publish the library to Nexus artifact manager with Gradle publish plugin</h4><p>We have generated few private keys and passwords which we don’t want to be get included with our Version Control. So we’ll use our machine’s ~/.gradle/ folder to store the credentials required to upload the artifact.</p><ul><li>Create a file ~/.gradle/gradle.properties. Since .gradle is shared with all the gradle projects, this gradle.properties file will be available to our library too.</li><li>You’ve created an account on OSSRH jira board. We will need your username and password of OSSRH jira account.</li><li>Add the following in your ~/.gradle/gradle.properties file and save the file.</li></ul><pre>NEXUS_USERNAME=&lt;OSSRH jira account username&gt;<br>NEXUS_PASSWORD=&lt;OSSRH jira account password&gt;</pre><pre>signing.keyId=&lt;your-key-id-(last 8 character of your key)&gt;<br>signing.password=&lt;password-you-have-added-while-creating-gpg-key&gt;<br>signing.secretKeyRingFile=/Users/&lt;username&gt;/.gnupg/secring.gpg</pre><p>Here NEXUS_USERNAME and NEXUS_PASSWORD are your jira account credentials these will be required while publishing the artifact to sonatype.</p><ul><li>Sonatype wants to sign the artifacts that you are publishing that’s why we have created the gpg keys.</li><li>signing.keyId , signing.password , signging.secretKeyRingFile will be used by our Gradle’s signing plugin (which we will be using to sign our artifacts while publishing). Everything will make sense when we will write gradle maven-publish plugin configurations, hold on!!</li></ul><p>Now, open your project and open your module’s (aka library)build.gradle file.</p><ul><li>Add the following plugins in the plugins{...}.Add your group-id and version name</li></ul><pre>plugins <strong>{<br>    </strong>id &#39;java-library&#39;<br>    id &#39;kotlin&#39;</pre><pre>//Add maven-publish and signing plugins<br>    id &#39;maven-publish&#39;<br>    id &#39;signing&#39;<br><strong>}<br>//....<br></strong><br>group = &#39;&lt;groupId&gt;&#39;<br>version = &#39;&lt;version&gt;&#39;</pre><p>Here you can use the version and groupId variables which can be added to your app’s gradle.properties file or whichever way you want to keep them.</p><ul><li>Add a java task which will generate javadocs and sources jar</li></ul><pre>plugins <strong>{<br>    </strong>id &#39;java-library&#39;<br>    id &#39;kotlin&#39;</pre><pre>//Add maven-publish and signing plugins<br>    id &#39;maven-publish&#39;<br>    id &#39;signing&#39;<br><strong>}<br></strong><br>group = &#39;&lt;groupId&gt;&#39;<br>version = &#39;&lt;version&gt;&#39;</pre><pre>java <strong>{<br>    </strong>withJavadocJar()<br>    withSourcesJar()<br><strong>}</strong></pre><ul><li>Next, we need to configure the publishing — write a publishing gradle task just below the above java dsl block.</li></ul><pre>publishing <strong>{<br>    </strong>publications <strong>{<br>        </strong>mavenJava(<em>MavenPublication</em>) <strong>{</strong></pre><pre><strong>            </strong>artifactId = &#39;&lt;libraryname&gt;&#39;</pre><pre>            from components.java<br><br>            pom <strong>{<br>                </strong>name = &#39;&lt;libraryname&gt;&#39;<br>                description = &#39;&lt;description&gt;&#39;<br>                url = &#39;&lt;library/project url&gt;&#39;<br>                licenses <strong>{<br>                    </strong>license <strong>{<br>                        </strong>name = &#39;&lt;Your license&gt;&#39;<br>                        url = &#39;&lt;license-url&gt;&#39;<br>                    <strong>}<br>                }<br>                </strong>developers <strong>{<br>                    </strong>developer <strong>{<br>                        </strong>id = &#39;&lt;developerID&gt;&#39;<br>                        name = &#39;Developer Name&#39;<br>                        email = &#39;Developer email&#39;<br>                    <strong>}<br>                }<br>                </strong>scm <strong>{<br>                </strong>connection = &#39;scm:git:git://github.com/CuriousNikhil/simplepoller.git&#39;<br>                    developerConnection = &#39;scm:git:ssh://github.com/CuriousNikhil/simplepoller.git&#39;<br>                    url = &#39;https://github.com/CuriousNikhil/simplepoller&#39;<br>                <strong>}<br>            }<br>        }<br>    }</strong></pre><pre><strong>    </strong>repositories <strong>{<br>        </strong>maven <strong>{<br><br>            </strong>credentials <strong>{<br>                </strong>username = &quot;$NEXUS_USERNAME&quot;<br>                password = &quot;$NEXUS_PASSWORD&quot;<br>            <strong>}<br><br>            </strong>name = &quot;&lt;name anything&gt;&quot;<br>            url = &#39;https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/&#39;<br>        <strong>}<br>    }<br>}</strong></pre><blockquote>Here, I’m uploading the kotlin library (a jar). If you want to upload the aar android library you can tweak this publishing task. Check out the official doc from <a href="https://developer.android.com/studio/build/maven-publish-plugin">https://developer.android.com/studio/build/maven-publish-plugin</a></blockquote><p>I’ve to write and configure my pom file to publish a jar. Gradle provides out of the box support for writing &amp; configuring pom files for your jar. I’ve added my required configuration in pom{..} DSL. <a href="https://docs.gradle.org/current/dsl/org.gradle.api.publish.maven.MavenPom.html">These</a> are the available options.</p><p>Next block you can see is of repositories. We have defined the credentials{...} with username and password and as we’ve set our required credentials in ~/.gradle/gradle.properties, those variables can be used here.</p><p>The URL for the sonatype I used is for the release artifact publishing. If you want to release SNAPSHOT you can use snapshot URL from sonatype. These URLs will be mentioned on the jira ticket when the space is created for you on sonatype.</p><p>For snapshot release you can configure this way —</p><pre>repositories {<br>        maven {<br>            def releasesRepoUrl = &#39;&lt;release-repo-url&gt;&#39;<br>            def snapshotsRepoUrl = &#39;&lt;snapshot-repo-url&gt;&#39;<br>       url = version.endsWith(&#39;SNAPSHOT&#39;) ? snapshotsRepoUrl : releasesRepoUrl<br>        }<br>    }</pre><p>Publishing to local maven and more configurations are available in <a href="https://docs.gradle.org/current/userguide/publishing_maven.html"><strong>gradle-publishing plugin</strong></a><strong>.</strong></p><ul><li>Now add the signing configurations in the signing{...} dsl. Write this just below our publishing dsl block.</li></ul><pre>signing <strong>{<br>    </strong>sign publishing.publications.mavenJava<br><strong>}</strong></pre><p>As we have already added the required credentials in our ~/.gradle/gradle.properties those will be picked up while signing our publication. You can check more configurations available for <a href="https://docs.gradle.org/current/userguide/signing_plugin.html"><strong>gradle-signing plugin</strong></a></p><blockquote>You can check complete build.gradle file for reference <a href="https://github.com/CuriousNikhil/simplepoller/blob/main/simplepoller/build.gradle">here</a>.</blockquote><p>And we are done!!! Now you can publish your repository. Just run —</p><pre>$ ./gradlew publish</pre><ul><li>This will stage the artifact on the Nexus Sonatype.</li><li>You need to login to OSSRH available at <a href="https://s01.oss.sonatype.org/"><strong>https://s01.oss.sonatype.org/</strong></a> in order to access and work with your staging repositories. Use the username and password from your account for the JIRA issue tracking system for OSSRH and the <em>Login</em> link in the top right hand corner of the OSSRH user interface.</li><li>When you log in — jump to the staging repositories tab and you’ll see your artifact listed</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/0*vkYNA6JOIZLz6_0E.png" /></figure><ul><li>This is for you to verify if all the data is correct. The artifact, at this stage, is not released yet. You’ve to do that from here.</li><li>If you are fine with the content and validated required data. You need to close this repository. Select the repository and hit close button. If there are no errors, your repository will be closed.</li><li>Now you can hit on Release button to release and drop the artifact. If everything goes fine. Your library is released!! Yay!!</li><li>(It’ll take some time to get on the CDN meanwhile you can add comment on ticket that you‘ve released your first component so OSSRH will start syncing to maven central)</li><li>You can check gradle’s <a href="https://docs.gradle.org/current/userguide/publishing_customization.html">customization option</a></li><li>If you want more automated release you can check Nexus Sonatype’s publishing gradle plugin <a href="https://github.com/Codearte/gradle-nexus-staging-plugin">https://github.com/Codearte/gradle-nexus-staging-plugin</a></li></ul><p>Go publish your awesome libraries! ✌️</p><p>Special Thanks to — Gradle and Sonatype</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df263a4f2cbc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Asynchrony made much more simpler !!]]></title>
            <link>https://medium.com/mindorks/asynchrony-made-much-more-simpler-90dbbae79463?source=rss-fa132b10dd5d------2</link>
            <guid isPermaLink="false">https://medium.com/p/90dbbae79463</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[kotlin-coroutines]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Nikhil Chaudhari]]></dc:creator>
            <pubDate>Tue, 19 Feb 2019 14:08:17 GMT</pubDate>
            <atom:updated>2021-05-29T11:41:43.749Z</atom:updated>
            <content:encoded><![CDATA[<h3>Concurrency made easy with Asynkio!</h3><h4>Write your Network Requests and IO calls painlessly with <a href="https://curiousnikhil.github.io/AsynKio/#/">Asynkio</a> in Android/Kotlin</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X5FJtXXFWY2yL5FqSWlLUw.png" /></figure><p>So far we all have been using many libraries to handle asynchrony efficiently in JVM world. With the rise of <a href="https://kotlinlang.org/docs/reference/coroutines-overview.html"><strong>Kotlin Coroutines</strong></a><strong> </strong>it has become more easy and even more efficient.</p><p>Still on android, we use lot of code to make a network request or any IO call asynchronously. Specifically talking about the network requests, Java and so as Kotlin are very bad at creating an http connection. Though some libraries have achieved to make network calls elegantly, e.g., <a href="https://square.github.io/retrofit/">Retrofit</a>, <a href="https://developer.android.com/training/volley/">Volley</a>, <a href="https://square.github.io/okhttp/">Okhttp</a> etc.</p><p>However while using these libraries in your codebase, I personally think that you need to write a bit more code to make a simple connection request. Even further to handle asynchrony, you have to rely on another asynchronous libraries like Rx , coroutines, Executors, AsyncTask(No offence!) etc. That adds more code into your codebase.</p><p>What if I tell you that you can achieve all the asynchrony with multiple network requests or a database queries or an IO file operations in just two to three lines of code ?</p><blockquote><a href="https://curiousnikhil.github.io/AsynKio/#/">Asynkio</a>: A new library to write asynchronous code painlessly</blockquote><p>A…yes you can do that with <a href="https://curiousnikhil.github.io/AsynKio/#/"><strong>Asynkio</strong></a><strong>. </strong><a href="https://curiousnikhil.github.io/AsynKio/#/"><strong>Asynkio</strong></a><strong> </strong>is a library based on <em>kotlin coroutines</em> which helps you in writing all your network and IO calls painlessly in an asynchronous fashion. <a href="https://curiousnikhil.github.io/AsynKio/#/"><strong>Asynkio</strong></a><strong> </strong>is pretty much inspired by python’s <a href="https://docs.python.org/3/library/asyncio.html"><strong>asyncio</strong></a> library which helps to write <strong>concurrent</strong> code using the async/await syntax.</p><p>What I mean is… let me show you in action:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c720ee6da3669d8149da465fd50d5cf4/href">https://medium.com/media/c720ee6da3669d8149da465fd50d5cf4/href</a></iframe><p>Yeah, that’s it. No retrofit. No volley. No other crapy things to make a simple http connection. Seriously, No!<br><a href="https://curiousnikhil.github.io/AsynKio/#/"><strong>Asynkio</strong></a><strong> </strong>uses the two functions async &amp; await.</p><p>async accepts a suspending lambda and it’s ran over on a controlled coroutine(<a href="https://github.com/CuriousNikhil/AsynKio/blob/master/asynkio/src/main/java/me/nikhilchaudhari/asynkio/core/AsynkHandler.kt">AsynkHandler</a>). async is an extension to Any, Activity and Fragment scope so you can use async anywhere.</p><p>await, which is itself a suspending function, takes a lambda that has to be run for long time. <em>It can be anything like a network request, an IO call to perform file operations of a database query, distributed task queues</em> etc.</p><p>As you can see the method get(...) is an HTTP GET request over the URL specified as a parameter in the method. The response of first get request is assigned to variable firstResponse which in turn used in a second post(...) request (It’s HTTP POST) and finally response of the last post is returned by the await. Pretty simple! <br>Returned response can be processed on MainThread , here I populated the TextView with result.</p><p>async adds the suspending lambda in queue so that the code you’ve written is executed sequentially. While the long running and Network/IO bound code is handled by await as it accepts a suspending lambda. All this became easier by means of <strong>Kotlin coroutines</strong>.</p><p>Please checkout the documentation for more reference <a href="https://curiousnikhil.github.io/AsynKio/#/"><strong>Asynkio</strong></a></p><h3>What else it can do ?</h3><ul><li>Well, how about a file operation?</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/aeeff947527e8d274b1a19ecd183d0af/href">https://medium.com/media/aeeff947527e8d274b1a19ecd183d0af/href</a></iframe><ul><li>How about all HTTP requests with specific methods with no extra overhead?</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7bafb5b5000f2f10f8dfa0df9d47c027/href">https://medium.com/media/7bafb5b5000f2f10f8dfa0df9d47c027/href</a></iframe><ul><li>How about sending custom headers and parameters with request ?<br>You often need to send the parameters along with url in the form of key=value. For sending the parameters one can use map for and pass it as a params value.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2f395f7ef620fec7ffe13db918802fda/href">https://medium.com/media/2f395f7ef620fec7ffe13db918802fda/href</a></iframe><h3>Hmm…Okay, anything else ?</h3><ul><li>It supports <a href="https://github.com/ReactiveX/RxKotlin">RxKotlin</a> and <a href="https://github.com/ReactiveX/RxJava">RxJava</a>: You can pass an Observable inside await and it’ll wait for the Observable to emit a value.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1eb7c23b5fbc58ee2482d73d4f3b67f0/href">https://medium.com/media/1eb7c23b5fbc58ee2482d73d4f3b67f0/href</a></iframe><ul><li>This is better part, You can create your own await implementations. Here is example of rxjava and <a href="https://developer.android.com/topic/libraries/architecture/livedata">livedata</a> extensions to give you idea. Just return the result of calling AsynkHandler.await with your own lambda implementation. The code inside await block will be run on a background thread.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/62dbb528dd499456adf67b2933e6b5bb/href">https://medium.com/media/62dbb528dd499456adf67b2933e6b5bb/href</a></iframe><h3>Avoid Memory leaks</h3><p>Long running background code referencing any view/context may produce memory leaks. To avoid such memory leaks, call async.cancelAll() when all running coroutines referencing current object should be interrupted, like</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f668f42151336c2c2e21114d95f64cbe/href">https://medium.com/media/f668f42151336c2c2e21114d95f64cbe/href</a></iframe><p>There is lot you can do with this library. Please refer the <a href="https://curiousnikhil.github.io/AsynKio/#/"><strong>documentation</strong></a> for further references :</p><p><a href="https://curiousnikhil.github.io/AsynKio/#/">Asynkio Documentation</a></p><p>Please note that this library is in alpha. Soon will be adding many features. PRs and contributions are always welcome.</p><p><a href="https://github.com/CuriousNikhil/AsynKio">CuriousNikhil/AsynKio</a></p><p>Stay tuned for the next post. I’ll cover how to use <a href="https://curiousnikhil.github.io/AsynKio/#/"><strong>Asynkio</strong></a> into production code in the next post. Follow me on twitter for the updates. Thanks.</p><p><a href="https://twitter.com/CuriousNikhyl">Nikhil Chaudhari (@CuriousNikhyl) | Twitter</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90dbbae79463" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mindorks/asynchrony-made-much-more-simpler-90dbbae79463">Asynchrony made much more simpler !!</a> was originally published in <a href="https://medium.com/mindorks">MindOrks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A complete Backend only with Kotlin and your favourite text-editor!]]></title>
            <link>https://medium.com/hackernoon/a-complete-backend-only-with-kotlin-and-your-favourite-text-editor-582b4528688?source=rss-fa132b10dd5d------2</link>
            <guid isPermaLink="false">https://medium.com/p/582b4528688</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[rest-api]]></category>
            <category><![CDATA[servers]]></category>
            <dc:creator><![CDATA[Nikhil Chaudhari]]></dc:creator>
            <pubDate>Mon, 10 Sep 2018 03:25:07 GMT</pubDate>
            <atom:updated>2018-09-10T03:25:07.432Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UnOJQ9MbdKpsnecahq5uRg.jpeg" /></figure><p>What ?!! Okay, let me clarify. Let’s build a complete backend /web-app with Kotlin and your favourite text-editor only. No, no need to install IntellJ IDEA, No need to handle Gradle file stuff .. seriously, No! All you need is a simple text-editor and Kotlin.<br>So… how to do that ?</p><p>For this recipe, we need two ingredients (apart from text-editor and Kotlin).<br>I assume that you’ve installed <a href="https://kotlinlang.org/"><strong>Kotlin</strong></a><strong> </strong>and you are set with Atom or Sublime or Vim.</p><h3>Installing <a href="https://github.com/holgerbrandl/kscript">Kscript</a> and <a href="https://ktor.io/">KTor</a></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/339/1*eNOHLwmo78NiRScganL79Q.gif" /><figcaption>A made GIF ;-)</figcaption></figure><blockquote>What is <a href="https://ktor.io/"><strong>KTor</strong></a> ?<br>Ktor is a framework for building asynchronous servers and clients in connected systems using the powerful Kotlin programming language.</blockquote><p>KTor is a web-framework built with Kotlin to make powerful webapps. This is the framework we are going to use. Ktor is a framework to easily build connected applications — web applications, HTTP services, mobile and browser applications. Modern connected applications need to be asynchronous to provide the best experience to users, and Kotlin coroutines provide awesome facilities to do it in an easy and straightforward way.<br>If you want to read a more about Ktor check the description <a href="https://ktor.io/quickstart/index.html"><strong>here</strong></a><strong>.</strong></p><blockquote>What is <a href="https://github.com/holgerbrandl/kscript"><strong>Kscript</strong></a> ?<br>Enhanced scripting support for <a href="https://kotlinlang.org/">Kotlin</a> on *nix-based systems.</blockquote><p>This is the interesting part. It is a <a href="https://github.com/holgerbrandl/kscript"><strong>library</strong></a> maintained by <a href="https://twitter.com/holgerbrandl"><em>@ HolgerBrandl</em></a><em> </em>which provides enhanced and awesome scripting support for Kotlin. Even you can use this tool for data/text processing and also to run Kotlin.kt files. Watch <a href="https://www.youtube.com/watch?v=cOJPKhlRa8c"><strong>this talk</strong></a><strong> </strong>for more details and what Kscript can do.</p><p>To install Kscript follow this procedure:<br>If you have the <a href="http://sdkman.io/"><strong>sdkman</strong></a><strong> </strong>installed you can skip directly to step <strong>2.</strong><br><strong>1.</strong> Install <a href="http://sdkman.io/"><strong>sdkman</strong></a><strong><br></strong>You can follow instructions <a href="https://sdkman.io/install"><strong>here</strong></a>. or Run:</p><pre>$ curl -s “<a href="https://get.sdkman.io/">https://get.sdkman.io</a>&quot; | bash</pre><p>Then follow the instructions on the terminal screen to run something like this</p><pre>$ source &quot;$HOME/.sdkman/bin/sdkman-init.sh&quot;</pre><p><strong>2.</strong> Install <strong>Kscript<br></strong>Once you have installed <strong>sdkman, </strong>you can run this to install Kscript. (But prerequisite to Kscript is Kotlin and Maven, so make sure you’ve Kotlin on your machine. Simply, run $ sdk install kotlin and $ sdk install maven ).Now run the following command:</p><pre>$ sdk install kscript</pre><p>It’ll download the Kscript and will add it to your path.</p><p>Let me give you a quick overview of Kscript, so that you’ll get an idea about it. To get started with Kscript and for complete reference please visit <a href="https://github.com/holgerbrandl/kscript"><strong>this repo</strong></a><strong>.<br></strong>The extension of file is .kts or you can use .kt . Add this line at top of your file #!/usr/bin/env kscript (point to it in the shebang line). Inside of the file you can write any kotlin code. Check below simple hello_world.kts .</p><pre>#!/usr/bin/env kscript</pre><pre>import java.util.*</pre><pre>println(&quot;Belllloooo!!&quot;)<br>//Rest of the code below </pre><p>And you can Run this using the following command. It has some compilation overhead so it’ll take some time.</p><pre>$ kscript hello_world.kts</pre><p>Please go through the <a href="https://github.com/holgerbrandl/kscript">kscript repo</a> to get more details of how to include library dependency, another file, Kotlin-opts, JVM-args etc.</p><h3>Running a KTor Server</h3><p>Now let’s look at KTor. To use KTor, we’ve this dependency <br>compile &quot;io.ktor:ktor-server-netty:0.9.4&quot; to use it with gradle. But, as I said, we are not maintaining any gradle file stuff at all. Here comes one of the best features of Kscript, is that you can declare library dependencies in the same file that you are working on. Let me show you what I mean by modifying the same hello_world.kts file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9b7663fb396640afa44a94b9ba6a02b4/href">https://medium.com/media/9b7663fb396640afa44a94b9ba6a02b4/href</a></iframe><p>Here the @file:MavenRepository(...) is same as specifying the repositor{} in build.gradle file in your IntellJ IDEA. The repositories required for KTor are maven repos. Also the the @file:DependsOnMaven(...) specifies the artifact required for basic usage with Netty.</p><p>The dependencies will be downloaded and cached when you will try to run the above file for the first time. To clear the cache you can run kscript --clear-cache .</p><p>By modifying further the above file let’s see how we can start the server. I am modifying the same hello_world.kts file again.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e78e3649f9e85e8af44d182d6767cea1/href">https://medium.com/media/e78e3649f9e85e8af44d182d6767cea1/href</a></iframe><p>And you’re done. Just run the command $ kscript hello_world.kts . It’ll download the dependencies for the first time (takes a some time for compilation and downloading dependencies). You can ignore the warnings(something like SL4J etc). <br>Visit the url http://localhost:8080 on your browser. Hope you’ll possibly see something there :p</p><p>We’ve just created a simple server with a text-editor and a kotlin. For further completion you can check the server-backed development of KTor in <a href="http://ktor.io/servers/index.html"><strong>the documentation</strong></a><strong>. </strong>For client side HTML-templating and requests handling check this <a href="http://ktor.io/clients/index.html"><strong>documentation</strong></a> of KTor.</p><p>KTor is asynchronous server framework. I’ll be covering those topics in the next part of this series. So, stay tuned for the next post.</p><p>Part-II is coming. Stay tuned ! Clap for me if you liked the story and follow me to get awesome recipes like this. Visit <a href="http://www.nikhya.me/"><strong>http://nikhya.me</strong></a><strong> </strong>for more stuff.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=582b4528688" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/a-complete-backend-only-with-kotlin-and-your-favourite-text-editor-582b4528688">A complete Backend only with Kotlin and your favourite text-editor!</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a music streaming server and live music playing android client]]></title>
            <link>https://medium.com/hackernoon/creating-a-music-streaming-server-and-live-music-playing-android-client-c12cd0600e56?source=rss-fa132b10dd5d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c12cd0600e56</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-music-app]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[streaming-music]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Nikhil Chaudhari]]></dc:creator>
            <pubDate>Tue, 15 May 2018 15:25:48 GMT</pubDate>
            <atom:updated>2018-09-03T03:33:36.997Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*_VMbxSXQpvjXT0q3ztNYxQ.jpeg" /></figure><p>I’d an awesome experience when I was in <a href="https://innovate.mygov.in/sih2018/">Smart India Hackathon Finals</a> and we’d worked on one problem of public announcement system. So, I’ve decided to write a blog on how to make a simple audio/music streaming server in NodeJS and a simple android app which will stream the real-time audio. By using following code you can make your own local simple music streaming server and that music can be listened on an android client or a browser in real-time. So, let’s open the oven to cook this recipe.</p><h3>Creating a simple Music Streaming Server</h3><p>You can make your own streaming server by using anything but the simplest way I’ve found here is to use the open source software <strong>SWYH</strong> ( Stream What You Hear ). You can check the official site <a href="https://www.streamwhatyouhear.com/">here</a>. This application is availabel only for windows and can be downloaded from <a href="https://www.streamwhatyouhear.com/download/">here</a>. You can also use the <a href="http://icecast.org/"><strong>IceCast</strong></a> as well.</p><p>The important thing here is that we are not lifting that creepy load of maintaining a buffer and then streaming the audio chunks over the request with the help of some code. We are using these software to handle the weight for us, thus it becomes easy to get a <strong>url</strong> on which an audio is streamed.</p><p>Once you’ve installed the <strong>SWYH</strong> follow the steps from here <a href="https://www.streamwhatyouhear.com/getting-started/">Getting-Started</a>. If everything goes right you’ll end up with the following sreenshot:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/503/1*18m2GHIr1pdxeJnLZQuxrw.png" /></figure><p>Here you can check the <em>URL</em> as some local address of the server and the route of <strong>/stream/swyh.mp3</strong>. To listen the music you have to connect to the same <strong>wifi-network</strong> to which the machine with SWYH is connected. You can create a simple hotspot or you may connect to your own network in home. <em>This is must that those devices who want to listen the stream should be connected to the same network</em>. Now we’re ready to move forward.</p><p>You can simply just paste the <em>URL </em>shown by the SWYH to browser and Bingo!! You can listen the music on that device as well. Of course, someone needs to play the music on the machine with SWYH installed. Now you have your streaming server ready and we can build the android app. Don’t worry if you did not understand the above thing so far, it’ll get clear as we go further or you may check the <em>documentation</em> of <em>SWYH</em> to get clear understanding.</p><h3>Creating a NodeJS streaming server</h3><p>Let’s suppose that you want to make your streaming public and everyone in the world can listen the awesome playlist you have with Weekend, Linkin-Park, Queen (My favourite one: I want to break free ;-)etc. You can make a simple nodeJS server to <strong>pipe</strong> the stream which is currently streamed by the <strong>SWYH</strong> software.</p><p>To pipe the stream to some different URL we can use request node module. All you have to do is to first install request node module.</p><pre>$ npm install request --save</pre><p>Once you have installed the request module, you can use this in your Express server</p><pre>var express = require(&#39;express&#39;);<br>    var path = require(&#39;path&#39;);<br>    var request = require(&#39;request&#39;);<br>    <br>    var app = express()<br>    <br>    app.get(&#39;/playback.mp3&#39;, function(req, res){<br>    <br>    //the request module is piping the steam over the get request coming on playback.mp3<br>    request.get(&#39;http://&lt;your-swyh-url:56789&gt;/stream/swyh.mp3&#39;).pipe(res, function(error){<br>       		console.log(error);<br>       });<br>    });<br>    <br>    //here the server is localhost and listening on the port 8000<br>    app.listen(8000,function(){<br>	console.log(&quot;Listening on 8000&quot;);<br>    });</pre><p>As you can see we are piping the streaming from one <em>URL</em> to other <em>URL</em> i.e from one server to other server. Here, I would like to mention that you can use any link in the request.get(...) function. As an example, you can use <a href="http://playerservices.streamtheworld.com/api/livestream-redirect/KUFXFM_SC">this one</a> as well.</p><pre>//....<br>request.get(&#39;<a href="http://playerservices.streamtheworld.com/api/livestream-redirect/KUFXFM_SC">http://playerservices.streamtheworld.com/api/livestream-redirect/KUFXFM_SC</a>&#39;)<br>.pipe(res,function(error){<br>//....<br> });</pre><p>And Bingo!! Now you know how to make a simple Music Streaming Server !!! Here half of the recipe gets completed.</p><h3>Baking an android client</h3><p>Creating an android client app for listening the live stream audio is very easy. We are going to use the existing MediaPlayer class from android framework. Checkout the description <a href="https://developer.android.com/reference/android/media/MediaPlayer">here</a>.</p><p>It handles the audio buffering in background and audio can be listened from the speakers of android device. Here is the code inside of an onCreate() method:</p><pre>public class MainActivity extends AppCompatActivity {<br>    //....//declaring the MediaPlayer<br>    MediaPlayer mp;<br>        <br>    @Override<br>    protected void onCreate(Bundle savedInstanceState) {<br>    	super.onCreate(savedInstanceState);<br>        setContentView(R.layout.activity_main);<br>        //...<br>        //...<br>        String streamURL = &quot;your-music-streaming-url-whatever&quot;;<br>        //Instantiating the MediaPlayer class<br>        <br>        mp = new MediaPlayer();<br>        <br>        //setting the audio stream type to Streaming music<br>        try{<br><br>            mp.setAudioStreamType(AudioManager.STREAM_MUSIC);<br>            mp.setDataSource(streamURL);<br>            mp.prepareAsync();<br><br>        }catch (Exception e){<br>            e.printStackTrace();<br>        }<br>        <br>        //catching the error if any<br>        mp.setOnErrorListener((mediaPlayer,what,extra)-&gt;{<br>            mediaPlayer.reset();<br>            return false;<br>        });<br>       <br>    }</pre><p>Here, we’ve initialised the MediaPlayer and the audio stream type is set to STREAM_MUSIC. The DataSourceis set to the URL we are using to steam the audio/music.</p><p>The interesting thing is the prepareAsync() method. This method creates an <strong>asynchronous request</strong> to the URL and keeps the network out of the MainThread. The MediaPlayer asynchromously calls the GET method of our server and in response to request the audi packets are sent. The audio packets are captured and stored in buffer.</p><p>As the buffer is loaded enough to play some bit of music the Media player is prepared to send the sound to speakers. SetOnPreparedListener is used to check the above case and we can play() the music. The below code shows SetOnPreparedListener written right below the above code.</p><pre>mp.setOnPreparedListener((mediaPlayer)-&gt;{<br>    	//TODO:use some button to play and pause the music<br>        // you can use this with some button click action as well<br>    	if(playButton.isChecked()){<br>        	mp.start();<br>        }else{<br>        	mp.pause();<br>        }<br>        <br>    });</pre><p>mp.start() call will play the sound from your speaker and you can enjoy the delightful music. Wow !!</p><p>Now, as we’ve made some mess while making this recipe, we need to place the things right unless we will be facing the tonnes of memory leak in android. In you onDestroy() and onStop() method add the following code and you are good to go:</p><pre>//...<br>    @Override<br>    protected void onDestroy() {<br>        super.onDestroy();<br><br>        if (mp!=null){<br>            if (mp.isPlaying()){<br>                mp.stop();<br>            }<br>            mp.release();<br>            mp = null;<br>        }<br>     //...</pre><p>Alright, I’m going to listen some Queen and Coldplay. Any queries? Comment section is below ↓ .</p><blockquote>Genieße die Musik</blockquote><figure><a href="http://buymeacoff.ee/mrcurious"><img alt="" src="https://cdn-images-1.medium.com/max/170/1*bk_C8Um34KavCkO2yzMCZg.png" /></a><figcaption>Support me !</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c12cd0600e56" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/creating-a-music-streaming-server-and-live-music-playing-android-client-c12cd0600e56">Creating a music streaming server and live music playing android client</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Best practices of Socket.io with Android]]></title>
            <link>https://mrcurious.medium.com/best-practices-of-socket-io-with-android-9f9cb4eb744e?source=rss-fa132b10dd5d------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f9cb4eb744e</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[socketio]]></category>
            <category><![CDATA[realtime]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Nikhil Chaudhari]]></dc:creator>
            <pubDate>Wed, 14 Mar 2018 18:59:19 GMT</pubDate>
            <atom:updated>2018-08-27T17:55:35.598Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q-h7lQ3m5p7knnyz4wk8gQ.jpeg" /></figure><p><a href="https://socket.io/"><strong>Socket.IO</strong></a> enables real-time bidirectional event-based communication. It works on every platform, browser or device, focusing equally on reliability and speed. Socket.IO is built on top of the <strong>WebSockets API (Client side) and NodeJs.</strong></p><p>Socket.IO is not a WebSocket library with fallback options to other realtime protocols. It is a custom realtime transport protocol implementation on top of other realtime protocols. Its protocol negotiation parts cause a client supporting standard WebSocket to not be able to contact a Socket.IO server.<br>And a Socket.IO implementing client cannot talk to a non-Socket.IO based WebSocket or Long Polling Comet server. Therefore, Socket.IO requires using the Socket.IO libraries on both client and server side.</p><p>The official site says,</p><blockquote>Socket.IO enables real-time bidirectional event-based communication.</blockquote><p>The Socket.IO enables the client and server to communicate in real time. The Socket.IO NodeJs server defines the events that to be triggered on a specific route.Those events are listened by server which are emitted by clients.Also, a server can emit an event to which a client can listen.</p><p>The Socket.IO can easily be implemented over web apps using NodeJs server as a back-end. But in case of Android ?</p><p>Then we have a best library created by <em>Naoyuki Kanezawa</em> [<a href="https://github.com/nkzawa">@nkwaza</a>].<br>and one by official Socket.IO <a href="https://github.com/socketio">Github</a> for android as client of Socket.IO server.</p><p>It depends on you what do you want to choose as your personal preference.<br><strong>0]</strong><a href="https://github.com/socketio/socket.io-client-java"><strong>Socket.Io Android-Java client</strong></a></p><p><strong>1]</strong><a href="https://socket.io/blog/native-socket-io-and-android/"><strong>Nkwaza Android Socket.IO client library</strong></a></p><p>you can use either of them. I would recommend you the <strong>Second</strong> one because it’s very handy and kinda easy to use.<br>You can go through the <a href="https://socket.io/blog/native-socket-io-and-android/"><strong>official blog</strong></a> on Socket.IO site by NKwaza.</p><p>To implement the Socket.IO android library in perfect and flawless way you should read further.<br>There are three steps for implementing SOcket.IO Android Client library.</p><h3>0. Initialise the Socket<br>1. Connect the socket to the server<br>2. Start emitting events or listening events</h3><p>Many a times when we use Socket.IO the problems generally faced are</p><p><strong>1-Incorrect initialisation and it gives </strong><strong>NullPointerExecption.</strong></p><p><strong>2- The proper event could not be emitted and listened as the </strong><strong>socket is not connected.</strong></p><p>To avoid this try the following approach.</p><p>Very first step <strong>Add the following dependency</strong> in your app level build.gradle file</p><pre>implementation ‘com.github.nkzawa:socket.io-client:0.5.2&#39;</pre><h3>#0. Initialising the socket</h3><p>To intialise the socket create an &lt;name-of your application&gt; class which extends Application class.</p><p>See the code snippet below</p><pre>import android.app.Application;<br>import com.github.nkzawa.socketio.client.IO;<br>import com.github.nkzawa.socketio.client.Socket;<br>import java.net.URISyntaxException;<br>public class RatKiller extends Application {<br>    private Socket mSocket;<br>    private static final String URL = &quot;<a href="http://yoururl.com/">http://yoururl.com</a>&quot;;</pre><pre>    @Override<br>    public void onCreate() {<br>        super.onCreate();<br>        try {<br>            mSocket = IO.socket(URL);<br>        } catch (URISyntaxException e) {<br>            throw new RuntimeException(e);<br>        }<br>    }<br>   public Socket getmSocket(){<br>     return mSocket;<br>   }<br>}</pre><p>Here in the application class, declare a private variable socket which is we are going to use as a reference you know.<br>The helper method getmSocket() will return the socket instance which we can use in our whole project.</p><h3>#1.Connecting the socket</h3><p>In order to connect the socket to server we need to use the connect() method on the socket instance returned from getmSocket() method.<br>Inside your MainActivity or any activity, add the following code in onCreate() method.</p><pre>public class MainActivity extends AppCompatActivity {</pre><pre>private Socket mSocket;</pre><pre><a href="http://twitter.com/Override">@Override</a><br>protected void onCreate(Bundle savedInstanceState) {<br>    super.onCreate(savedInstanceState);<br>    setContentView(R.layout.activity_main);</pre><pre>RatKiller app = (RatKiller)getApplication();<br>    mSocket = app.getmSocket();<br>    //<br>    //<br>    //...<br>}</pre><p>To check whether connection is established or not you can check by using connected() method.</p><pre>if (mSocket.connected()){<br>  Toast.makeText(MainActivity.this, &quot;Connected!!&quot;,Toast.LENGTH_SHORT).show();<br> }</pre><h3>#2. Listen or Emit event</h3><p>To emit event you can use emit() method.The emit() triggers an event on the server which you are going to implement as a button click or any actions response.</p><pre>button.setOnCLickListener(view-&gt;mSocket.emit(“kill”,poisonObject));</pre><p>To listen specific events sent by server, we use on() method. The on() method opens a channel provided and receives the response from server.</p><pre>mSocket.on(&quot;rat_data&quot;, new Emitter.Listener() {<br>    <a href="http://twitter.com/Override">@Override</a><br>    public void call(Object... args) {<br>        JSONObject data = (JSONObject)args[0];</pre><pre>//here the data is in JSON Format<br>        //Toast.makeText(MainActivity.this, data.toString(), Toast.LENGTH_SHORT).show();</pre><pre>}<br>});</pre><p>Sometimes you need to listen the response of certain events which client/app is going to trigger either via button click or any action triggered etc. <br>In such cases, we can call the on() method over emit() method. The emit() method will trigger some event on specific route/channel and the on() will immediately listen the response send by the server.<br>You can achieve this by doing something like</p><pre>mSocket.emit(&quot;get_rat_data&quot;).on(&quot;rat_data&quot;, new Emitter.Listener() {<br>    <a href="http://twitter.com/Override">@Override</a><br>    public void call(Object... args) {<br>        JSONObject data = (JSONObject)args[0];</pre><pre>//data is in JSOn format</pre><pre>}<br>});</pre><h3>Data/Payload over request</h3><p>The request payload or request body data must be send in JSON format to socket. The JSON Object is the input parameter of emit() method. The Java’s JSONObject and JSONArray class helps us to construct a JSON body format of the data.<br>You can do this as</p><pre>JSONArray poisonArray = new JSONArray();<br>poisonArray.put(1);<br>poisonArray.put(2);<br>JSONObject poisonObject = new JSONObject();</pre><pre>try {<br>    <br>    poisonObject.put(&quot;poisons&quot;,poisonArray);</pre><pre>} catch (JSONException e) {<br>    e.printStackTrace();<br>}</pre><h3>Implementing the UI</h3><p>Every time when you receive the data as a response from the server, you need to update your UI. To update the UI using received data we need to perform all the UI bind logic on runOnUiThread() method.</p><p>The call() method from Emmiter.Listener{…} used to work on a background thread. If you try to call the UI specific method inside the call, it’ll blow up by blasting our favourite Runtime Exceptions.<br>You can achieve this by calling a runOnUiThread(Runnable r) method.</p><pre>mSocket.emit(&quot;kill&quot;,poisonObject).on(&quot;rat_data&quot;, new Emitter.Listener() {<br>    <a href="http://twitter.com/Override">@Override</a><br>    public void call(Object... args) {<br>     JSONObject data = (JSONObject)args[0];</pre><pre>//data is in JSOn format<br>     runOnUiThread(new Runnable() {<br>         <a href="http://twitter.com/Override">@Override</a><br>         public void run() {</pre><pre>           Toast.makeText(MainActivity.this, &quot;Haha !! All rats are   killed !&quot;, Toast.LENGTH_SHORT).show();</pre><pre>          ratTextView.setText(&quot;0&quot;);</pre><pre>          //whatever your UI logic<br>         }<br>     });<br>    }<br>});</pre><p>And done the problem is solved now. Yeah…I know! I am going to kill those Rats running everywhere on the floor.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fd09872%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2Fd09872&amp;image=https%3A%2F%2Fe.enpose.co%2F%3Fkey%3DdRXnS9Gplk%26w%3D700%26h%3D425%26url%3Dhttps%253A%252F%252Fupscri.be%252Fd09872%252F%253Fenpose&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/b0436e26d14e49b3f7fbc34c8035857e/href">https://medium.com/media/b0436e26d14e49b3f7fbc34c8035857e/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f9cb4eb744e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>