How to: Use the Sample Android Application in the Windows Azure Toolkit for Android

Author: Ralph Squillace

Reviewer: Scott Densmore

This topic describes how to download, build, and run the sample storage client application in the Windows Azure Toolkit for Android. This topic requires:

The project loads and compiles in Eclipse Indigo IDE for Java Developers (installable here) and runs using the Android Emulator; it does not describe how to install the sample application on an Android device. (For more information on installing applications during development, see Using Hardware Devices.) Lastly, this topic describes how to use Eclipse to clone and then load and use any contained projects from a git repository at, but does not describe git or GitHub themselves.

This topic assumes that you have already downloaded and are running the Eclipse IDE for Java Indigo Service Release 2; a new topic using a more current version will appear shortly. (Because of the differences between versions, please note which version you are going to use and adjust the instructions accordingly if documentation for your version isn’t yet available.) For more troubleshooting tips getting your Eclipse and Java environment running properly, see Getting Started.

Version d'Eclipse utilisée.

Versions du plug-in Eclipse utilisées.

Building and Running the Android Storage Application in Eclipse

  1. To get the sample application with the toolkit, navigate to to read the GitHub project page. You then have two choices: You can download the .zip file, uncompress it, and then use the files within from Eclipse as a local repository; or you can use Eclipse to perform this step from within the IDE.

  2. To download the .zip file and unzip it, click, uncompress the folder structure, and place the files in a location that is easily accessible location. It might look like this:

    Répertoire contenant l'archive compressée.
  3. Open Eclipse. The default window looks something like the following.

    Première vue d'Eclipse.
  4. Importing Toolkit Source and Projects

    1. From the File menu, choose Import…, and when the Import Selection dialog appears, choose Projects from Git, as shown below.

      Importation d'un projet Git.
    2. Choose local (if you zipped or cloned on your own) or provide URI.

      Sélection de l'emplacement du référentiel Git.
    3. Provide the Git repository URI and set the git:// protocol scheme: git:// (You can also use the https:// scheme, or provide a file path.)

      Sélection du protocole Git.
    4. Select the master branch (or another branch if you want to build newer versions in the testing phase).

      Importation d'une branche de projet Git.
    5. The repository is cloned to the repository path you specified in step c, above.

      Importation d'un référentiel cloné.
    6. Confirm that you want to import the existing projects.

      Sélection de projets existants à importer.
    7. Select which projects to import into the Eclipse workspace. Here you must select at least Access Control for Android, Windows Azure Storage for Android, and the Windows Azure Storage for Android Sample Application.

      Sélection de projets pour l'espace de travail.
    8. The Eclipse workspace should open and appear something like the following graphic.

      Première ouverture des projets.
  5. Now you modify the targets to build the projects correctly. For each project in your workspace, right-click the project in the Package Explorer and choose Properties. In the Properties form (an example is shown below), select Android in the left pane, and select the Android Project Build Target you have installed and want to build toward.

    Mise à jour de la cible du projet.
  6. Right-click the Windows Azure Storage for Android Sample Application, choose Run As..., and select Android Application. If you build and run, you should see the emulator appear. When it does, the default screen may need to be “opened”. Click the lock and drag it to the unlocked position, as the following graphic shows.

    How long the compilation and emulator start-up period is depends upon your platform and its resources. You may also see several console processes appear and disappear as the emulator starts.

    Déverrouillage de l'émulateur.
  7. Once the emulator is unlocked, you should see the following screen, indicating that you must provide valid toolkit connection type parameters in your application.

    Écran d'erreur de configuration de l'application.
  8. Update the toolkit_connection_type information in the project to use the Direct connection type and to have the DirectAccessKey and AccountName of the Windows Azure storage account. (To find your account information to run the application, see How to View, Copy, and Regenerate Access Keys for a Windows Azure Storage Account.)

    1. In the Eclipse Package Explorer, expand the Windows Azure Storage for Android Sample Application project, then expand the res entry, the values entry, and double-click the strings.xml file.

    2. In the strings.xml view in the middle panel, scroll down until you see the toolkit_connection_type value, and enter Direct as the value, as in the following image:

      Définition du type du toolkit.
    3. Enter the DirectAccessKey and AccountName values from your Windows Azure storage account. The following graphic shows the entry of the account name to the direct_account_value.

      Définition du nom du compte.
  9. Press Run, and the emulator should launch, providing you with the following experience.

    Exécution de l'application.

Voir aussi

Date de génération :


Ajouts de la communauté