Archive for the ‘Eclipse’ Category

Eclipse.ini Settings

Posted: May 10, 2011 in Android, Eclipse, Java

Usually, a good portion of new android developers have trouble with Eclipse.ini settings as java VM settings have changed over the years and there is a mess of legacy and new settings. This gist of my eclipse.ini settings is for multi-core and tested on MS Vista 32-bit, AMD 2-cpu-core 2.6 GHZ, 4 gig ram, and Eclipse 3.7.

It seems that now the choice of GC is more important whereas the G1GC is somewhat problematic as far as performance. I ended up using -XX:UseParallelGC instead. To give you an idea, about 20 small projects in workspace and startup time to using the IDE is under 1 minute. Obviously, the more cpus would improve performance and bigger projects will impact the startup time due to the ADT plugin scanning/building the projects on startup.

On Linux with JDK6 I had used G1GC settings in the eclipse.ini and that was problematic as far as performance on the same exact computer hardware so I assume that changing to using ParallelGC instead for Linux should also work.



Posted: May 4, 2011 in Android, Eclipse, Java

Although refactoring features are already included in ADT and install sdk functionality might be appearing in ADT 11.0, you will rest of these adt-addons eclipse plugins useful to android development.

The one I use right now is adding sources to the android container in my android projects.

Hello everyone.  Sometimes you will see a Dalvik failed to convert error 2. What is happening is that one Eclipse IDE ini file JVM setting in combination with using JVMs from Oracle 1.6.21 or later causes this conflict.

The work around is to remove -XX:+AggressiveOpts from your ini file JVM settings.

IDE Performance Tunning

Posted: March 7, 2011 in Eclipse, Java
Tags: ,

Usually when people refer to IDE performance tunning such s Eclipse they only talk of changing the Eclipse .ini file. If you are lucky to be using Eclipse under Linux there is one more setting that helps. That is change the priority form zero to about negative 5(-5) which tells the Linux OS to give more or higher priority to the Eclipse IDE which in turn results in less time of the IDE being ‘paused’ to about down to zero times it being paused.

I would imagine once you launch the android emulator you can also set its priority to about -5 with the same effects.

First, if you are running android tools 8.0.1 from eclipse than everything works fine. Second, to run build using android tools 8.0.1 or higher outside of eclipse you must use ant 1.8.1 or higher. Most Linux version in theri beta/test repos already have compiled ant 1.8.1 binaries to install to run ant 1.8.1 form the command line.

My AndCooperANT set of build is being kept pre-ADT8, the new ADT8 or higher project is named IndianaANT and will be up in days.

Now for some other good news, it appears that ADT 9.0 may be pushed out December 20th as it fixes some minor bug issues. One of the changes is an ant version check in the custom task.

As far as eclipse, it will not have ant version 1.8.1 until very late in the 3.7 testing cycle and I doubt if eclipse 3.6.2 will include ant 1.8.1. Thus, since ADT 8.0.1 runs fine in eclipse without ant being upgraded in eclipse the best option is update your ant install if you run builds outside of your IDE. If you have not switched your build run outside of IDE to ant 1.8.1 you will notice the side effect of 3rd party libs not being included in the dex and that is due to some behavior changes between ant 1.7.1 and ant 1.8.1.

Enhanced by Zemanta

The New ADT

Posted: November 22, 2010 in Android, Eclipse, Java
Tags: ,

Ah I think Google plans a nice x-mas present for android application developers in the form a new and improved ADT plugin. Visual Editor now has drag and drop! Proguard fully included. Heirarchy viewer no longer regulated to command-line as you will view it using the new ADT plugin. And also clicking on lines in logcat takes you directly to code.

Dario Laverde has more coverage at his first blog post.

Enhanced by Zemanta

So I am on the last part of the AndCooperANT journey of adding Android NDK support that set of android application build scripts. So I am using Eclipse 3.5 and Android NDK r4b and need to set up a sample project to test my build scripts.

Here is how I accomplish that so that I have an Eclipse CDT nature within an eclipse Android SDK application project that actually uses the NDK build system and also gets rid of that annoying CDT no gnu makefile at project with all target error…

