Recently I was into a problem when I was unable to center screen two Android buttons, in a simplest way. My Google skills failed me to find a simple way, so I had to figure it out myself. I wanted my buttons to be centered horizontally and vertically on the screen. And those buttons would have certain widths. Like this one:

USB Debugging Mode for Android Device is a must when developing an Android application. It will save you a lot of time when debugging and executing your application. Please note that USB Debugging option might be disabled when your device is already connected to your PC. To enable it, you must disconnect it first and follow the steps given below.

When you are able to check or enable the USB debugging mode option in your Android device, you would want to verify if your PC also detects it for your development. To do this, we have to follow the some simple steps.

There was time when I was trying to run my Android code to my device but it seemed not working. One of the things I thought that causes this was if my Android device is really connected or attached to my computer. So I had to verify if it was. I’m using windows, so here’s what I did:

1. Execute the command prompt (cmd.exe)

2. Go to your Android SDK platform-tools directory. I had to execute cd c:Program FilesAndroidandroid-sdkplaform-tools in the command prompt

3. Check if ADB is present by executing adb, if you got those data rolled down, ADB is working fine.4. See if your device is attached by executing adb devices, You should see your attached devices which look like something like this:

Click to enlarge.

If no device was attached, you’ll receive a message of something like “Waiting for device”.

This is also where you can execute theADB logcat which will make your life easier when debugging your Android App.You can do that by executing adb logcat