<?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 Venkata Malireddy on Medium]]></title>
        <description><![CDATA[Stories by Venkata Malireddy on Medium]]></description>
        <link>https://medium.com/@narayana1101?source=rss-c1d37b119d62------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Venkata Malireddy on Medium</title>
            <link>https://medium.com/@narayana1101?source=rss-c1d37b119d62------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 23:32:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@narayana1101/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[Mobile number entry done right!]]></title>
            <link>https://blog.lenskart.com/mobile-number-entry-done-right-aaba0b292cbe?source=rss-c1d37b119d62------2</link>
            <guid isPermaLink="false">https://medium.com/p/aaba0b292cbe</guid>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[apps]]></category>
            <dc:creator><![CDATA[Venkata Malireddy]]></dc:creator>
            <pubDate>Sat, 04 Jan 2020 08:13:59 GMT</pubDate>
            <atom:updated>2020-01-04T09:22:16.937Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PGQzfD5o7dYtMPiDB6Slxg.png" /></figure><p>We have 80k+ users logging in to our app every day using their mobile numbers. While the majority of our users are from India, a handful of them are from the US, and the middle-east. This is about to change though, as Lenskart has recently entered the Singapore market and is looking forward to expanding its global footprint. While collecting Indian numbers is pretty straightforward, adding support for international numbers requires us to collect the country code in addition to the phone number, without adversely affecting the user experience or delaying the login.</p><p>Although designing an input for mobile numbers seems quite simple, the input process for most of the popular apps in the market is far from smooth. So how do we capture the mobile number and country code separately while keeping the user input to a minimum and the login flow as intuitive as possible?</p><p>In this article, we’ll discuss our efforts at doing just that.</p><h3>First, some context!</h3><h4>How do users enter their mobile number?</h4><p>At Lenskart, users enter their mobile numbers in one of the following ways:</p><ul><li>directly entering their local phone number omitting the country code</li><li>entering the complete mobile number along with the country code</li><li>picking form the auto-fill dropdown</li></ul><h4>Handling regional users</h4><p>Regional users form a major chunk of our customers and their experience should be no different than it used to be (when there was no additional input for the country code). We only need to add a way to change it if required.</p><h3>So what are our goals?</h3><ul><li>Stupid-simple input via keyboard/soft keys</li><li>Seamless input via auto-fill</li><li>No impact on the majority of our user-base (Indian customers)</li></ul><p>Let’s see how we deal with each of these scenarios in our app.</p><h4>Stupid-simple text input</h4><p>To keep it simple for the user, we start with a single text field. In case the user enters his local phone number, i.e. when the number doesn’t start with a ‘+’, the country code field becomes visible with the country code of the user’s country.</p><p>The country can be obtained from Android’s telephony manager API and the country code field can be defaulted to the code for the user’s country.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*_a6BLXehHxUsrI2cTbk1OQ.gif" /><figcaption><em>We start with a single field, and the country code field appears into view only after user input</em></figcaption></figure><p><em>Bonus: If we enable animateLayoutChanges, the country code field will appear into view with a smooth translate animation.</em></p><p>If the user starts entering a number that includes their country code, i.e +91 9123…..., things have to be handled a little differently. We need to figure out how to separate the country code from the mobile number!</p><p>Thanks to Google’s open source library for phone number validation, <a href="https://github.com/google/libphonenumber">libphonenumber</a>, this is fairly easy!</p><p>We add a TextWatcher to the phone number field, and as soon as we have 4 digits entered, we invoke libphonenumber’s utility methods to extract the country code, and move it to the country code text field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*IMghQAwCLEth4IYu0Ul4bg.gif" /><figcaption>Country code extraction from the mobile number</figcaption></figure><h4>Seamless input via auto-fill</h4><p>This is something most apps get wrong. They usually treat the entire auto-fill as the phone number, and often even clip the phone number at 10 digits!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*NpOYvAZyB9n2Llw01NZnlQ.gif" /><figcaption>Uber’s auto-fill handling :(</figcaption></figure><p>If you were paying attention to the text input implementation, there’s one simple thing we’d done which automagically solves this: the TextWatcher!</p><p>Since the listener is activated once there are 4+ digits, auto-fill automatically triggers this listener, which in turn cleans up the input and splits it into country code &amp; phone number. That is all there is to it!</p><p>Here’s a preview of our implementation in action.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*KMtCuNPjuX_TIyUuDyGx3w.gif" /><figcaption>Our handling.. Ah, that’s better!</figcaption></figure><p>All in all, we had no drop in the funnel, while also enabling our users outside India to browse and shop on the app. I’d say we met out goals, and have even improved the UX for users who had country codes in their auto-fill suggestions!</p><p>Stay tuned for articles about other optimizations in our login and on-boarding flow!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aaba0b292cbe" width="1" height="1" alt=""><hr><p><a href="https://blog.lenskart.com/mobile-number-entry-done-right-aaba0b292cbe">Mobile number entry done right!</a> was originally published in <a href="https://blog.lenskart.com/">The Lenskart Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>