1. Right click on project root and New Project->Other->C++->Convert to C++

2. check C++ project choose Makefile and choose other toolchain

3. Say yes to open C++ perspective.

4. In C++ perspective create new folders of libs, obj, and jni

5. In C++ perspective under C++ General set output folders under paths to libs and obj and set source folder to jni.

6. In C++ perspective right click project root and select properties than choose builders:

un-check everything on the CDT builder

create a new builder type of program

If using Linux than its

First box ndk-build script location

Second box is project location

Third box is these args: -C ${build_project}

If using Windows the settings for that builder wil be the ones this blog post covers:

Now what you should see is after that go to Eclipse project menu and choose Build Project and you should this in your console:

Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: /home/fredgrott/my35ws_github/AndCooperANTNDK/jni/
make: Entering directory `/home/fredgrott/my35ws_github/AndCooperANTNDK’
make: Leaving directory `/home/fredgrott/my35ws_github/AndCooperANTNDK’
/home/fredgrott/opt/android/android-ndk-r4b/build/core/ *** Android NDK: Aborting…    .  Stop.

Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: /home/fredgrott/my35ws_github/AndCooperANTNDK/jni/    make: Entering directory `/home/fredgrott/my35ws_github/AndCooperANTNDK’make: Leaving directory `/home/fredgrott/my35ws_github/AndCooperANTNDK’/home/fredgrott/opt/android/android-ndk-r4b/build/core/ *** Android NDK: Aborting…    .  Stop.

Now click on the problems tab in Eclipse and you should see no pesky CDT no makefile with all target error in that at all in fact you should see an error count of exactly zero.

Enhanced by Zemanta

Okay, time for some more eclipse tricks. Create new project, do not click finish yet!  Uncheck the default location and browser and select the parent project folder and in the address bar of project location type /test and you will see:

Correction: Name Project ParentProjectNameTest, ADT plugin will show an extra project at workspace root(you can ignore that as its not an actual project its not in file explorer on your SystemOS etc.)

If you use build scripts than the tested.project.dir property will change with the test build script in the test directory as it will be a relative location to the parent project. If you use a different IDE, I am assuming you can do the same trick with the IDE Android plugin you have.

Well, if you are using a DVCS like Git you are already using the do not default location to get all your DVCS stuff in one sub-folder for all projects anyway and thus its just an extension of that technique.

Enhanced by Zemanta

WARNING this is not for the faint-of-heart! It will break upon SDK revisions! Because it might result in more work for  GoogleOHA Engineers they might discourage it! WARNING, THIS ONLY WORKS WITH ECLIPSE! If you look at the SetUP Ant task code you will find that it checks for an number with a max value of 3 set at this time. The value is stored in the file at the root of the platform version folder.

Now, here is the trick. Change the number to the max which is 3. DO NOT STOP YET AS YOU ARE NOT DONE. Copy the complete set of ant_rules_r2.xml, ant_libs_rules_r2.xml, etc and change the copy names to use r3.  Add the new obfuscate target making sure to add the other stuff such as Proguard config checking, etc. Now change that dex target by setting depends to include the obfuscate target you added after the compile target in that depends line.

Now, fire up Eclipse and compile all you want knowing that its being obfuscated automatically. Neat huh? FINAL WARNING, I HAVE NOT TESTED THIS WITH ANDROID LIBRARY PROJECTS YET!

I found it as I was looking at ways to decrease the ANT build script code I was writing and I really did not want to re-invent what Google/OHA were already doing with anttasks and android development tools. Its not the tools folks, despite what Joe Hewitt claims. Its the knowledge of hacking up the tools to do what you want!

Enhanced by Zemanta

Classes Source for Eclipse

Posted: June 30, 2010 in Android, Eclipse
Tags: ,

Okay folks, I have uploaded to dropbox classes source for 1.5, 1r3.6r2, 2.0.1r1, 2.1r1, and 2.2r1:






Unjar or unzip them into the sdk/platform/sources folder that you create and Eclipse than will recognize them.