Fastest way to debug an Android application

Android emulator that comes with Eclipse ADT or Android Studio is terribly slow.

Genymotion does slightly better by creating an instance in Oracle VM Virtualbox.

But still it uses your development machine resources and is not as fast as we expect to.

So, the fastest way to use a real Android Phone.

These are the general steps that can you get started with debugging Android app in a Nexus phone.

  • Tap Build Number 7 times @ Settings => About Phone => Build Numberimage
  • You will now see “Developer Options”  under settings.

  • image
  • Enable USB Debugging under Developer options

  • Install ADB driver (for Nexus phones,
  • image
  • Plug in your Android phone. Make sure you connect as Media Device.
  • image

  • Executing “adb devices” command from your “<SDK>/platform-tools” directory.
  • You will be prompted to verify RSA key form your connected machine, confirm that.
  • Now you are all set, you should be able to directly run your app from Android Studio and choose your Android device.
  • image

Bootstrap with jQuery Wookmark demo

Bootstrap is a JavaScript and CSS library for faster and easier web development. It has been fantastic so far. It does the hard work of prettying up menus, drop downs, buttons and tables with minimal input from a developer. Basically any developer could be a good website designer. Yes designing icons and images still has to be done by designers. Bootstrap has been a phenomena ever since twitter released it more than a year ago.

I have created a sample application which uses Bootstrap to build the page layout, top bar and drop down menus. It then uses jQuery wookmark plugin to build Pinterst-style board with pictures. Currently it uses an API provided by wookmark  o pull beautiful images and show then in the board.

This is a very basic demo and could be helpful if you are thinking of getting started with bootstrap and wookmark.

It uses bootstrap 2.3.0, jQuery 1.8.3 and jQuery wookmark .1 available at the time of building this demo.

I hope you guys enjoy the demo. Let me know your thoughts on comments. Below is a screenshot of the application.


LG Nexus 4 phone still has a battery problem

It is the latest android phone from Google without the loads of bloatwares from vendors. And yes, $300 for a high-end top notch smartphone is a steal.

But, the fact is the fact, it still has battery issues. Yes, it is of course much better than those Samsung Galaxy S2 and older likes. But, if you compare with Galaxy S3, it seriously lags. I see my friend with S3 playing games all day long. However, same cannot be said about me with Nexus 4. I have to conservatively use it to keep it alive. If I can avoid hard core games like Need for Speed, then it can sustain a normal day with frequent email checks, facebook wall trolling and some arcade game play.

At the end, I absolutely love it and highly recommend it. At least I don’t have to worry about charging all the time as I had to when I had Galaxy S2.

Facebook web app authentication made super easy

First, you have to create an web app at and set canvas URL along with other details as always.

And that is all you need to do. There is no need to call their api for authentication. Instead FB will directly post a signed request to the canvas URL you provided while creating the app as soon as the app is loaded. Then, you can decrypt the signed request using secret key and ‘HMAC-SHA256’  algorithm. You can also use libraries like to do the job.

After decryption, you will get user_id, user details (country, age, language), OAuth token and some timestamps. Then you can use user_id for identification and token for further communication.

However, if the user has not authorized the app you will get null for user_id and token. Then, you can ask for authorization by redirecting to the authorization URL (e.g.{0}&redirect_uri={1}&scope={2}). 

You have to pass redirect_uri so that, FB returns the user to previous location and you can continue from there.

This is a very nice move by Facebook as it reduces dependency on external Facebook libraries vastly.

A small Facebook App that I created using above described technique is available at codeplex at

Also, it will be hosted at


Image with semi-transparent border

This is a simple CSS trick you can use to have image with semi-transparent border. Browsers do not support opacity property for border. 

This example includes the border inside the image itself as shown below.

Image with semi-transparent border

Basically, I had to create 2 containers, one inside another.

<div id=”container”>
        <div id=”inner-container”>

Then added CSS as shown below. The outer container has image as background and inner container has opacity. The width & height of inner container including border is equal to width & height of outer container, which gives an illusion of a single image with semi-transparent border.

    width: 150px;
   height: 113px;
    background-image: url(‘’);
    background-repeat: no-repeat;
#container #inner-container
    border: 10px solid;
    width: 130px;
    height: 93px;
    opacity: 0.5;

However, you can use rgba format like following example to have semi-transparent border. But, the border will be outside the image.

div {
    border: 1px solid rgba(255, 0, 0, .5);
    -webkit-background-clip: padding-box; /* for Safari */
    background-clip: padding-box; /* for IE9+, Firefox 4+, Opera, Chrome */

Nokia Lumia GPS sucks

Nokia drive was touted as a key feature in Nokia Lumia smartphones. It even allows you to download offline maps state by state. I thought the days of GPS devices were over.

When I got my Nokia Lumia 900, I went on to order a handle for Nokia Lumia so that I can snap it into my Camry’s windshield while it displays turn by turn navigation. The feature that caused Apple to develop its own mapping software and replace Google maps from its iDevices. I waited impassionately to receive the handle through free shipping from eBay. Finally it arrived and I tried it in a couple of short trips. After those two rides, it was clear that Nokia drive is nowhere close to replace Garmin or TomTom, not yet. 

The first basic problem is smartphones become really hot when you put in front of windshield in sunny day for hours. I haven’t tried it’s ultimate limit but I am sure at one point it will burst. Maybe something like those old Nokia mobiles :). So, smartphones got to deal with this issue if they ever think of replacing good old GPS devices.

The most important problem is that it just can’t locate you. Yes, if you are in a road with multiple parallel roads which cross at some point or under an overhead bridge, then the location pointer keeps jumping from one road to another. Which means recalculating route every few seconds. It almost got me into trouble. Which means, basically you cannot use it unless you know the route enough and are using Nokia drive for secondary help only. I am guessing it is more of a hardware issue than a software glitch as other apps also have trouble getting location information quickly.

However, it does have one nice feature. It warns you whenever you cross speed limit. And it does it quite accurately. As soon as you cross a speed limit post, it updates and warns you if necessary.

In any case, the inability to locate user accurately is a deal breaker for me. Apparently there are many users facing similar problems. Hopefully Nokia will gain some wisdom and not make same mistakes again and again.

Nokia Drive

tablet is an ereader plus much more distractions

I had a Kindle Touch ereader since a year ago and I loved it. I took it everywhere I go. I read in my train ride to the office. I read in my lunch time at the office. It had changed my life in some way. But, about a month ago, I bought a Nexus 7 tablet. And it again changed my life in some other way.

I almost completely stopped using my Kindle ereader. I spent much more time in tablet than I used to in Kindle. Mostly, checking email, reading news through Pulse app, facebooking, playing Bad Piggies and Hot Pursuit and then back to checking email, reading news and so on. It is an endless loop of surfing web without any purpose. Even if I try to read book from Kindle app in my Nexus, I get easily distracted. And also ereader provides superior experience when it comes to reading book.

The main culprit here is the speed of Tablet. With 5 cores processor, 1 GB RAM, 8 GB Storage, Nexus 7 is blazing fast when it comes to loading games, web pages, emails. It allows quick switching between apps which leads to continuous switching and thus distraction.

Unlike tablets, ereader is a much slower device given its hardware constraints. Even turning pages, navigating to home page, scrolling through the list of books, browsing Kindle store is much slower. Browsing web page is an awful experience. So, you end up sticking with one book until you finish it. 

If you have a tablet, there are good chances that you almost always use it in bed before good night’s rest.The problem is that tablets have glossy backlit screen which causes headache and sleeplessness. Also according to recent article in, these backlit tablets suppresses melatonin thus increasing sleeplessness. 

Nexus 7 Pulse News app

Cheap plastic boxes from Samsung Galaxy line up

I always wondered what’s the deal with cheap plastic cases used in Samsung Galaxy smart phones despite being world’s most advanced smart phones. It makes whole experience bad. 

It makes phone significantly lighter thus feels like cheap device. Also, back cover can be easily opened to replace sim or battery which goes against closed container idea around iPhone and Nokia Lumia cases. Also, it might easily break if you take out and put it back quite often. Nokia Lumia and iPhone also have scratch resistant superior quality casing. 

It seems that millions of buyers have proven that phone’s case does not matter much. Samsung keeps on adding features so that, it could boast against other phones on feature by feature comparison. For example: Samsung’s recent “It does not take genius to figure out” ad where it shows feature comparison with Apple’s iPhone.

But it is about a good feeling. Having paid substantial amount to buy world’s most advanced smartphone, a consumer may not except a smartphone which feels like cheap plastic box.

In Steve Jobs biography, he has mentioned several times that it is equally important to polish hidden side of a product even if that side won’t be directly visible to consumer. He applied this idea everywhere from painting backside of wooden rail to designing internal parts of a Mac.I hope Samsung can learn a lesson from there and also focus on these small features. Even though it cannot boast on this feature immediately, in longer term it will pay off. It will improve brand image and set a level of expectation from Samsung in consumers mind. Otherwise, consumers will think that Samsung produces devices of varying quality and it is necessary to examine every product they buy.

Samsung Galaxy back cover

Why is Google still selling defective Nexus 7 tablets

When Nexus 7 came out, many tech enthusiasts announced it as the best Android tablet. It sold out immediately. Online orders began to pile up. Then, consumers began to report defects on Nexus. Mainly glass separation, light bleeding defects. The defects were widespread. A consumer reported on AndroidCentral that he received 7 Nexus tablets one after another and all 7 of them were defective. After 7th tablet, Google is refusing to issue new RMA.

I believe him. In fact, my friend also got Nexus with glass separation issue few months ago and the one I got 2 weeks ago also had the same defect.

Despite fire outcry from tens of thousands of consumers, Google and ASUS have not taken any action to remove defective tablets from their store. It sucks. It really does. I understand that they have very thin profit margin. But then again, you cannot screw consumers even if that means taking loss or increasing end price. Apple has made a empire on happy consumers. 

Google never gets it.They just want to develop new cool technologies without bothering about implementation, adoption and consumer support. When Google Nexus smart phones came out, customer support was a nightmare. It has happened with many other Google products that failed. This is the area where Apple has always excelled in. They have very well designed products, very well managed stores and good customer support. A tight integration end to end. iPhones have few features, smaller screens compared to similar Android phones. But still, thousands line up outside Apple stores every time a new iPhone comes out. So, consumers are very important part of the equation. It is hard to gain consumers but easy to lose. So, mind it Google.:)

