Wednesday, October 06, 2010

Friday, October 01, 2010

tips on working with disk images

Just wanted to share a useful tip for working with disk images on Mac OS X.
I had to work with custom android builds recently and as you might know it requires case-sensitive partition or disk image to be able to compile it.

The following couple of functions added to .bash_profile make the mounting and unmounting the disk images easier from the command line:

function mountFroyo { hdiutil attach ~/froyo.dmg -mountpoint /Volumes/froyo; }
function unmountFroyo { hdiutil detach /Volumes/froyo; }

Now you can just type mountFroyo or unmountFroyo, for example, to mount/unmount your custom disk image.

Wednesday, September 08, 2010

How to compile Android 2.2 (Froyo) on Mac OS X 10.6 (Snow Leopard).

How to compile Android 2.2 (Froyo) on Mac OS X 10.6 (Snow Leopard).

Once upon a time I needed to do a custom build of Android OS with some changes to the core components for some custom devices.
The instructions how do get the source and do the build can be found on the Android Developers web site:
http://source.android.com/source/download.html
Everything went smooth, I took the latest code and compiled just fine, but.....
.... later I found out that I needed to have my build done based on Android 2.2 (Froyo) branch instead.

The "Froyo" build is not officially supported on the Snow Leopard and it didn't work right out of the box.
So, I had to spend a little bit of time to figure out how to make it work.

Here are the steps I had to go through:
* Follow the steps on http://source.android.com/source/download.html to get the source code and setup your build environment.
* Make sure you have XCode installed with support for Mac OS X 10.4(!) development.
* Install Java 1.5. This one a little bit tricky, since Java for Mac OS maintained by Apple and the older versions are pretty much not available to download. You have to download Java for Mac OS X 10.5 Update 7 http://support.apple.com/downloads/Java_for_Mac_OS_X_10_5_Update_7. Then use for example something like unpgk tool (http://www.timdoug.com/unpkg/) to exract the Java 1.5 from there. Replace the 1.5 and 1.5.0 symbolic links in
/System/Library/Frameworks/JavaVM.framework/Versions with the Java 1.5 from the package.
* I checked the Application->Utilities->Java Preferences as well to make sure the Java 1.5 is the first one in the list, although I'm not sure if it is necessarily. It worked and I didn't bother to try different settings.
* In order to start the build you would go to the root folder of the android source code tree and call "make".
* The first problem I stumbled upon was the problem with /Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h file it could not be found, while it existed in that directory. I found the solution that worked here: http://code.google.com/p/android/issues/detail?id=5000
Basically just coping the file : cp /Developer/usr/lib/gcc/i686-apple-darwin10/4.0.1/include/stdarg.h /Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h
allowed me to proceed further.

* The next problem was a error during compilation of google V8 javascript engine. I went ahead deleted the external/v8 folder and took the latest stable version from google repository: "svn checkout http://v8.googlecode.com/svn/trunk/ v8". As long as V8 compiled and run I was fine with this change in my tree.

* The next error that you would get is
host C++: libacc <= system/core/libacc/acc.cpp
system/core/libacc/acc.cpp: In member function ‘bool acc::Compiler::acceptStringLiteral()’:
system/core/libacc/acc.cpp:4611: error: cast from ‘char*’ to ‘int’ loses precision
system/core/libacc/acc.cpp: In member function ‘void acc::Compiler::unary()’:
system/core/libacc/acc.cpp:4691: error: cast from ‘char*’ to ‘int’ loses precision
system/core/libacc/acc.cpp:4697: error: cast from ‘char*’ to ‘int’ loses precision
system/core/libacc/acc.cpp:4785: error: cast from ‘void*’ to ‘int’ loses precision
system/core/libacc/acc.cpp: In member function ‘void acc::Compiler::globalDeclarations()’:
system/core/libacc/acc.cpp:5904: error: cast from ‘void*’ to ‘int’ loses precision
make: *** [out/host/darwin-x86/obj/STATIC_LIBRARIES/libacc_intermediates/acc.o] Error 1

replace cast from int to size_t in these lines


* After all these steps I was able to built the whole tree fine.

The fix for the last problem I found on:
http://wisevishvesh.wordpress.com/2010/04/12/building-eclair-on-snow-leopard/

* And here is some more of useful information I found on that blog:
Creating and Extracting files from System Image
There are two executable that are needed for creating system image and for extracting the files from the system image. mkyaffs2image is for creating and unyaffs is for extracting files. mkyaffs2image is created when Android is built, We have to build unyaffs separately.
The source unyaffs for is available here
Compile the file
gcc -o unyaffs unyaffs.c”


Hope you find this post helpful.

Good Luck!

Thursday, August 19, 2010

Monday, March 22, 2010

Wednesday, March 03, 2010

2-3 USA-Canada hockey final at Vancouver Olympics 2010

