Building, Installing, Configuring The Android Platform and Android SDK on Ubuntu 9.10 64-bit x86

November 11th, 2009

Android SDK LogoUbuntu Logo

This post is about my battle of building, installing and configuring the Android Platform and the Android SDK on Ubuntu 9.10 64-bit x86. Insult to the injury, all that is happening in a VirtualBox VM on a Mac running Snow Leopard.

Please remember, this is NOT intended to be a step by step instruction manual. RTFM ;)

Follow the regular installation instructions and possibly throw in the following in the mix, when and if you have to.

You will need the Android Source to build (doh!). Here.

Obstacle #1. No Java 1.5.0 in Ubuntu 9.10. Gotta have it, otherwise Android “make” barely bothers to launch.

http://java.sun.com/javase/downloads/index_jdk5.jsp is a starting point. I grabbed the rpm build.

Assuming you have the “rpm” (otherwise apt-get install rpm), install the downloaded package. –force-debian –nodeps flags may be required.

Now you have Java 1.5.0 in place, you need to setup your environment properly.

1
sudo update-alternatives --install /usr/bin/java java /usr/java/jdk1.5.0_22/bin/java 50
1
sudo update-alternatives --install /usr/bin/javac javac /usr/java/jdk1.5.0_22/bin/javac 50

** change your jdk1.5.0 path if necessary

Getting close.

The “apt-get install” in the documentation http://source.android.com/download includes “sun-java5-jdk“, so take it out and run the command as follows:

1
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev

Try the “make” now.

Next is installing the Android SDK on Ubuntu 9.10. Grab it at http://developer.android.com . Unzip, move it around etc.

Starting with Android SDK r3, you need to pick and choose what you want to download and install. “./android” under the “tools” directory does that for you. However, every single time I tried this on my Macs, I got the “You might want to force download through HTTP in the settings.” error. So be it, go the the options, simply check the “Force https://… sources to be fetched using http://…” option and download happily ever after. This was a no-go in my Ubuntu 9.10. The trick to properly enable and utilize that checkbox is to run:

1
export GDK_NATIVE_WINDOWS=true

Now, you should be able to download the SDK without the https:// mallarky.

After all this, hopefully, you should be Android’ing in your Ubuntu box in no time ;)

Good luck.

Save My Ass – Clear Your Call & SMS History

November 9th, 2009

After getting a few very interesting emails, I decided that I should provide a bit of a historical and informal insight to those who might be curious about what that “Save My Ass” may be.

SaveMyAss (Save My Ass) a convenient way to clear the Call and/or the SMS records on the Android based phones. The delete (or purge) process runs automatically upon the app launch without further user intervention. The app either deletes  a preset number of messages set in the preferences, or by age (i.e. last 10 min, last 2 hours etc.).

Why did I build this app? Just because.  *this is the easy answer (i could’ve said, just for shits and giggles :) )

Why did I build this app? Just because, I thought it would be an interesting challenge. I worked extensively with Android Messaging app and SMS internals during the development of “Txtract – SMS Backup for Android“, “Save My Ass” would be the icing on the cake in terms gaining more expertise on Android.

Why did I build this app? About five months ago, I was about to get a ticket because a polica officer thought that I was on the phone while driving. I swear, I was not on the phone, or was not doing anything on my phone. I was pulled over, and I had to show the officer my call and message history to convince him that he stopped me for no reason. That incident was indeed the spark that made “Save My Ass” built. I don’t want to give anyone any ideas about how they may use the application. The rest is up to the users’ imagination :)

About the “Save My Ass” name; it’s supposed to be just funny and provocative. Nothing more, nothing less. I can only hope that no one will find the name offensive.

Docs @ http://wiki.brilaps.com/wikka.php?wakka=SaveMyAss

Support at; http://forum.brilaps.com/index.php?board=20.0

Senses Capture – Leaves’ Eyes

October 23rd, 2009

Senses Capture – Leaves’ Eyes and Yuna

I was simply testing YouTube’s “share to blog” option. One of my recent fave’d songs with a super cute video.

News Fishing – Stumblish Way of Browsing the Latest

October 11th, 2009

Since I introduced myself to Google AppEngine, I’ve always liked it. It’s truly a joy to develop on the AppEngine platform. Due to hectic work schedule, I wasn’t able to get my head around to thinking of a new toy project so I could get into AppEngine again. Well, this weekend I decided to take a break from work-work and build something on the side for a change.

When I was working on the NewsXperiment project, I was neck deep in the RSS/Atom feed world. All the news feed sources that I had accumulated for NewsXperiment was hanging around to be used for another purpose. So came “News Fishing“.

I needed a way to quickly peek at what’s happening “right now” without being lost in a jungle of “stuff” on a web page or in an RSS reader app. I wanted to see “one” news item at a time, and if my interest in intrigued I wanted to dig in more by clicking on the link to the original page. If not, keep fishing. That was my initial and only requirement and it turned out to be the premise of “News Fishing“.

On the techie – geeky side of things, News Fishing uses quite large set of features that are provided by the Google AppEngine platform; Crons Jobs, Task Queues, Memcache etc. I opted on using YUI 3.0 as the javascript library of choice on the frontend.

  • As I’m typing this, two mobile apps (for iPhone and Android phones) for News Fishing are in the works. ;)

http://newsfishing.appspot.com

http://wiki.brilaps.com/wikka.php?wakka=NewsFishing

Must Call This Function!

June 30th, 2009

I was going through some code refactoring today, and needed a certain set of classes calling a particular function during their initialization.

I needed the function to be absolutely (i mean absolutely) implemented by any deriving classes of the base object.

I needed the function called automatically, so I won’t have to remember calling it anytime I derive something new out of the base class.

