月份: 2011 年 7 月

  • Pindah,用 Mirah 來寫 Android 程式

    Pindah: Tools for building Android applications with Mirah

    用類 Ruby 語法的 Mirah 來寫 Android 程式。

    安裝筆記:

    1. 安裝 JRuby (1.6.3) (其實我早先還蠻抗拒使用非 MRI 的…)
    2. 將 $JRUBY_PATH/bin/ 加進 $PATH
    3. 將 $ANDROID_SDK_PATH/tools/ 加進 $PATH
    4. 安裝 pindah (jruby -S gem install pindah)
    5. 跑 jruby -S gem update 升級 JRuby 底下的 Rake (0.9.2)
    6. 安裝 Apache Ant
    7. pindah create org.example.hello hello_world HelloActivity
    8. 修改 $JRUBY_PATH/lib/ruby/gems/1.8/gems/pindah-0.1.2/templates/build.xml,將 <mirahc src=”${src}” destdir=”${classes}”> 修正為 <mirahc dir=”${src}” destdir=”${classes}”>,否則網上兩個範例 (Ferrante, Garrett) 都會編譯失敗。(但是預設的 Hello World 範例卻能正常 build?)
    9. cd hello_world
    10. jruby -S rake debug 測試能否 build 出 apk
    11. 打開 emulator,以 jruby -S rake install 安裝至 emulator