Thursday, April 23, 2009

Android Training at Skills Matter in London

May is a big month as we will be launching my first Android course on the international stage!


I've worked for quite some time now with my partner Ricston to develop this course for developers. Ricston have years of experience developing and delivering courses for open source and in 2008 they invited me to work with them to draw on my extensive Android knowledge and experience to create a series of courses for engineers that want to build applications on this exciting platform.


I will be in London to deliver the first course on May 27 at Skills Matter - for more information you can download a course description and find further information on the course on the Ricston or Skills Matter sites. The launch is being offered at specially reduced rates - 50% off! - for this first course so take advantage of this great offer!


I hope to see you in the classroom in May.

Tuesday, April 14, 2009

Android Top animations

You may have read a previous post about "Android Top", an my experiments about custom widget creations.
Well, here in this sample video you can find a rather funny animation when you long touch on the VU Meter face.

video

This is shown in the emulator and that's why CPU usage increases so high when the animation takes place.

PS: I need to find a better image for VU Meter's back. If you have one to contribute it's gladly welcome.

Monday, April 13, 2009

Android frame by frame animations

Frame by frame animations are traditional animations in the sense that they are created with a sequence of different images, played in order, like a roll of film. The AnimationDrawable class is the basis for frame animations.

This is a sample video of the Android Earth Animation application:






video

The animations is presented as a Button background and every time you touch it the animation stops and next time the rotational direction is changed (prograde and retrograde motion).

Usually, these animations are defined in XML resource files in the res/anim folder, using the tag and including the drawables composing th e animation.

Some information can be found at Android developers: Frame Animation, however if you want to automatically start the animation when the Activity is just started you'll find a hard time.
You may think that you can start the animation in onCreate or onResume, but it's not going to work.
The simplest solution is to delay the animation start using a timer in onResume:


/* (non-Javadoc) * @see android.app.Activity#onResume() */ @Override protected void onResume() { super.onResume(); (new Timer(false)).schedule(new AnimationTimer(earthButtonAnimation), 100); }



Where AnimationTimer is defined as


private static class AnimationTimer extends TimerTask { AnimationDrawable animation; public AnimationTimer(AnimationDrawable animation) { this.animation = animation; } @Override public void run() { animation.start(); this.cancel(); } }


As usual you can install or download the application or its source code from http://codtech.com/downloads/android.
Hope this helps and save you some time.

UPDATE:


Latest code, including some of the contributions, can be found at github.
Fell free to send me patches and corrections.

Android Tutorial at Linux Symposium

I will be presenting an Introduction to Android development tutorial at Linux Symposium (Canada) from July 13th to 17th 2009.
This year also marks the first year that the Symposium will be happening outside of Ottawa and Centre Mont-Royal in Montreal was selected as the 2009 venue.
Linux Symposium is celebrating 11 years of bringing togheter Linux developers, industry professionals, and enthusiasts from over 30 countries.

Don't miss this opportunity if you are interested in knowing more about Android development.

Saturday, April 11, 2009

Android Top

I'm experimenting creating some custom widgets and one is the VU meter, and I'm trying to make them behave more or less like real ones. The most interesting characteristic of VU meters is their slow measurement averaging out peaks.
In this simple example (see video) instead of measuring loudness I'm measuring CPU and memory usage.

video

CPU and memory consumption are obtained from kernel's /proc filesystem and top command.
Buffers and Cached memory can be excluded or included from the count long pressing on the memory VU meter.
While the application was running a background process was launched and thus why the CPU usage increases.

I've found this example interesting and wanted to share it.
I hope you find it interesting too.