Last Sunday I was watching the hockey final game of Olympics between US and Canada. It was pretty emotional. When the US team scored a goal on the last minute of the 3rd period making the score 2-2, I yelled: "Goooaaal !!!".
The funniest part was when my little boy, seeing all this excitement around, yelled after me: "Goooaaal!"

Sunday, February 14, 2010

Intersting TED talk: Dan Gilbert asks, Why are we happy?

Stumbled upon interesting TED talk:
http://www.ted.com/talks/dan_gilbert_asks_why_are_we_happy.html

"...natural happiness is what we get when we get what we wanted
and the synthetic happiness is what we make when we don't get what we wanted

In our society we have a strong believe that a synthetic happiness is one of the inferior kind... why do we have that belief?....well it is very simple
.... what kind of economic engine would keep turning
if we believed that not getting what we want could make us
just as happy as getting it ....
a shopping mall full of zen monks is not going to be particularly
profitable because they don't want stuff enough to make it profitable ...."

"...our longings and our worries are both to some degree overblown because we
have within us the capacity to manufacture the very commodity (happiness) we are
constantly chasing when we choose experience"


"Happiness is not a state to arrive at, but a manner of traveling."
~Margaret Lee Runbeck

Saturday, January 09, 2010

Enjoyed being at the meeting with Saul Hansell

He recently came over from NYT to work for our company.
I really enjoyed the energy and passion that he has as well as the vision for the future of our product. Hope he will not get burned out too soon and will have enough leverage to implement his vision.

Following him now here http://saulhansell.blogspot.com.

Thursday, November 26, 2009

Florida Trip - passing Georgia

On a way to Florida while driving through Georgia there are some places where the sulfur smell from swamps is quite strong. My daughter quickly learned this and on the way back, after 6+ hours driving through Florida, she started to ask me if we are in Georgia now or not. I answered, No.
While driving around Jacksonville, FL we hit the spot on the road where the sulfur smell from the swamps got pretty strong and I hear her voice from the back: "I told you, this is Georgia".

I was LOL :)

Friday, November 06, 2009

Android fun :)

Today was playing with all kinds of UI controls customizations. One thing I needed to do is to be able to draw the background shape around image where only right top and bottom corners are rounded.
After some research and trying different things (because that part of APIs pretty much missing any documentation), I found out that it looks like the left and right is messed up in the API. Here is what works :

<corners android:bottomRightRadius="0.1dp" android:topRightRadius="8dp"
android:bottomLeftRadius="8dp"
android:topLeftRadius="0.1dp" />

As you can see I had to use the bottom left radius to make the right corner round and for the rest of the corners I had to use 0.1dp , because 0dp just didn't work and made all corners not rounded.

Good luck ! :)

Wednesday, November 04, 2009

Busybox

Busybox is pretty useful set of tools for Android development as well:
http://www.busybox.net

Running Android tools on Windows 7 x64

Here is a link how to make it happen
http://code.google.com/p/android/issues/detail?id=3917

Friday, October 30, 2009

Simple Things

Today I went to Halloween swim meet with my daughter. She participated in three different kinds of competitions. It was her first time of any kind of the "competitive" swimming.

The funny thing was that I was worrying, how she would do, and that she might get disappointed with results. etc., while she was just having fun swimming with her friends and not caring too much about results. She was excited and smiling after every race, no matter how she did.

I saw the happy human being today.


Happy weekend ! :)

Saturday, October 17, 2009

Firefox strikes back



no comments :)

Wednesday, October 14, 2009

Tuesday, October 13, 2009

Microsoft SQL Server Database Publishing Wizard

Recently I needed to migrate the database from MS SQL 2005 to MS SQL 2005. By the way, it's not as straight forward as it might look like.

After a little be of searching for solution I stumbled upon the
Microsoft SQL Server Database Publishing Wizard

This tool is pretty good at scripting the whole database structure with data. The name of the tool is not really intuitive. So, I'm saving this link for myself as well on this blog.

How to get the list of installed Android root certificates ?

Today, needed to get the list of trusted root certificates on Android phone to verify which ones are available out of the box.

Here are the easy steps how to do this :

1. get the certificates file
adb pull /system/etc/security/cacerts.bks cacerts.bks

2. download http://bouncycastle.org/download/bcprov-jdk16-141.jar and place it on $JAVA_HOME/jre/lib/ext/

3. run the keytool utility
keytool -storetype BKS -provider org.bouncycastle.jce.provider.BouncyCastleProvider -storepass -keystore cacerts.bks -list -v

Enjoy !

Friday, September 18, 2009

Incredible, amazing, awesome Apple

After watching the original Apple presentation I was left with the same feeling of audience being programmed with constant repetition of thee words : "Incredible, amazing, awesome" ....
Today I found this video:



Enjoy !