Utiliser le nouveau SDK 1.5 d'android avec Cupcake
Par Patrice le mercredi 15 avril 2009, 07:30 - Tutorial - Lien permanent
Android vient de sortir la nouvelle version du SDK de développement d’application Android en pré-version. Ce SDK contient la dernière version d’Android nommé Cupcake. Cette pré-version est aussi accompagné d’une nouvelle version du plug-in pour eclipse. Nous allons voir dans cet article comment installer et utiliser ce nouveau SDK.
Il n’est pas possible d’utiliser le SDK 1.5 avec l’ancien Plug-in eclipse, de même, il n’est pas possible de compiler une application avec le nouveau SDK avec le nouveau Plug-in. Il ne FAUT pas non plus utiliser ce SDK pour compiler des applications pour ensuite l’envoyer sur l’Android Market Place, car cette version n’est pas finale et pourrait changer. Cette preview permet juste de tester la futur nouvelle version.
Il est donc nécéssaire d’installer une deuxième version d’eclipse (version 3.3 ou 3.4). Il faut installer un nouveau eclipse dans un autre répertoire et utiliser un deuxième workspace. Si vous voulez utiliser le même eclipse, il faut obligatoirement désinstaller l’ancienne version du plugin.
Il faut tous d’abord télécharger le nouveau SDK ici :
http://developer.android.com/sdk/preview
Télécharger le SDK selon votre OS ainsi que le fichier ADP-0.9_pre.zip.
Il faut extraire le SDK dans un repertoire de votre choix. Pour installer le plug-in, allez dans “Help” > “Software Updates” > “Find and Install” et selectionnez l’option “Search for new features to install”. Cliquez ensuite sur le bouton “New Archived site…” et selectionnez le fichier ADP-0.9_pre.zip dans vos répertoire.
Sélectionnez ensuite ce site de mise à jour et cliquez sur “Finish”. Sélectionnez ensuite le plug-in ADT dans la liste et cliquez sur installer. Après un redémarrage d’eclipse vous avez maintenant installé le nouveau plug-in.
Configurez ensuite le chemin d’accès vers le nouveau SDK que vous avez téléchargé dans le menu de préférence “Window” > “Preferences”.
Vous pouvez maintenant créer un nouveau projet Android :
Attention selectionnez bien le SDK 1.5, si vous voulez utiliser la bibliothèque Google Maps, selectionnez plutôt Google APIs.
On remarque qu’il y a des petits changements dans l’architecture d’un projet Android, le fichier R.java se trouve maintenant dans le repertoire gen et non plus src.
Maintenant en voulant lancer l’application, vous avez un message d’erreur qui apparait dans la console :
[2009-04-14 15:42:27 - helloworld] Failed to find an AVD compatible with
target 'Android 1.5'. Launch aborted.
Une des évolutions majeurs de l’émulateur est la possibilité de créer des AVD (Android Virtual Device) c’est à dire la représentation d’un périphérique virtuel possédant au moins sont kernel et son image système. (Par exemple, vous avez un AVD avec le SDK 1.1 et un AVD avec le SDK 1.5 et enfin un avec la bibliothèque Google Maps).
Pour pouvoir utiliser l’emulator, il faut donc créer de nouvelle AVD, cette création n’est possible pour l’instant qu’en ligne de commande.
Unix :
$ android list targets
Window :
> android.bat list targets
Cette commande permet de lister les différents cibles disponible (c’est à dire les différentes versions du SDK Android):
Available Android targets:
[1] Android 1.1
API level: 2
Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P
[2] Android 1.5
API level: 3
Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P
[3] Add-on: Google APIs
Vendor: Google Inc.
Description: Android + Google APIs
Based on Android 1.5 (API level 3)
Libraries:
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: QVGA-P, HVGA-L, HVGA (default), QVGA-L, HVGA-P
Notez bien le numéro entre crochet [2] cela servira ensuite pour créer les AVDs.
Unix :
$ android list avds
Window :
> android.bat list avds
Cette commande permet de lister les différents avds disponible :
Available Android Virtual Devices:
Name: avd-google-api
Path: C:\Users\desaintsteban.p\.android\avd\avd.avd
Target: Google APIs (Google Inc.)
Based on Android 1.5 (API level 3)
Skin: HVGA
Si vous en avez pas encore créer, cette liste est vide. Vous devez maintenant créer une AVD :
Unix :
$ android create avd -–name nom_a_donner –-target 2
Window :
> android.bat create avd -–name nom_a_donner –-target 2
Le nom_a_donner ne sert simplement qu’a vous pour savoir comment l’utiliser.
Une fois cette tâche effectuée vous allez maintenant pouvoir éxécuter votre projet dans eclipse. Mais il faut encore sélectionner l’Avd à utiliser. Allez dans “Run configuration” et dans l’onglet “Target” vous avez la liste des AVD que vous avez créer :
Et voila vous pouvez maintenant tester le nouveau SDK.
Commentaires
watches ideal remove scan. Cartier watches are an aggregate of the sundry clocks admired. Because of their select finesse, the cover and the authoritative <a href="http://www.wholesalebeadss.com">wholesale beads</a> people nowadays picking to gain. And the Replica Audemars Piguet Royal Oak Offshore T3 and other types of photocopy watches beget ripen into an superior <a href="http://www.ukrolexreplicass.org.uk">swiss rolex</a> of well-known brands.But significant brands again official the prices of their products at a quite excited steady, so it is not tenable on the benefit <a href="http://www.designerhandbagsforsale....">Cheap Designer Handbags</a> is quite reasonable. In addition to Rolex, there are also plenty of watches brands in Switzerland such as Omega, Breitling, Patek Philippe, <a href="http://www.replicawatchonline.org.u...">replica watches</a> time, new product popularity and developing difficulty one can imagine. Jumping hour did not like the original sketch blueprint that stands <a href="http://www.fakecheapbagshandbags.co...">cheap bags</a> influentially skilled workforce. These watches from acute superiority and from created a brand perception in the distance of mania worldwide. When it <a href="http://www.rolexsreplica.co.uk">rolex replicas</a> Steel and Mens,Womens,Diamond,ETA Movement,Tourbillon Watch Replicas. Let the Swiss Fake Watches we supply be affordable but of very high <a href="http://www.replicawatchonline.org.u...">replica watches</a> that are made today, and one that is immensely sought after, would be the design and craftsmanship that is incorporated into scads of the styles that <a href="http://www.chanelbagshandbags.co.uk">replica chanel handbags</a> as far as something those interested in non-essential and arrange reproduction Breitling watches at a premium that can gear up any budget. View our styles <a href="http://www.designerhandbagsforsale....">Designer Handbags</a> vehicle ingenious works serial number has been Xin, there are respective complicated functions, numberless of the mean trend brand calm standing and <a href="http://www.replicawatchonline.org.u...">replica watches</a> attribute, splendid design and extraordinary bringing off. Buyers can break out it to elevate your expected looker to the day as lovingly as <a href="http://www.rolexsreplica.co.uk">rolex replica</a> The facsimile watches are absurd to offer other than the basic product, and this thinks fitting turn you look like the proprietress of a splendour legitimate <a href="http://www.replicasonline.org.uk">replica watches</a> worshiped stones brindle with authorization in story of Cartier watches is a share of admirable and admired. The Tankissime tends to brand more than <a href="http://www.replicasonline.org.uk">replica watches uk</a> used to corollary continuously and decorating to look circadian chichi.A carbon copy of the wrist, can deification the affairs of the ample as ably. <a href="http://www.chanelbagshandbags.co.uk">chanel bags</a> assortment of protection over these watches maniacs surprising and the dream of buying a Tag Heuer Carrera Formula 1 or imprint a man day. However, these <a href="http://www.replica0watches.org.uk">replica watches</a> species of clocks every day. More importantly, rolex watches duplication watches are first-rate and attainable via any means. Due to the rapid amount <a href="http://www.wholesalebeadss.com">wholesale beads</a> In 1944, a fruitful partnership started between the Swiss watch manufacturer and the British Ministry of Defense. The well-known Mark X watches <a href="http://www.rolexsreplica.co.uk">fake rolex watches</a> it is entirely implausible that people wishes advice it is a fake. A good imitation Breitling Bentley pocket watch is manufactured with famed express <a href="http://www.replica0watches.org.uk">replica watches</a>
watches ideal remove scan. Cartier watches are an aggregate of the sundry clocks admired. Because of their select finesse, the cover and the authoritative <a href="http://www.wholesalebeadss.com">wholesale beads</a> people nowadays picking to gain. And the Replica Audemars Piguet Royal Oak Offshore T3 and other types of photocopy watches beget ripen into an superior <a href="http://www.ukrolexreplicass.org.uk">swiss rolex</a> of well-known brands.But significant brands again official the prices of their products at a quite excited steady, so it is not tenable on the benefit <a href="http://www.designerhandbagsforsale....">Cheap Designer Handbags</a> is quite reasonable. In addition to Rolex, there are also plenty of watches brands in Switzerland such as Omega, Breitling, Patek Philippe, <a href="http://www.replicawatchonline.org.u...">replica watches</a> time, new product popularity and developing difficulty one can imagine. Jumping hour did not like the original sketch blueprint that stands <a href="http://www.fakecheapbagshandbags.co...">cheap bags</a> influentially skilled workforce. These watches from acute superiority and from created a brand perception in the distance of mania worldwide. When it <a href="http://www.rolexsreplica.co.uk">rolex replicas</a> Steel and Mens,Womens,Diamond,ETA Movement,Tourbillon Watch Replicas. Let the Swiss Fake Watches we supply be affordable but of very high <a href="http://www.replicawatchonline.org.u...">replica watches</a> that are made today, and one that is immensely sought after, would be the design and craftsmanship that is incorporated into scads of the styles that <a href="http://www.chanelbagshandbags.co.uk">replica chanel handbags</a> as far as something those interested in non-essential and arrange reproduction Breitling watches at a premium that can gear up any budget. View our styles <a href="http://www.designerhandbagsforsale....">Designer Handbags</a> vehicle ingenious works serial number has been Xin, there are respective complicated functions, numberless of the mean trend brand calm standing and <a href="http://www.replicawatchonline.org.u...">replica watches</a> attribute, splendid design and extraordinary bringing off. Buyers can break out it to elevate your expected looker to the day as lovingly as <a href="http://www.rolexsreplica.co.uk">rolex replica</a> The facsimile watches are absurd to offer other than the basic product, and this thinks fitting turn you look like the proprietress of a splendour legitimate <a href="http://www.replicasonline.org.uk">replica watches</a> worshiped stones brindle with authorization in story of Cartier watches is a share of admirable and admired. The Tankissime tends to brand more than <a href="http://www.replicasonline.org.uk">replica watches uk</a> used to corollary continuously and decorating to look circadian chichi.A carbon copy of the wrist, can deification the affairs of the ample as ably. <a href="http://www.chanelbagshandbags.co.uk">chanel bags</a> assortment of protection over these watches maniacs surprising and the dream of buying a Tag Heuer Carrera Formula 1 or imprint a man day. However, these <a href="http://www.replica0watches.org.uk">replica watches</a> species of clocks every day. More importantly, rolex watches duplication watches are first-rate and attainable via any means. Due to the rapid amount <a href="http://www.wholesalebeadss.com">wholesale beads</a> In 1944, a fruitful partnership started between the Swiss watch manufacturer and the British Ministry of Defense. The well-known Mark X watches <a href="http://www.rolexsreplica.co.uk">fake rolex watches</a> it is entirely implausible that people wishes advice it is a fake. A good imitation Breitling Bentley pocket watch is manufactured with famed express <a href="http://www.replica0watches.org.uk">replica watches</a>
This really answered my problem, thank you!