11 February 2012

Setting up RHODES with an Android Emulator

Setting up the system

1. Installing Ruby. Please follow the sequence of commands given below to install ruby on ubuntu using RVM.

$ sudo apt-get install git
$ sudo apt-get install curl
$ bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
$ rvm pkg install zlib
$ rvm pkg install openssl
$ rvm install ruby-1.8.7-p334
$ rvm alias create default ruby-1.8.7-p334
2. Download Android-sdk for linux
Android SDK Download
3. Download Android-ndk for linux
Android NDK Download
4. Extract both the zip files in two different folder's.

5. Java is needed to be installed in the system.If not then download the Java SDK zip files from
Java SDK 7 Download
6. Open the terminal and install the rhodes gem.
 gem install rhodes 
the installation of the gem will take time as the size of the gem is < 50 MB

7. After the gem installation ,type
$ rhodes-setup

at the terminal .The screen should come up something like this ..

Now type in the directories where you extracted the
1.Java SDK
2.Android SDK
3.Android NDK
8. Setting up the environment is complete.

Now we will generate a demo application using rhodes to test the emulator.

1.Setting up Android SDK to host an emulator of a specific android version.

2.Go to the directory where you extracted the sdk .Then go into the tools folder in the sdk and click on a file name "android".A window opens up :

3. Click on the checkbox Android 3.0 , this selects all the checkboxes in this group.Now click on install wait for a few minutes.

4. Now open your terminal and generate a new rhodes application.
rhogen app Demo
cd Demo
5. Edit the built.yml file in any text editor to change the android version to 3.0 instead of default 2.1 and add an emulator name.

6. Now go back to the terminal and type :
rake run:android
7. The android emulator will show up in a few minutes and load the rhomobile application .

Now we can go forward designing the mobile application.Happy coding :)