Utilities to Validate things

import android.app.Activity;
import android.support.design.widget.TextInputLayout;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
* Created by Somasundaram Mahesh on 12/1/2015.
public class ValidateUtils {
private static final String EMAIL_PATTERN = "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"
+ "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
private static final String MOBILE_PATTERN = "^(?:0091|\\+91|0|)[7-9][0-9]{9}$";
private static final String NAME_PATTERN = "^.*[a-zA-Z]+.*";
private static final String TAG = ValidateUtils.class.getSimpleName();
public static boolean ValidEmailId(String Email) {
return Email.matches(EMAIL_PATTERN);
public static boolean checkMobileNoFormat(String mobileNo) {
String mobile = mobileNo.replace(" ", "");
mobile = mobile.replace("", "");
Pattern mobileNoPattern = Pattern.compile(MOBILE_PATTERN);
Matcher mat = mobileNoPattern.matcher(mobile);
Log.d(TAG, "Mobile Number" + mobileNo + " Validation result :" + mat.matches());
return mat.matches();
public static boolean checkIsName(String mobileNo) {
Pattern mobileNoPattern = Pattern.compile(NAME_PATTERN);
Matcher mat = mobileNoPattern.matcher(mobileNo);
return mat.matches();
public static boolean checkIsPassword(String password) {
return !(password.trim().isEmpty() || !(password.length() >= 6));
private static void requestFocus(View view, Activity activity) {
if (view.requestFocus()) {
public static boolean validateEditText(Activity activity, TextInputLayout textInputLayout, EditText editText, String errorMessage, boolean isPassed) {
if (!isPassed) {
requestFocus(editText, activity);
return false;
} else {
return true;

view raw
hosted with ❤ by GitHub

Android EditText First letter Capital

Sometimes you need the user to always type the first letter in Caps so that it looks clean.

The easiest way to do this is to change the keyboard to Capital on the first letter, you can do this easily by adding this line to your code on the EditText


android:padding="@dimen/paddingS" />

view raw
hosted with ❤ by GitHub

Android Show grey gradient on ImageView

In android if you are working on ImageViews at times you may be needing to show texts on top of ImageViews, so you can use this small hack so that you can show a grey gradient from bottom and textview on the grey will be more visible.

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
android:startColor="@android:color/black" />
<corners android:radius="0dp" />

app:layout_collapseMode="parallax" />
android:background="@drawable/actionbar_gradient_dark" />

view raw
hosted with ❤ by GitHub

“static” who stole my 5 hours of sleep

“static” members will have only one copy of itself in the class.
So this will also help static members and methods to be easily accessed by outside the class just with the Class without its object.Also, Static methods can have access only to static data.

In my project Network calls (Async) were happening in separate class, but everyone wants to connect to a network, so I have made this network call method “static”. Now I had a handler so that it will give back the network calls result back to respective callers. This receierHandler was used to send back the result, some day I have made it static inside the class to get access inside this method.

The network calls were happening one by one and the receiverHandler as it was a static had a single copy and changed itself for every call, till yesterday my app was requesting kind of only one network call at a time, the static receiver was changing itself and sending the result back, today when I made the tab kind of fragments two network call will be sent in same instance but the result should be sent back to respective fragment correctly, but the last fragment was only receiving all the results, since this network calling framework was written months back I didn’t mind to check this Network framework codes and was pulling my hair all day why the last fragment is only receiving all the other fragments response, then after no sleep of 10 hours of trying various iterations like using activities instead of fragment, the style of creating tab layouts and debugging figured out nothing works and went for a small nap of 2 hours,then I started debugging my App again and checked the hashcode of receiverHandlers and found out that they are pointing out the last fragment once the async call has happened, and opened my Network Framework and found out this culprit “static” and fixed it.

BTW, the one who introduced Android to me (Santhosh) wanted me to explain this for other Java learners, and that’s why this post. 🙂

Rdio, the Online Music Service

Rdio is an online music service that offers ad-supported free streaming and ad-free subscription streaming services in 85+ countries, the best part of it is the music choice it makes for me, I just want to play the first song and it takes me in lift from there, starting a station from it which contains the lists of songs that are alike the first song.

Rdio on my Laptop
Rdio on my moto g

The Ads that play by Rdio is something cool, and will make you buy the premium account within months. Their sync on Chrome cast, to your Android mobile to your laptop, is simply clean and easy, that you can use anything as your remote.

Other services the same Rdio I tried where Savan, Raga, Airtel Wynk. Would compare them in detail in my future blogs.

Every music lover will simply enjoy Rdio, is you are offline you may need to pay for an upgrade else it’s okay to go with simply the free version.

Read the web smartly with Flynx

Recently, I when I was travelling had a chance to listen to my favourite podcast All About Android by Jason Howell on the Twit.tv Channel. I was so impressed to see the app Flynx on the Android App Arena section.


The Flynx app simply Saves Time allows you do Multitasking. Flynx quickly loads articles and links in a background from all your favourite apps. The best part is it stores all your links and you can even have a history of it at any time you want, also you can mark it for read later.

If you are aware of Link Bubble, Flynx  little more of it.

The Flynx is actually working on loading content too, it doesn’t display Ads and claims “Flynx strips down all the clutter from articles and loads them in a beautiful layout, saving you more data. The awesomeness that I was impressed is the ball loader with the sites icon on it like messenger, I haven’t seen an app that uses this balls this much effectively next to messenger. This app actually replaced Pocket, Bubble.

Download it from Play Store.

Pebble and nav me

I own a pebble device for some 6 months I guess and trust me it’s awesome, I love the way it is designed, so minimal that you won’t get out focused on your things but brings the right info at the right time for you.

I used to check in on my swarm apps from my watch, control music on my drive and lot more I even reply my Whatsapp messages on the go. Recently pebble came with an option to edit and save your own personal messages that you can tap and click it to send.

I’m usually a big fan of Google Maps, and I use maps very heavily, in fact I have even contributed many places to map and have won some goodies and certificates from google, for making Indian maps better. When I bought Pebble I was so curious to have the navigation on my wrist. But no apps does it, except Nav me, I installed Nav me and tried it. But my bad luck my Moto g was so buggy at that time and the app shows always slow phone connection. So I left my hope.

Recently after Lolipop update on my moto g, I was traveling a bit more and used my map heavily, so last week gave it a one more try and I was so impressed the way nav me guided me with directions on my wrist. Then I tried to add destinations to it, and now I even more loved my pebble, It allows me to start navigation from my wrist and follow the dierctions and even cancel it. Not even needed to take my phone out, and I can concentrate on Chennai Traffic.

This all features was awesome and once I got addicted, my trail period is over, the developer Chris Bates convinced me to buy this and yesterday I just bought this app for Rs199/- which is very nominal for this kind of app.

pebble naveme
pebble nav me screenshot

Get Nav Me: https://play.google.com/store/apps/details?id=com.batescorp.pebble.nav

Hello World!!!

This is me, Somasundaram Mahesh, a fresh and new start to the world of Blog, I have written some blogs before but those were not that much organised in the way it is supposed to be. So starting from today I archive those stuff and go live with this blog. To introduce me, I have been of keen interest to the android Technology. I love the way android has evolved, and I learn every day to build Android apps.

What you will see in this blog,

  • Some new stuff that I come across every day (trust me will worth it).
  • All About new Android apps and sometimes their reviews with my own experience of it.
  • Out of the box sometimes, everything that’s worth your reading time.