2010-10-31

RubyでAndroid (準備編:その1)

RubyでAndroidアプリを開発したいと思ったので、

ubuntu10.10 に、開発環境を作りたいと思います。

今回はその準備編(その1)です。




Android SDKをインストールする。
このページにあるSDKを取得し、解凍する。
$wget http://dl.google.com/android/android-sdk_r07-linux_x86.tgz

$tar -xvf android-sdk_r07-linux_x86.tgz

解凍されたディレクトリ内を見ると、 "SDK Readme.txt"(ファイル名にスペースあり!)があるので、
開いてみる。

Welcome to the Android SDK!

(snip)

To start the SDK Manager, please execute the program "tools/android".
(snip)

書いてある通りに、実行すると、以下のウィンドウが起動。


rhodesをインストールする。

$gem install rhodes
[sudo] password for (user):
(パスワード入力)
Building native extensions.  This could take a while...
Successfully installled highline-1.6.1
Successfully installed diff-lcs-1.1.2
Successfully installed extlib-0.9.15
Successfully installed templater-1.0.0
Successfully installed activesupport-2.3.10
Successfully installed rhodes-2.2.2
6 gems installed
(snip)


JDKをインストールする。
このページからにあるJDKを取得する。

(この時点では、JDK 6 Update 21 を取得しました。)

$wget http://cds.sun.com/is-bin/(長いURL)/jdk-6u21-linux-i586.bin
$chmod +x jdk-6u21-linux-i586.bin
$./jdk-6u21-linux-i586.bin

Android NDKをインストールする。
このページからにあるAndroid NDKを取得する。

$wget http://dl.google.com/android/ndk/android-ndk-r4b-linux-x86.zip
$unzip android-ndk-r4b-linux-x86.zip

rhodesをセットアップする。
 
$rhodes-setup
We will ask you a few questions below about your dev environment.

JDK path (required) () : (JKDをインストールしたパスを入力)
Android SDK path (blank to skip) (): (Android SDKをインストールしたパスを入力)
Android NDK path (blank to skip) (): (Android NDKをインストールしたパスを入力)
Windows Mobile 6 SDK Cabwiz (blank to skip) (): (SKIPする)
BlackBerry JDE 4.6 (blank to skip) (): (SKIPする)
BlackBerry JDE 4.6 MDS (blank to skip) (): (SKIPする)
BlackBerry JDE 4.2 (blank to skip) (): (SKIPする)
BlackBerry JDE 4.2 MDS (blank to skip) (): (SKIPする)

If you want to build with other BlackBerry SDK version edit: (rhodesインストールパス)/rhobuild.yml
これで、一通りのインストールは完了(のはず)。

アプリのプロジェクトを新規作成する。
 
$rhogen app sampleroid http://localhost:9292/application
Generating with app generator:
    [ADDED]  sampleandroid/rhoconfig.txt
    [ADDED]  sampleandroid/build.yml
    [ADDED]  sampleandroid/app/application.rb
    [ADDED]  sampleandroid/index.erb
    [ADDED]  sampleandroid/inex.bb.erb
    [ADDED]  sampleandroid/layout.erb
    [ADDED]  sampleandroid/loading.html
    [ADDED]  sampleandroid/Rakefile
    [ADDED]  sampleandroid/app/helpers
    [ADDED]  sampleandroid/icon
    [ADDED]  sampleandroid/app/Settings
    [ADDED]  sampleandroid/public
あと一息…。
起動。
 
$rake run:android
(in (プロジェクトパス))
cd (rhodesインストールパス)


Your java bin folder does not appear to be on your path.
This is required to use rhodes.

+++ No required platform (API level >= 4) found, can't proceed.
エラーになりました。(涙) 続きは その2で。


参考URL:たかはまんの三日坊主日記NEXT

0 件のコメント:

コメントを投稿