2014年5月14日水曜日

Android Studioによるプロジェクト作成

1.Android Studioの起動

ショートカットからAndroid Studioを起動します。

インストール後、初めての起動する場合は、「Complete Installation」ダイアログが表示されます。
「I do not have a previous version of Android Studio or I do not want to import my settings」を選択して、[OK]をクリックします。



「Welcom to Android Studio」ダイアログが表示されます。
以下のアップデート情報が表示されることがあります。
「Update Info
A new version of Android Studio is available!」

ステータスバーに表示されている「Check」をクリックします。
「Android Studio x.x.x Build xxx.xxxxxxx. Check for updates now.」




アップデート内容を確認できます。
とりあえずアップデートはせずに、[Remind Me Late]をクリックして閉じます。




2.プロジェクトの作成

「Welcome to Android Studio」ダイアログの[New Project]をクリックします。




「New Project」ダイアログが表示されます。




以下は、各項目の詳細です。

【Application name】
Google Play、端末のアプリケーション管理で表示されるアプリケーションの名前です。

「The application name is shown in the Play store, as well as in the Manage Applications list in Settings.」


【Module name】
IDEで使用されるモジュールの名前です。「Application name」と同じにしても良いです。

「This module name is used only by the IDE. It can typically be the same as the spplication name.」


【Package name】
アプリケーションのユニークな識別子です。

「The package name must be a unique identifier for your application.It is typically not shown to users, but it must stay the same for the lifetime of your application; it is how multiple versions of the same application are considered the "same app".This is typically the reverse domain name of your organization plus one or more application identifiers, and it must be a valid Java package name.」

尚、Package nameをデフォルトのままにしておくと、以下のメッセージが表示されます。

「The prefix 'com.example' is meant as a placeholder and should not be used.」

これは、ドメインの接頭辞(com.example)がプレースホルダだから使用してはいけないという意味です。


【Project location】
保存先


【Minimum required SDK】
アプリケーションがサポートする最低限のAPIレベルを選択します。バージョンの低いAPIは、多くのデバイスを対象としますが、利用できる機能は少なくなります。API8以降を対象とすることによって、市場の約95%をカバーできます。

「Choose the lowest version of Android that your application will support.Lower API levels target more devices, but means fewer features are available.By targeting API 8 and later, you reach approximately 95% of the market.」


【Target SDK】
アプリケーションが動作すること確認している最も高いAPIレベルを選択します。作成するアプリケーションが推奨とするAPIレベルを選択する。アプリケーションは、「Minimum required SDK」で指定したバージョンまで実行することができます。

「Choose the hightest API level that the application is known to work with.This attribute informs the system that you have tested against the target version and the system should not enable any compatibility behaviors to maintain your app's forward-compatibility with the target version.The application is still able to run on older versions(down to minSdkVersion).Your application may look dated if you are not targeting the current version.」


【Compile with】
アプリケーションをコンパイルするプラットフォームのAPIレベルを選択します。ここで選択できるAPIレベルはAndroid SDK Managerでインストール済みのパッケージとなります。

「Choose a target API to compile your code against, from your installed SDKs.This is typically the most recent version, or the first version that supports all the APIs you want to directly access without reflection.」


【Theme】
UIスタイルを選択する。「Holo Dark」「Holo Light」は、Compile WithでAPIレベル11以上を選択したときに有効です。「Holo Light with Dark Action Bar」は、Compile withでAPIレベル14以上を選択したときに有効です。

「The base user interface theme for the module.」


【Create custom launcher icon】
カスタムのランチャーアイコンを作成する場合は、チェックを入れます。


【Create activity】
Activityのテンプレートを作成する場合は、チェックを入れます。


【Mark this project as a library】
プロジェクトをライブラリとして作成する場合は、チェックを入れます。


【Support Mode】
APIレベルによっては提供されていないコンポーネントを、そのAPIレベルで利用するためのサポートモジュールです。
「GridLayout」をAPIレベル13以下で利用するには、チェックボックスにチェックを入れます。
「Fragments」「Navigation」「Action Bar」をAPIレベル10以下で利用するには、それぞれのチェックボックスにチェックを入れます。


項目を以下の通り選択して、「Next」をクリックします。




Activityの種類を選択するダイアログが表示されます。
「Blank Activity」を選択して、「Next」をクリックします。




Activityの名前などを設定するダイアログが表示されます。
デフォルトのまま[Finish]をクリックします。




プロジェクト画面が表示されます。



0 件のコメント:

コメントを投稿