Make Eclipse and Android Studio play nice with the same Android SDK

Are you using both Eclipse (ADT) and Android studio for developing Android apps? They both come with their own SDKs, and maintaining two SDKs separately can be quite painful. Here is how you set both IDE’s to use the same SDK. Create a new common SDK to be used by both IDE’s First, you have to set up a common SDK. You can either download a new SDK, or use the one that came with either Eclipse/ADT

» Read more

How to fix the DrawerLayout inflation error in Android

If you are trying to use the DrawerLayout in your Android app(perhaps from the example project?), and your app is crashing when you try to run it, and you are getting a lot of errors saying Caused by: android.view.InflateException: Binary XML file line #1: Error inflating class android.support.v4.widget.DrawerLayout or something like: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.android.navigationdrawerexample/com.example.android.navigationdrawerexample.MainActivity}: android.view.InflateException: Binary XML

» Read more

Admob for Android gives error on AdActivity android:configChanges

After experimenting with Admob for Android, I came across an error with the example code that can be downloaded from the developer site about advertising. The error Eclipse gave me, was: You must have AdActivity declared in AndroidManifest.xml with configChanges. and that android:configChanges had to include screenLayout, uiMode, screenSize and smallestScreenSize. After modifying the AdActivity tag in the Manifest file, from: <activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation" /> to including the

» Read more

How to easily switch to Sublime Text 2 theme (or other themes) in Eclipse

If you want a different theme and syntax highlighting for your code in Eclipse, or if you are just tired of looking at text at a white background and want to try something new, you can easily switch to a different theme. Download and install the Eclipse plugin called Eclipse Color Themes. It can also be installed via the Eclipse update manager: In the top menu, go to Help -> Install new Software -> Add source and enter the plugin

» Read more

What to do when Eclipse fails to detect your Android emulator

If Eclipse fails to recognize your running Android emulator (no visible emulator in the DDMS view for example), you might see an error message in the console window like this: [2012-12-19 07:53:37 – adb] ADB server didn’t ACK [2012-12-19 07:53:37 – adb] failed to start daemon And you get an Adb Error dialog, saying: Adb failed to restart! Make sure the plugin is properly configured Like pictured below: You can solve this problem with the following steps:

» Read more

Eclipse ADT has been updated. Brings nice features!

I just noticed throught Eclipse that ADT had been updated. The new ADT version brings some nice touches to the layout editor. Now you can select items and drag and drop them onto the layout. It’s a nice touch that will certainly help new android developers a lot. To get the new features, in eclipse go to Help and then Check for updates. You can read more in the ADT changelog. They have also tweaked the XML formatting. Which

» Read more

The easiest way to create nice icons for Android apps

In this article I will show you a very easy way to create nice looking icon drawables you can use in your Android applications. Using this method we can easily skip through the difficult and time-consuming parts of creating icons. Yes, I know this method does not work for everyone, some Android developers have their own designer and so on, but for a small and simple app, this will definateley do! The problem Creating icons for Android apps may sound

» Read more

How to easily extract strings from your Android code into the strings.xml file

This handy little feature can save a lot of time and manual work when working with Android apps. If you during Android development in Eclipse use hardcoded strings in your java code, like in the example below: package test.layout; import android.app.Activity; import android.os.Bundle; import android.widget.Button; public class LayoutTest extends Activity { private Button btn; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); btn = (Button) findViewById(R.id.Button01); btn.

» Read more

Formatting Android XML files in Eclipse

The XML auto formatting in Eclipse ADT is currently not working properly. When I am working on Android apps with big XML layout files in Eclipse ADT, the XML tends to get a little cluttered, and sometimes the many attributes ends up on one single line like this: With attributes on one line. It Looks bad, and has low readability. This makes reading the XML layout far more difficult than if they were all ligned up properly below each other.

» Read more

How to try out the new Android 2.3 – Gingerbread!

As Google just recently announced the Nexus S from Samsung, which is running the new Android 2.3, known as Gingerbread, I wanted to have a look at the new OS for myself. Gingerbread comes with lots of new nice features and improvements, you can read about them here. Or you can watch the official video, to get a quick overview: Altough testing the OS in an AVD, does not compare to the real device in terms of speed and

» Read more