How to detect emails, phone numbers, web URLs, hashtags in Android TextView? : SmartTextView library

Smart Text View

Star On GitHub Follow On GitHub

Many applications in android use TextView that detects and highlight various string patterns like emails, phone numbers, web URLs and even hashtags.

This functionality is very common and and is used extensively and frequently in many app. Thus to ease the process of adding this functionality I have authored an Android library SmartTextView.

Find and Star it on GitHubhttps://github.com/priyankvex/SmartTextView

smart_text_view_small

Features

  • Detect emails, mobile numbers, URLs
  • Detect #hash_tags and @mentions
  • Use default intents or set custom callbacks.
  • Set different colors for each pattern.

 

Usage

compile 'com.priyankvex:smarttextview:1.0.1'

In layout xml file

  <com.wordpress.priyankvex.smarttextview.SmartTextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textSize="9pt"
        android:id="@+id/textView"
        />

In java Activity or Fragment

mSmartTextView = (SmartTextView) findViewById(R.id.textView);
        mSmartTextView.setEmailColorCode("#3cb371");
        mSmartTextView.setPhoneNumberColorCode("#ff33aa");
        mSmartTextView.setHashTagColorCode("#f37735");
        mSmartTextView.setUrlColorCode("#ffc425");
        mSmartTextView.setMentionColorCode("#57b884");
        mSmartTextView.setDetectMentions(true);
        mSmartTextView.setDetectHashTags(true);
        mSmartTextView.setText(sampleText);
        mSmartTextView.setSmartTextCallback(this);

To use custom callbacks

implements SmartTextCallback

Marketing Your Retail Store in the Internet Age by Bob Negen : Reading Experience

This was the book that I knew prior to reading it that it won’t be too interesting and might even feel too slow. I searched it on the internet and picked it to read to get a perspective of a retail seller. As me and my team are trying to start a company that will work very closely with retail stores and their owners I thought this book will provide some value.

What I liked about this book how it delivers simple and effective tactics that a store owner can use to create customer loyalty, make lasting seller-customer relationships and compete against online retail giants.

It compares getting customers to getting a girlfriend. They are demanding and they want to feel special or else they’ll move on.

It brings focus on few very effective retail techniques like bag stuffers and doughnut marketing. It also covers basics of copywriting and its importance.

What I didn’t like about the book was that it was too slow and dumb at times. As a young person who is aware of technology world you’ll feel few things too stupid to be covered in that detail in the book. May be that’s a better fit for old shop owners.

Overall it was a good read. Not as per my expectations but still can give you an image of a mind of a retailer.

I’ll definitely use the concepts of this book in my company as me and my team too believe that the best shopping experience for a customer can be provided at a local retail store. All they need  is a power up and better tools now.

My next book is “How to win friends and influence people”. Will share my experience about that too when’ll be done.

Thanks.

 

Business in Boxers 2 : The Rainbow Shelf

As a 16-17 year old you try to figure out what you want to do with your life and then you just imagine yourself doing that. I am a kind of person who imagines stuff very vividly. Few years down the time river here I am, trying to work as hard as I can in the scorching summer heat on something that I always wanted to do.

Second month working on the startup I always wanted to do. Another month passed by, another month that makes you realise that time doesn’t stop for anyone. It doesn’t care if you have excuses, if you are not prepared enough. It just continues to flow. So the best strategy is to just go with the flow and moving forward, even if it’s the tiniest step possible.

This month I tried to put my full team to action. We bought the domain after many discussions on the name. We agreed to the name “Rainbow Shelf“. Personally I find this name very me. The word rainbow depicts my technicolor imagination and how I see this company grow.

After many arguments on what should be the core features that we want in our MVP, we finally got to a truce point.

Assigning roles to team members is something that you don’t want to force too much but yet you want that to be perfect so that it covers the strengths of every person. Out of hundreds of roles that you have to play in your startup, i wanted to make sure that everyone picks the one that they really love. Because if you don’t like what you are working on, what’s the point of working on a startup. I am still not sure whether I have got this right, but it seems to be moving in right direction.

While working on your startup you always have to keep on your helmet, just in case your heads caves in. Out of the blue some team member will raise concerns about the whole idea that you are betting on and you have to handle that and act optimistically no matter how scared you are inside.

During this whole month and for coming months, I am working with a startup based in Bangalore (http://healthgraph.in). The CEO is the best mentor I can ever wish for, seeing him work is what makes you push to go that extra mile and stay up that extra hours in a hope that it’ll make all the difference in the end.

One more lesson I have learned is that you just can’t expect every person on your team to work as hard and passionately as you. You have got to respect their capabilities.

At the start of the month, I created a timeline, a master schedule that we were supposed to follow. Recently I cut that into 1/3. Just so that we always remain on our toes.

Under thing that I have realised is that, don’t panic if you find out that your startup idea is already taken. Chances are that your idea is already present, if you haven’t found it yet then may be you haven’t researched that well. Afterall nothing is new under the sun.

Building a successful business depends less on uniqueness of idea and more on how you are filling the gaps in the market.

One more habit that I have developed is to read a good inspirational book the first hour and the last hour of the day. Just so that I can start and end the day with the correct mindset.

That’s all for this month. Stay Tuned!

 

Business in Boxers : 1 Month Into Running a StartUp

Why the Series? 

(Inspired by book : Business In Blue Jeans)

Hi! This is Priyank. This series is about me pen downing my start-up ride. Don’t know if it’s fast or slow, all I really know is I’m gonna enjoy the ride.

Why the name?

Boxers is what you’ll find me almost every time in and business is what’s always in my mind and thus the name “Business In Boxers”.

The Beginning

Last month on 15th Feb, me and my friend sat down seriously deciding on which business to start. The interesting thing was I did this with 3 friends. 3 awesome business ideas that are practical and scalable. Next, we 4 formed a team. A team with a vision to launch multiple businesses in a very short period of time.

Our first startup what we call as Pebbles Media deals with creating engaging applications for local business owners that can help them discover new customers in their locality. Cool idea that we all thought will get us many clients.

We approached 5 clients in different domains from food business to education to mechanical work. Two of them showed interest and we started working on their products.

15 days later one of our clients refused to pay the advance thus we dropped him. Other client wanted a custom product built for them at a very unreasonable price, again dropped him.

The Pivot

Witnessing all this, we all after 1 hour long discussion decided that it is the time for an early pivot. We never wanted to enter service based B2B sector.

The pivot that will need us to make products that will be used by multiple small businesses and their customers making us a product based company.

A pivot at this early stage raised doubts in our minds but I guess it was the red flag that we all managed to see and decided to pivot and not to run for quick money.

In Love With Business Books

lately I have been reading a lets of business books. Getting ideas and knowing how various aspects of a startup works. My favorite is The Lean Startup. A must read for everyone.

The Speed Breakers

No surprise here, first month has been filled with speed breakers. I was not expecting any smooth ride either. This month we have seen from clients saying no to all saying yes at the same time. Client giving us advance and then we turning him down because we wanted to pivot.

Wrap Up!

This month we dealt with real clients. Realized that we don’t want to go into service based sector.

For next month we are planning to get our MVP out in the market and test our leap of faiths. Too much action for next month. Let’s see what’s in the store next.

See you next time.

 

PS : It is fun to write blog when you are pretty certain that no one will read it 😀