Nexus 7 glass separation issue

my experience with a fraudulent merchant from Wisconsin

I was looking for a DSLR camera with a limited budget and I almost bought it from a prospective fraudulent merchant from Wisconsin. The deal was too good to be true. A DSLR Nikon D3100 was listed for $300 while its regular price was around $550. They go by the name Viable solutions. Their website show a physical address which turns out to be a luxury apartment in Milwaukee, Wisconsin.

Despite the doubts, I called them at a phone no. listed in the website and asked if the item listed in website is still available. A guy with an accent (probably the owner) picked up the phone. The tone was rude.I heard keystrokes from other side which felt like he is trying to search the item from the inventory. After few seconds, he told me that it is still available and I could order from the website. 

A quick check from showed that their website was registered just 14 days ago at the time I was about to make purchase. Also, the site was plain & simple, probably hosted in (a cheap hosting provider) and constructed using template from So, basically anybody, even without much technical knowledge, can setup a site like that. It was huge red flag.


I read many stories of other fake merchants from Internet. Since this one was new, I could not find any stories on them. Despite the red flag from and horror stories, the deal was too good to ignore. 

So, I tried to make payment through their site using Paypal. It failed. I found a contact email address (of course from free email provider)  from their ‘contact us’ page and informed him (probably the same guy on phone) about payment failing. He said that they are having issues with their credit card and Paypal payment processing. (I wonder why would he ask me to make payment from their website during phone call. Probably to show that they are legit.) So, he asked to make payment from Western Union and to find out a local Western Union agent. But, I asked him if I could make payment to his bank account or Paypal account directly. However, he was sticking with Western Union and offered me help to locate nearest Western Union agent. May be he thought I don’t know Google Maps :). He also mentioned that I could make payment from Western Union using credit card. I contacted Western Union chat support to know if payments made through them are revocable. The support guy said that they are in the business of securely transferring money but not in handling disputes and revoking. However, he mentioned a certain complex clause where I can raise a dispute. 

