Android Training/Creating an Android Project: Unterschied zwischen den Versionen

(vom original geguttenbergt)
 
Zeile 20: Zeile 20:
Your Android project is now set up with some default files and you’re ready to begin building the app. Continue to the [[Android Training/ Deine App starten|next lesson]].
Your Android project is now set up with some default files and you’re ready to begin building the app. Continue to the [[Android Training/ Deine App starten|next lesson]].


== Create a Project with Command Line Tools ==
== Erstellen eines Projektes mittels der Kommandozeilenwerkzeuge ==
Wenn du nicht die Eclipse Entwicklungsumgebung mit dem ADT plugin verwenden möchtest, kannst du stattdessen dein Android Projekt mit den SDK Kommandozeilenwerkzeuge erstellen:
If you're not using the Eclipse IDE with the ADT plugin, you can instead create your project using the SDK tools in a command line:
If you're not using the Eclipse IDE with the ADT plugin, you can instead create your project using the SDK tools in a command line:


# Wechsle in das Android SDK eigne <code>tools/</code> Verzeichnis.
# Change directories into the Android SDK’s <code>tools/</code> path.
# Change directories into the Android SDK’s <code>tools/</code> path.
# Führe <pre>android list targets</pre>aus. Dieser Befehl zeigt dir alle verfügbaren Android Plattformen an, welche du in die SDK installiert hast. Suche die "target id" der Plattform, für welche du deine App erstellen möchtest. Es ist empfehlenswert die letztmögliche Version auszuwählen. Du kannst deine App natürlich auch für ältere Geräte erstellen lassen, allerdings ist es später einfacher deine App für die neueste Androidversion anzupassen und somit eine größere Anzahl an Nutzern bekommst. Wenn du keine Plattform auswählen kannst, musst du zu erst einige Plattformen über den Android SDK Manager installieren. Siehe dazu [http://developer.android.com/sdk/installing/index.html#AddingComponents step 4 in the installing guide].
# Execute:<pre>android list targets</pre>This prints a list of the available Android platforms that you’ve downloaded for your SDK. Find the platform against which you want to compile your app. Make a note of the target id. We recommend that you select the highest version possible. You can still build your app to support older versions, but setting the build target to the latest version allows you to optimize your app for the latest devices.<br />If you don't see any targets listed, you need to install some using the Android SDK Manager tool. See [http://developer.android.com/sdk/installing/index.html#AddingComponents step 4 in the installing guide].
# Execute:<pre>android list targets</pre>This prints a list of the available Android platforms that you’ve downloaded for your SDK. Find the platform against which you want to compile your app. Make a note of the target id. We recommend that you select the highest version possible. You can still build your app to support older versions, but setting the build target to the latest version allows you to optimize your app for the latest devices.<br />If you don't see any targets listed, you need to install some using the Android SDK Manager tool. See [http://developer.android.com/sdk/installing/index.html#AddingComponents step 4 in the installing guide].
# Führe nun <pre>android create project --target <target-id> --name MyFirstApp --path <path-to-workspace>/MyFirstApp --activity MyFirstActivity --package com.example.myapp</pre> aus. Ersetze <code><target-id></code> mit der ID aus der Liste der Plattformen, für welche du die App erstellen möchtest. Ersetze <code><path-to-workspace></code> mit dem Pfad zu dem Ordner, in welcher du das Projekt speichern möchtest.
# Execute:<pre>android create project --target <target-id> --name MyFirstApp --path <path-to-workspace>/MyFirstApp --activity MyFirstActivity --package com.example.myapp</pre>Replace <code><target-id></code> with an id from the list of targets (from the previous step) and replace <code><path-to-workspace></code> with the location in which you want to save your Android projects.
# Execute:<pre>android create project --target <target-id> --name MyFirstApp --path <path-to-workspace>/MyFirstApp --activity MyFirstActivity --package com.example.myapp</pre>Replace <code><target-id></code> with an id from the list of targets (from the previous step) and replace <code><path-to-workspace></code> with the location in which you want to save your Android projects.


Dein Android Projekt wurde nun mit einigen Grundkonfigurationen erstellt und du bist bereit mit dem Erstellen deiner App zu beginnen. Mache mit der nächsten Lektion weiter.
Your Android project is now set up with several default configurations and you’re ready to begin building the app. Continue to the [[Android Training/ Deine App starten|next lesson]].
Your Android project is now set up with several default configurations and you’re ready to begin building the app. Continue to the [[Android Training/ Deine App starten|next lesson]].


'''TIP:''' Füge <code>platform-tools/</code> und <code>tools/</code> zu deiner <code>PATH</code> Umgebungsvariable hinzu.
'''Tip:''' Add the <code>platform-tools/</code> as well as the <code>tools/</code> directory to your <code>PATH</code> environment variable.
'''Tip:''' Add the <code>platform-tools/</code> as well as the <code>tools/</code> directory to your <code>PATH</code> environment variable.


{{Android Training/ Vorlage:Attribution}}
{{Android Training/ Vorlage:Attribution}}
11.008

Bearbeitungen