Create custom button in Android using XML

How to create custom button in android using xml style file . which is placed on drawable folder .Now, just create shape of the ImageButton to have black shader background.android:background="@drawable/button_shape"and the button_shape is the xml file in drawable resource: <?xml version="1.0"...

What is Context in Android?

Interface to global information about an application environment. This is an abstract class whose implementation is provided by the Android system. It allows access to application-specific resources and classes, as well as up-calls for application-level operations such as launching activities,...

Android error: Failed to install *.apk on device *: timeout

Do most important this, when your faced this problem, lets hope you have to through away this problem.Try changing the ADB connection timeout. I think it defaults that to 5000ms and I changed mine to 10000ms to get rid of that problem.If you are in Eclipse, you can do this by going through Window->...

Jar Mismatch Found 2 versions of android-support-v4.jar in the dependency list

Step #1: Undo all that. If you are messing with the build path, on R16 or higher version of the ADT plugin for Eclipse, you're doing it wrong.Step #2: Pick one of those two versions of the JAR, or pick the one from the "extras" area of your SDK installation.Step #3: Put the right JAR in App Library.Step...

How to disable orientation change in Android?

Some of the application that if you want to disable orientation in android, then try some of the tricks, which is not 100% working all level of API.In Stackoverflow, Intrications   give most reliable and useful answers, Add android:configChanges="keyboardHidden|orientation" to your AndroidManifest.xml. This tells the system what configuration changes you are going to...

How to create Transparent Activity in Android?

You have to add the following style In your res/values/styles.xml file (if you don’t have one, create it.) Here’s a  gnobal code from stackoverflow.<?xml version="1.0" encoding="utf-8"?><resources> <style name="Theme.Transparent" parent="android:Theme"> <item name="android:windowIsTranslucent">true</item> <item name="android:windowBackground">@android:color/transparent</item>...

Problem: Android : CalledFromWrongThreadException;: Only the original thread that created a view hierarchy can touch its views

Avoid performing long-running operations (such as network I/O) directly in the UI thread — the main thread of an application where the UI is run — or your application may be blocked and become unresponsive. Here is a brief summary of the recommended approach for handling expensive operations:Create a Handler object in your UI threadSpawn off worker threads to perform any required expensive operationsPost...