第一回福井支部勉強会に行って来た

昨日のこと。
午後休とってドライブ。
鯖江は遠い... 下道で行ったからだけど。
あちこちで渋滞、そして遅い車の交通妨害。


2時間ではやっぱりアプリ開発は難しいね。
Antベースの開発で、Eclipsは使わない方針の内容だった。
結局いろいろトラブル続出で、HelloWorldで皆さん終わってしまった。
開発環境のインストールからなら、6時間は必要だと思う。
開発環境整備までは、自習してきてもらわないと短縮できない。
あと、WindowsAndroid開発環境を整備するより、Macで整備するほうが楽でいいことを実感。
MacだとiPhone開発もできるしね。


使うはずだった、キッチンタイマーの素材はこちらだそう。
http://ac.appget.com/AC20343/index.html

MacBook:tools kinneko$ pwd
/Users/kinneko/Downloads/android-sdk-mac_86/tools
MacBook:tools kinneko$ ./android create project
Error: The parameters --target, --package, --activity, --path must be defined for action 'create project'

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

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

Action "create project":
  Creates a new Android Project.
Options:
  -t --target   Target id of the new project [required]
  -k --package  Package name [required]
  -a --activity Activity name [required]
  -n --name     Project name
  -p --path     Location path of new project [required]


MacBook:tools kinneko$ ./android create project -n HelloWorld -t 3 -p ~/Downloads/android_hello -k com.exsample.hello_world -a HelloWorld
Error: Target id is not valid. Use 'android list targets' to get the target ids.
MacBook:tools kinneko$ mkdir ~/Downloads/android_hello

MacBook:tools kinneko$ ./android create project -n HelloWorld -t N08 -p ~/Downloads/android_hello -k com.exsample.hello_world -a HelloWorld
Error: Target id is not valid. Use 'android list targets' to get the target ids.
MacBook:tools kinneko$ ./android list targets
Available Android targets:
id: 1 or "android-7"
     Name: Android 2.1
     Type: Platform
     API level: 7
     Revision: 1
     Skins: HVGA (default), QVGA, WQVGA400, WQVGA432, WVGA800, WVGA854
id: 2 or "Google Inc.:Google APIs:7"
     Name: Google APIs
     Type: Add-On
     Vendor: Google Inc.
     Revision: 1
     Description: Android + Google APIs
     Based on Android 2.1 (API level 7)
     Libraries:
      * com.google.android.maps (maps.jar)
          API for Google Maps
     Skins: WQVGA400, WVGA800, WQVGA432, HVGA (default), WVGA854, QVGA
MacBook:tools kinneko$ ./android create project -n HelloWorld -t 1 -p ~/Downloads/android_hello -k com.exsample.hello_world -a HelloWorld
Created directory /Users/kinneko/Downloads/android_hello/src/com/exsample/hello_world
Added file /Users/kinneko/Downloads/android_hello/src/com/exsample/hello_world/HelloWorld.java
Created directory /Users/kinneko/Downloads/android_hello/res
Created directory /Users/kinneko/Downloads/android_hello/bin
Created directory /Users/kinneko/Downloads/android_hello/libs
Created directory /Users/kinneko/Downloads/android_hello/res/values
Added file /Users/kinneko/Downloads/android_hello/res/values/strings.xml
Created directory /Users/kinneko/Downloads/android_hello/res/layout
Added file /Users/kinneko/Downloads/android_hello/res/layout/main.xml
Created directory /Users/kinneko/Downloads/android_hello/res/drawable-hdpi
Created directory /Users/kinneko/Downloads/android_hello/res/drawable-mdpi
Created directory /Users/kinneko/Downloads/android_hello/res/drawable-ldpi
Added file /Users/kinneko/Downloads/android_hello/AndroidManifest.xml
Added file /Users/kinneko/Downloads/android_hello/build.xml

MacBook:tools kinneko$ cd ~/Downloads/android_hello/
MacBook:android_hello kinneko$ ant install
Buildfile: build.xml
    [setup] Project Target: Android 2.1
    [setup] API level: 7
    [setup] WARNING: No minSdkVersion value set. Application will install on all Android versions.

-compile-tested-if-test:

-dirs:
     [echo] Creating output directories if needed...
    [mkdir] Created dir: /Users/kinneko/Downloads/android_hello/gen
    [mkdir] Created dir: /Users/kinneko/Downloads/android_hello/bin/classes

-resource-src:
     [echo] Generating R.java / Manifest.java from the resources...

-aidl:
     [echo] Compiling aidl files into Java classes...

compile:
    [javac] Compiling 2 source files to /Users/kinneko/Downloads/android_hello/bin/classes

-dex:
     [echo] Converting compiled files and external libraries into /Users/kinneko/Downloads/android_hello/bin/classes.dex...
     [echo]          

-package-resources:
     [echo] Packaging resources
 [aaptexec] Creating full resource package...

-package-debug-sign:
[apkbuilder] Creating HelloWorld-debug-unaligned.apk and signing it with a debug key...
[apkbuilder] Using keystore: /Users/kinneko/.android/debug.keystore

debug:
     [echo] Running zip align on final apk...
     [echo] Debug Package: /Users/kinneko/Downloads/android_hello/bin/HelloWorld-debug.apk

install:
     [echo] Installing /Users/kinneko/Downloads/android_hello/bin/HelloWorld-debug.apk onto default emulator or device...
     [exec] error: device not found

BUILD FAILED
/Users/kinneko/Downloads/android-sdk-mac_86/platforms/android-7/templates/android_rules.xml:350: The following error occurred while executing this line:
/Users/kinneko/Downloads/android-sdk-mac_86/platforms/android-7/templates/android_rules.xml:184: exec returned: 1

Total time: 3 seconds

ううう、実機つなげてやったらうまくいった。

MacBook:android_hello kinneko$ ant install
Buildfile: build.xml
    [setup] Project Target: Android 2.1
    [setup] API level: 7
    [setup] WARNING: No minSdkVersion value set. Application will install on all Android versions.

-compile-tested-if-test:

-dirs:
     [echo] Creating output directories if needed...

-resource-src:
     [echo] Generating R.java / Manifest.java from the resources...

-aidl:
     [echo] Compiling aidl files into Java classes...

compile:
    [javac] Compiling 1 source file to /Users/kinneko/Downloads/android_hello/bin/classes

-dex:
     [echo] Converting compiled files and external libraries into /Users/kinneko/Downloads/android_hello/bin/classes.dex...
     [echo]          

-package-resources:
     [echo] Packaging resources
 [aaptexec] Creating full resource package...

-package-debug-sign:
[apkbuilder] Creating HelloWorld-debug-unaligned.apk and signing it with a debug key...
[apkbuilder] Using keystore: /Users/kinneko/.android/debug.keystore

debug:
     [echo] Running zip align on final apk...
     [echo] Debug Package: /Users/kinneko/Downloads/android_hello/bin/HelloWorld-debug.apk

install:
     [echo] Installing /Users/kinneko/Downloads/android_hello/bin/HelloWorld-debug.apk onto default emulator or device...
     [exec] 613 KB/s (13218 bytes in 0.021s)
     [exec] 	pkg: /data/local/tmp/HelloWorld-debug.apk
     [exec] Success

BUILD SUCCESSFUL
Total time: 2 seconds

http://ac.appget.com/AC20343/index.html