Android

Android開発を始めてみる。

Android Developers
からSDKをダウンロード。

まずはエミュレータを動かしてみる。

AVD(Android Virtual Device)を作成するには、android.batを使用するようだ。
ヘルプを出すには"android -h"とする。

C:\hogehoge>android -h

Usage:
  android [global options] action [action options]

Global options:
  -h --help     This help.
  -s --silent   Silent mode: only errors are printed out.
  -v --verbose  Verbose mode: errors, warnings and informational messages are printed.

Valid actions are composed of a verb and an optional direct object:
-   list        : Lists existing targets or virtual devices.
-   list avd    : Lists existing Android Virtual Devices.
-   list target : Lists existing targets.
- create avd    : Creates a new Android Virtual Device.
-   move avd    : Moves or renames an Android Virtual Device.
- delete avd    : Deletes an Android Virtual Device.
- update avd    : Updates an Android Virtual Device to match the folders of a new SDK.
- create project: Creates a new Android Project.
- update project: Updates an Android Project (must have an AndroidManifest.xml).

---省略---
Action "create avd":
  Creates a new Android Virtual Device.
Options:
  -t --target   Target id of the new AVD [required]
  -c --sdcard   Path to a shared SD card image, or size of a new sdcard for the new AVD
  -p --path     Location path of the directory where the new AVD will be created
  -n --name     Name of the new AVD [required]
  -f --force    Force creation (override an existing AVD)
  -s --skin     Skin of the new AVD
---ここも省略---

次のように作ってみた。

android create avd -t 3 -c 1024M -p d:\home\android\avd\myavd -n myavd -s HVGA

で、起動

emulator @myavd

android.batファイル開いてみた。

バッチファイルもフリーソフトウェアライセンス(Apache License)が明記。*1

rem Copyright (C) 2007 The Android Open Source Project
rem
rem Licensed under the Apache License, Version 2.0 (the "License");
rem you may not use this file except in compliance with the License.

恥ずかしながら読めない所が。

rem Set up prog to be the path of this script, including following symlinks,
rem and set up progdir to be the fully-qualified pathname of its directory.
set prog=%~f0

次にEclipse環境を整える。既にEclipseはインストール済みなのでプラグインを導入。


会社ではid:teppeisさんと同じようにxmlパスまで指定しないとダメだった。自宅では通ったのに。

http://dl-ssl.google.com/android/eclipse/site.xml

を指定。


参考サイト
android情報まとめ @ ウィキ - アットウィキ
バッチメモ(Hishidama's bat-file Memo)
Android AVDとemulator (SDK 1.5) |
Android Market配布を目指しEclipseでHelloWorld! (1/3):Androidで動く携帯Javaアプリ作成入門(1) - @IT
Google Android で Hello, World! するまでのチュートリアル - ynakajimaの備忘録