After various attempts, I’ve finally figured out how to compile the android source code on Mac OS X 10.6 Snow Leopard. It works on both 64-bit and 32-bit kernels. Here are the steps.

1. Install XCode, Macports, repo, etc.

I assume everyone knows how to do this. Follow the instructions from the Android source page. Just remember to create a new partition that is a case-sensitive partition if you’re using a non case-sensitive primary partition. I’ll start off after you’ve gotten the source from git.

2. Get the following patches.

Notice that I didn’t use “repo download” to get those patches. I realized that repo sometimes “undo” the patches when you download another patch. All bash commands start at the root of your Android source directory.

Patch 12074 - Change Ic4caeff0: Enable building on java 1.6 without conflicts.

This patch will allow you to use Java 1.6 that comes with Snow Leopard instead of Java 1.5.

cd build
git pull git://android.git.kernel.org/platform/build refs/changes/74/12074/3

Patch 11845 – Change I155a531a: Add x86-64 checking for Darwin

This patch will add x86-64 checking for Darwin.

cd system/core
git pull git://android.git.kernel.org/platform/system/core refs/changes/45/11845/3

Patch 11846 – Change Id241a12d: Force gcc-4.0 for qemu build on Mac OS X

This patch allows qemu to build.

cd external/qemu
git pull git://android.git.kernel.org/platform/external/qemu refs/changes/46/11846/3

Patch 12597 – Change I0a8c2440: Use intptr_t for args expecting pointers

This patch allows libacc to compile.

cd system/core
git pull git://android.git.kernel.org/platform/system/core refs/changes/97/12597/1

3. Build and watch it fly.

make

I haven’t quite tested the image files and binaries but it seems to me like it works pretty well. Now to get my hands dirty and start messing around with the actual code.

Oh and remember, every time you do a repo sync, you might have to reapply some of the patches. I’m not too sure why. If there’s anyone who understands git well enough, please explain.

(UPDATE): New updated blog post for Android 2.1 – Compiling Android 2.1 Eclair Source on Mac OS X 10.6 Snow Leopard

 

I want to bring in the new year with this code that doesn’t seem all very harmful, but could be written in a more elegant way. I just hope this will educate people on some of the new functional additions to C#.

public List<int> GetListOfIntegers()
{
    List<int> list = new List<int>();
    for(int i = 0; i < 24; i++)
    {
        list.Add(i);
    }
    return list;
}

At its very core essence, this is simply creating a list of numbers from 0 to 23. However, try to find out the various possibilities of mistakes one can make with this code. I’ll leave it as an exercise of the reader to figure out all the possibilities of mistakes in this code. (side note: In fact, there was an error made in the original code. Yes, it looks simple, yet error-prone.)

Here’s a simpler and elegant way to do something like the above.

public List<int> GetListOfIntegers()
{
    Enumerable.Range(0, 24).ToList();
}

One of the interesting things with Enumerable.Range is it returns an IEnumerable. This effectively generates the numbers lazily. However in this example, in order not to change the signature of the method, ToList() is called to generate the numbers instantly, instead of lazily.

With ranges, you can create various interesting sets of numbers with Linq in a more functional way. I hope this week’s “Code You Should Not Be Writing” helps someone out there.

 

If you don’t already know, all editions of Windows 7 discs ships with the same content. The only difference is determined by a configuration file which decides which edition your Windows 7 disc or ISO is. Knowing that, there is a tool out there to change your edition to any edition, or make it a universal ISO.

The Windows 7 ISO Image Edition Switcher is a set of small binary patches (and a tool to apply these patches) that will convert an official Windows 7 ISO disc image into an official Windows 7 ISO disc image of another edition.

The ei.cfg Removal Utility is a simple tool that will remove the ei.cfg from any Windows 7 ISO disc image, thereby converting the image into a “universal disc” that will prompt the user to select an edition during setup.

For those system admins, this will be great for you. For those who tend to lose their disc or ISOs, you can now grab a friend’s copy and change the disc to the edition you want. But remember, this does not mean your CD key will work for any edition.

Source: win7utils – Windows 7 ISO Disc Image Utilities

 

When I saw this tool, I thought to myself, “This is what Visio is like on the web, except better.” Cacoo is a an online diagramming tool much like what Visio offers to you, except it has better looking stencils. With the added benefit of being online, it allows you to collaborate between multiple people in real time!

Not only can it just draw simple diagrams like flowcharts, network diagrams, office layout diagrams, UML diagrams, but what I like is the freehand wireframe stencils! Check out my horrible looking UI I drew from the stencils in just a few minutes.

Test Freehand Diagram

Awesome isn’t it? Or maybe something more advanced.

Watch their video tour below.

Cacoo – Real-time Collaborative Diagramming & Design from Nulab Inc. on Vimeo.

What’s more, basic features are free! Try it out now at Cacoo.com.

 

Well it is the new year and a lot of things have happened to me in the past 1 year. Looking back at what I’ve done, I think it is wise to say there were good and bad times. Looking forward to 2010, there are a few things I do want to achieve. Here are my resolutions.

  1. Help build up the Microsoft developer community.
  2. Grow and inculcate the spirit of HackerspaceSG.
  3. Create dialogues and win-win situations between groups of people.
  4. Study and learn new things.
  5. Lose weight… LOTS OF IT.

That’s it. Yes, I’m a boring person.

So what is your new year resolution?

© 2009 - 2011 JustinLee.sg Suffusion theme by Sayontan Sinha
Stop SOPA!

SOPA breaks our internet freedom!
Any site can be shut down whether or not we've done anything wrong.

Stop SOPA!