Rhodes on android

Download android 


After installing the android sdk and ndk in your machine, add the path within the rhobuild.yml file (rhobuild,yml resides within the rhodes gem, inside the ruby, which you are using. Something like this, if you are using the ruby from the Motorola Rhomobile Suite: C:\MotorolaRhoMobileSuite2.0.5\ruby\lib\ruby\gems\1.9.1\gems\rhodes-3.4.2\rhobuild.yml))

A typical entry looks like this: remember to maintain the indentations in the yml file.
env:
  app:
  paths:
    android-ndk: D:/Android/android-ndk-r8b-windows/android-ndk-r8b
    java: C:/Program Files (x86)/Java/jdk1.6.0/bin
    android: D:/Android/adt-bundle-windows-x86_64/adt-bundle-windows/sdk

Android 4.2 runs with rhodes 3.3.2(without license)

For any other rhodes version(below 3.3.2), you will wither get an error like the following or for rhodes(above 3.3.2) it will require a license from Motorola.

Getting such an output while executing the below command for android 4.2.
ruby 1.9.3
rhodes 3.2.2( rhodes 3.3.3 or above requires a license, hence not used)
D:\app-folder>rake run:android --trace
cd C:/MotorolaRhoMobileSuite2.0.5/ruby/lib/ruby/gems/1.9.1/gems/rhodes-3.2.2
** Invoke run:android (first_time)
** Invoke run:android:emulator (first_time)
** Invoke device:android:debug (first_time)
** Invoke package:android (first_time)
** Invoke build:android:all (first_time)
** Invoke build:android:rhobundle (first_time)
** Invoke config:android (first_time)
** Invoke config:set_android_platform (first_time)
** Execute config:set_android_platform
** Execute config:android
** Invoke config:common (first_time)
** Execute config:common
Use Google addon API: false
+++ Looking for platform...
+++ API LEVEL of D:/Android/adt-bundle-windows-x86_64/adt-bundle-windows/sdk/platforms/android-16: 16
+++ API LEVEL of D:/Android/adt-bundle-windows-x86_64/adt-bundle-windows/sdk/platforms/android-4.2: 17
Found API levels:
16
17
Requested version: 4.2
Corresponding API level
ERROR!!! Wrong Android API version: 4.2

To avoid any kind of such errors/license, use rhodes 3.3.2 to test your app with android 4.2
For details, check this link.

How to install an app in android emulator:



  1. Add the following in the windows path environmetn variable;
    \adt-bundle-windows-x86_64\adt-bundle-windows\sdk\platform-tools
  2. Go to the tools directory:
    cd D:\Android\adt-bundle-windows-x86_64\adt-bundle-windows\sdk\tools
  3. click/run the android windows batch file.
  4. From the tools menu, at the top left, select Manage AVD
  5. Copy the .apk file of your app, inside the systems directory. This is generally present within the windows directory in the C: drive in windows.
  6. Select the AVD, from the right panel, start the emulator.
  7. Open a new command prompt and go to the platform-tools directory:
    D:\Android\adt-bundle-windows-x86_64\adt-bundle-windows\sdk\platform-tools
  8. run the following command
    adb install "C:\Windows\system\.apk"
  9. This should install the app in your emulator and show the app in the emulator Home screen.

How to uninstall an app from android emulator:

     First,make sure the emulator is running.Then follow below steps:

  1. go to tools directory in command
  2. adb shell
  3. cd /data/app
  4. ls (It will display all the .apk installed in your emulator)
  5. rm ***.apk(which you want to remove)


Error:  Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE] while installing apk in android emulator
  1. Delete the AVD, from the AVD manager.
  2. Create a new AVD.
  3. open the emulator.
  4. go to the platform-tools dir within android and try re-installing the apk file.

Comments