2013-03-30 00:00:00 -0700
A pint of sweat, saves a gallon of blood.
George S. Patton
The Android SDK provides you with the API libraries and developer tools necessary to build, test, and debug apps for Android.
The NDK is a toolset that allows you to implement parts of your app using native code: C and C++.
V8 is written in C++ and we will be compiling to a static library with Android as the platform target. In order to do that, we will need the Android SDK and the NDK. In order for our apps to link against C/C++ static libraries (C Standard Library, STL, V8, etc) we will need the NDK.
The Android Native Development Kit adds an additional layer of complexity for the developer, and the NDK Developers page claims most apps will not receive any benefit (performance or otherwise) from its use. While I normally believe anything I read on the internet, we will be exploring this claim as well
The Android Dev Portal will make sure you get the correct version for your OS. Otherwise, click the "Download for other Platforms" link.
Unzip to a reasonable location
I typically keep all my sdks in a common folder, like /Users/lorinbeer/dev/sdks
add the tools folder to your path, see the last section if you don’t know how
this will enable us to run the android and adb tools from the command line without specifying their location
the Android Dev Portal will make sure you feel like your doing something wrong by thinking about developing a mobile app in native code. Ignore the intro and download the appropriate package for your system.
unzip to a reasonable location
same as above, after your 15th sdk installation, putting them in a common folder will begin to look like an attractive option for keeping things organized
add the root folder to your path
this will enable us to run the ndk tool from the command line without specifying its location
The path environment variable on unix-like environments is a colon delimited string
where /path/to/my/dir is the absolute path to the directory you wish to add to the PATH
Note: the modified PATH will only exist in this shell window's environment, and changes will be lost when it is closed
open one of the above initialization files with your favoured editor
Note: method 2 insures that these directories are always searched when executing commands whenever you open up a new shell window. On OS X, I set my PATH environment variable in /Users/myusername/.profile
the windows path is a semicolon delimited string:C:\Program Files;C:\WINDOWS;C:\WINDOWS\System32
;/path/to/my/dir
to the path variable using a tiny edit box that hasn't changed since windows 3.11We should have our Android development environment all set up, and ready to compile V8. Stay tuned for Part 1: Compiling V8 for Android!
VATEDROID - Part 3 - Executing JS
VATEDROID - Part 2 - Linking V8
VATEDROID - Part 1 - Compiling V8