Sunday, June 12, 2011

First NBA title for Dallas Mavericks !!!

Today is the day - the day that every Mavericks fan will remember for their lifetime. The day when Mavs bring home the best gift of all times - first NBA championship.

And the best thing is, it was not a one or two men show. Every player demonstrated great team work this season. And with last two games, Mavs indeed proved their superiority.

Congratulations Mavs! And very proud to be a Mavs fan !


Sunday, June 5, 2011

Adding Aspect to Android

Following post done a nice job at explaining how to introduce aspects in android world.

Pune GTUG: Adding Aspect to Android

I gave it a try and it worked like a charm with some modifications. I have listed my modifications below just to save them safely. Two thumbs up for the original authors !

To make this work,

  • I installed AspectJ 1.6 version and added "/Users/nehameht/aspectj1.6/bin" to my PATH.
  • renamed all .properties files and build.xml file with .bk extensions to save their contents for later use.
  • Executed "android update project" command to generate build.xml.
./android update project --name HelloWorld --target 8 --path /Users/nehameht/Downloads/android-aspectj
  • Verified (and modified if needed) .properties files to point to my android sdk and AspectJ install locations
target=Google Inc.:Google APIs:8
  • Added following sections (whole XML nodes) from the saved build.xml.bk file to new generated build.xml.
<property name="aop.output" value="bin/aop"/>
<taskdef resource="org/aspectj/tools/ant/taskdefs/">
       <pathelement location="${aspectj.home}/lib/aspectjtools.jar"/>

<property name="external.libs.dir" value="libs"/>
<property name="external.libs.absolute.dir" location="${external.libs.dir}"/>
<!-- extension targets. Uncomment the ones where you want to do custom work
     in between standard targets -->
    <target name="-pre-build">
    <target name="-pre-compile">

    [This is typically used for code obfuscation.
     Compiled code location: ${out.classes.absolute.dir}
     If this is not done in place, override ${out.dex.input.absolute.dir}]
    <target name="-post-compile">
<target name="-post-compile">
<echo message="Weaving aspects to .class files before dex converts .class files to .dex file"/>
   <iajc destDir="${aop.output}" Xlintwarnings="true" showWeaveInfo="true" target="1.5"
           <pathelement location="trace.lst"/>
           <pathelement location="${out.classes.absolute.dir}"/>
           <pathelement location="${aspectj.home}/lib/aspectjrt.jar"/>
           <fileset dir="${external.libs.absolute.dir}" includes="*.jar"/>
           <fileset dir="${extensible.libs.classpath}" includes="*.jar"/>
           <path refid=""/>
<move file="${out.classes.absolute.dir}" todir="bin/classes.old"/>
<move file="bin/aop/com" todir="bin/classes"/>
  • After this "ant install" worked just fine. And I was able to verify the traces thru logcat.