■ 全体の感想
前半は、Android Studio Beta の特に Variant についての解説、後半はデモと個別の機能について。
CIツールのことをかなり意識している感じが伝わってきた。
1.0 が出たら本格的にEclipse + ADTがオワコンになりそうな感じ。
現在はぜんぜんドキュメントがないが、1.0 になったら Android Studio のドキュメントをもっと増やす予定だそうだ。
■ 内容のpickup
Android Studio Beta がリリースされた。
(セッション時は 0.8.0 だが、その後 0.8.1 がリリースされている)
Android Studioの戦略は、統一されたビルドシステムを提供すること。つまり、Android Studio でビルドしようが、CIでビルドしようが、同じビルドができるようにすること。
柔軟性が大事。コードの再利用、ビルドのカスタマイズ化などをIDEとGradleのコンビネーションをうまくやりたい。
前回のI/Oからこの一年でさまざまなバグを修正し、パフォーマンスを改善し、IDEとの統合もたくさんしてきた。
Varitants
- Build Type
Develop vs Product 開発バージョン
- Product Flavor
Paid vs Free など目的に応じて変える
- multiple apk (coming soon) x86 vs ARM など
ゲームによい
- Variant Filter
- Improved Dependencies
Freeには広告があり場合など、Free版だけ広告ライブラリに依存しているなど
denpendencies scope: コンパイル時にチェックして、必要なものだけパッケージに入れる
- New Manifest Merger
ビルドダイプやFlavorに応じてpermissionを変えたいときなど
tools:replace
Insertion android:authorities="${applicationId}.provider"
ContentProviderで便利!
Variant Publishing
Variants in Libraries
まだ作業中
Customization
- BuildConfig Injection
Variantごとのフラグを入れたいときとかに便利
- Res value Injection
- Per-Variant SourceSet
APIs
- Variant Manipulation
- Plugin API
- API to augment IDE model
Android Wear
- Build-in Support for Micro App
メインアプリケーション内にパッケージされる
- Generate XML resoure
- Inject Node in Manifest
dependencies {
wearApp project(':wearProject')
}
or
dependencies {
wearApp files('/path/to/apk')
}
IDE Integration
- Updated Model
- Improved Sync / Build
- Project Structure / Editor Support / Lint
Performance
- Critical Issue
- Full vs Incremental Builds
- Investigation : Known Bottlenecks
- Project Evaluation / Model Building
- Incremental Support in Tasks
- Tasks Parallelization
Road to 1.0
- Finalize IDE Model / DSL
- Variant Aware Dependency Management
- Compatibility with Gradle Model / Plugins
■ Android Studio の新しい機能
Eclipse プロジェクトをインポートしたときにサマリーができるようになった。
例えば、どの jar を gradle の設定に変更したかや、src や res フォルドの階層がどう変わったかなど。


Android Specific View
新しい Android Specific View では、全てのビルドスクリプトが一カ所にまとまるなど、みやすくなる。
マニフェストや同じ名前のリソースファイルもまとまって表示される。
# Eclipseっぽい階層表示だ
# 次のいくつかのCanary buildで入るらしい。



New Project ウィザードで minSdkVersion を選ぶために、現在のAPI Levelの分布をみれるようになった。
WearとAndroid TV用のテンプレートが選べるようになった。
Wearのレイアウトプレビュー(四角と丸)がでるようになった。

プロジェクト全体を RTL 対応する機能が用意された。
エディタプレビュー上でOverflowメニューをクリックすると、メニューが表示されるなど、Activityをひもづけておくと、表示が実装に応じて変わるようになった。

異なるバージョンのプレビューが一度にでるようになった。

新しい属性
android:colorPrimary
android:colorAccent
ActionBarやチェックボックスの色が変わる

android:tint
android:tintMode

テーマに指定されている属性の詳細がF1で出るようになった

@IdRes int id
@DrawableRes int icon
など、アノテーションでどのリソースIDが指定されるべきかを宣言できるようになった。
あわないリソースIDを渡しているコードはLintでエラーになる。