With so many doubts, I asked the New Solutions guy that why he cannot accept paypal payment directly. I can understand technical problems with their slow website. He said that his Paypal account is under editorial review due to excess funds. He forwarded me a link to where his company was listed as a company providing computer related services in that area. He also sent me payment details for Western Union Money transfer. The receiver was an another new person from Alda, Nebraska. Totally different state than what Viable Solutions are supposedly located. That was also a huge red flag.

Knowing that there is less than 90% probability of getting the purchased item, I still made the payment through Western Union money transfer online using credit card. But, since my account was just opened and not verified the payment was pending. I was supposed to wait until a WU transaction with a code appear in my credit card (24 to 48 hrs) and use that code to verify my WU account. Only then my payment will be processed.

The delay turned out to be a lucky one for me. I get a chance to think it through. Earlier, I was so eager to get the camera in cheaper price before other gets it. I did some Google search and found out that the fraudulent merchants ask payment from WU so that, it cannot be revoked and traced back which is what exactly happened with me. I immediately cancelled the pending transaction from WU and wished the guy good luck with other stupid customers. :).

While doing further research, I noticed very few people have actually purchased from merchants like these. And very few of them actually got the right product. Many were sent multiple quantities of same product and charged for it. 

I also noticed many websites with similar looks and feel and listing similar products from ‘Google Shopping’ search.They even have same names for online chat support person. Most of them are originated from outside US (like China or some south american countries) according to These are the sites which come at top in Google Shopping search with excessively low rate when you order the list from lowest to highest price. All of these clues clearly suggest that they are fake and waiting to get our hard-earned money illegally.

All these sites which list deeply discounted items are highly suspicious. It is likely that some few are legitimate but most of them are either bypassing taxes or screwing customers some other way. It is always a good idea to do some research on the physical location of the company, website review (from sites like, other customers experience with them and payment method. Hopefully, Google will remove these sites from their search results in the near future. Happy shopping. :)

[Update] It turns out that a consumer is tricked to buy 4 TV’s from them.