So, here is how I accomplished this lovely must-call-this-function pattern.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
interface ISample
{
    public function makeSureThatThisFunctionIsCalled();
}

abstract class ASample extends TheParentClass implements ISample
{
    public function __construct ($someParams)
    {
        parent::__construct($someParams);

        $this->makeSureThatThisFunctionIsCalled();
    }
}

class Sample extends ASample
{
    public function __construct($someParams)
    {
        parent::__construct($someParams);
    }

    public function makeSureThatThisFunctionIsCalled()
    {
        // do whatever you need to do here....
    }
}

class AnotherSample extends ASample
{
    public function __construct($someParams)
    {
        parent::__construct($someParams);
    }

    public function makeSureThatThisFunctionIsCalled()
    {
        // do whatever else you need to do here....
    }
}

The code should be self explanatory for the OOP savvy folks. Here is a very short description of what happens here.

Our actual class “Sample” extends the abstract class “ASample” which in turn implements the interface “ISample” (don’t worry about extending the TheParentClass). Implementing the “ISample” will require us to actually implement the makeSureThatThisFunctionIsCalled() function somewhere either in “ASample” or “Sample” class. We need class specific implementation of the function, so “Sample” and “AnotherSample” classes implement it.

Oh great, yay! We enforced our derived classes implement a function of the interface. Big deal!

How will we make sure that “makeSureThatThisFunctionIsCalled()” function will actually get called ?

In this sample, all the deriving class constructors call their parent::_construct which keeps bubbling up to TheParentClass so on and so forth…

So, we simply stick in “makeSureThatThisFunctionIsCalled()” in the immediate parent’s constructor and tada !!!

Our must-be-called function is surely getting called during the object’s initialization.

This may sound like a glorified initializer, but you never know. You may just need something like this.

Suicidal Pattern and Observers

June 17th, 2009

The other day, I came up with a sort of bizarre idea of exception handling in PHP. Not so interestingly it may be, you’ll find out as you read, this design pattern is called “Suicidal Pattern“.

The idea is around an object throwing itself as “throw self” (actually throw this) and it’s own handler catching and handling and announcing to its observers.

And here it goes:

Read the rest of this entry »

MiaCMS 4.9 Beta Released

June 17th, 2009

MiaCMS released a beta version of the next minor release of the project, version 4.9.  The changes for this release are as follows:

General Changes:

  1. PHP 5 is now required (PHP 4 users must stay on the 4.8 branch until they can upgrade to PHP 5)
  2. Accessibility cleanup added
  3. PHPMailer upgraded
  4. Updated the MOStlyCE editor to latest TinyMCE core
  5. MOStlyCE support added for skins and content templates
  6. Added a new content bookmark component/module
  7. Added a new tag cloud module

JavaScript Related Changes:

  1. Fixed minor JavaScript issues identified with the 4.8 configuration
  2. Increased performance
  3. JavaScript now loads either in the document <head> or just before the closing </body> tag instead of scattered throughout the page; most of the time it will load just before the closing tag, since there are additional performance benefits to that method (http://developer.yahoo.com/performance/rules.html#js_bottom).
  4. Upgraded the Yahoo User Interface (YUI) from 2.6.0 to 2.7.0

Since the JavaScript architecture was fully rewritten with the 4.8 branch and again refined with 4.9, we’ve created a new starter doc on the wiki that details more about working with JavaScript (and YUI) within MiaCMS – http://docs.miacms.org/wikka.php?wakka=JavaScriptForDevelopers.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE

June 13th, 2009

Could it get any better ?

WTFPL – Wikipedia, the free encyclopedia.

The WTFPL (Do What The Fuck You Want To Public License) is an uncommonly used, extremely permissive free software license. The original Version 1.0 license, released March 2000[2], was written by Banlu Kemiyatorn who used it for Window Maker artwork.[3] Samuel “Sam” Hocevar, a French programmer who was the Debian GNU/Linux project leader from 17 April 2007 to 16 April 2008, wrote version 2.0.[4][5] It allows for redistribution and modification of the software under any terms—the licensee is encouraged to “do what the fuck [they] want to”. The license was approved as a GPL-compatible free software license by the Free Software Foundation.[1]


           DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
                   Version 2, December 2004

Copyright (C) 2004 Sam Hocevar
 14 rue de Plaisance, 75014 Paris, France
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

           DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
  TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

 0. You just DO WHAT THE FUCK YOU WANT TO.

Update

June 12th, 2009

It’s been a while that I’ve put anything in here. Busy times !

Big news of the previous months… I brought an end to the good old times at S1 Corp after 8 years, and I moved up to the Bay Area (a.k.a. San Francisco), and started working for eMeter Corporation with some brilliant minds in the software industry. I am thrilled. Moving was a %#$^ though. Still have lots of stuff left at Los Angeles to be picked up, sold, given away in the near future.

When I was dropping the moving truck back at the U-Haul, I was told “Welcome to the better half of California!”. Time shall tell.

Deming’s 14 points

March 22nd, 2009

So true !

  • Create constancy of purpose.
  • Adopt the new philosophy.
  • Cease dependence on mass inspection to achieve quality.
  • Minimize total cost, not initial price of supplies.
  • Improve constantly the system of production and service.
  • Institute training on the job.
  • Institute leadership.
  • Drive out fear.
  • Break down barriers between departments.
  • Eliminate slogans, exhortations, and numerical targets.
  • Eliminate work standards (quotas) and management by objective.
  • Remove barriers that rob workers, engineers, and managers of their right to pride of workmanship.
  • Institute a vigorous program of education and self-improvement.
  • Put everyone in the company to work to accomplish the transformation.

The points were first presented in William Edwards Deming’s (October 14, 1900 – December 20, 1993) book Out of the Crisis (1986)