Archive for the ‘android’ Category

android: workaround for slow ‘building workspace’ problem in eclipse

While developing for android on eclipse 3.6 i had the problem that each time i saved a file, eclipse blocked me several seconds with ‘building workspace…’. Similar to these:

stackoverflow – android-compilation-is-slow-using-eclipse
stackoverflow – android-eclipse-workspace-takes-a-long-time-to-build – android-developers/thread/a16202975510de39

The best workaround i found for me:

  • disable Android Package Builder (right-click on project#Properties#Builders)
  • use ant build to deploy on emulator

This way i can work (as) fast (as usual) with eclipse, everything compiles and gets generated, but once i want the app on the emulator, i execute ‘ant install‘ from console.

Setting up the ant build is quite easy, see using-ant-to-automate-building-android for details.
In short you have to simply execute ‘android update project --path .‘ which generates your build.xml.

Note: If you have 3rd party jars put them in ‘libs’ folder, that way ant is aware of them.

Note: You also can build a signed apk with ‘ant release‘. Add therefor a with such a keystore setup:

PS: i also stumbled into the ‘external folder’ synchronization problem. Closing all android projects and reopening again helped!