# Frequent Problems Raised in Android Programming

This post lists some problems appears frequently during Android developing.

Sometimes, when you want to installed your app on your smart phone with Eclipse running. It seems your computer has not detect your phone.

This is because there are some alternative Android USB detectors are running on port 5037. Such as tencent’s tadb.exe.

You will have this error message when you run adb start-server:

C:\Users\xxxx>adb start-server
adb server is out of date.  killing...
* failed to start daemon *


We can use this snip to check which process is occupy the port tcp:5037

C:\Users\xxxxxx>netstat -ano | findstr "5037"
TCP    | 127.0.0.1:5037  | 0.0.0.0:0       | LISTENING   | 4236
TCP    | 127.0.0.1:5037  | 127.0.0.1:49422 | ESTABLISHED | 4236
TCP    | 127.0.0.1:49422 | 127.0.0.1:5037  | ESTABLISHED | 3840


Just kill the process 4236 then you will run adb.exe successfully.

##2. Animation run twice in listview

This is a programming mistake.

photoToLoad.imageView.startAnimation(myFadeInAnimation); //Set animation to your ImageView


But when I did so at the first time, the animation run twice for one ImageView. The 1st time is when the image’s top boundary shown up on screen; the 2nd time is when the image’s bottom bundary shown up on screen. It’s wired, right?

This is because the same animation was called again by the next ImageView. So, the 2nd time of that animation was actually caused by the next Image’s top boundary.

Why this happened? Finally, we found I had made a mistake on set the myFadeInAnimation variable as a shared one in our ImageLoader class. So, the same myFadeInAnimation will be called by different imageView.startAnimation() function. It happened to be twice was because our images are too big that one screen could only hold two such images at the same time.

Here I should create a new Animation every time when I want to add it to an ImageView.

Animation myFadeInAnimation = new AlphaAnimation(0, 1);