Exportar (0) Imprimir
Expandir Tudo

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 http://www.github.com, but does not describe git or GitHub themselves.

ImportantImportante
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.

Versão Eclipse usada.

Versões de plug-in do Eclipse usadas.

Building and Running the Android Storage Application in Eclipse

  1. To get the sample application with the toolkit, navigate to https://github.com/WindowsAzure-Toolkits/wa-toolkit-android 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 https://github.com/WindowsAzure-Toolkits/wa-toolkit-android/zipball/master, uncompress the folder structure, and place the files in a location that is easily accessible location. It might look like this:

    O diretório que o contém a zipball.
  3. Open Eclipse. The default window looks something like the following.

    A primeira exibição do 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.

      Importando um projeto git.
    2. Choose local (if you zipped or cloned on your own) or provide URI.

      Selecionando o local de repositório git.
    3. Provide the Git repository URI and set the git:// protocol scheme: git://github.com/WindowsAzure-Toolkits/wa-toolkit-android.git. (You can also use the https:// scheme, or provide a file path.)

      Selecionando o protocolo git.
    4. Select the master branch (or another branch if you want to build newer versions in the testing phase).

      Importando uma ramificação de projeto git.
    5. The repository is cloned to the repository path you specified in step c, above.

      Importando um repositório clonado.
    6. Confirm that you want to import the existing projects.

      Selecionando projetos existentes para importar.
    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.

      Selecionando projetos para o espaço de trabalho.
    8. The Eclipse workspace should open and appear something like the following graphic.

      A primeira vez que os projetos são abertos.
  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.

    Atualizando o destino do projeto.
  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.

    noteObservação
    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.

    Desbloqueando o emulador.
  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.

    A tela de aplicativo de erro de configuração.
  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:

      Configurando o tipo do kit de ferramentas.
    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.

      Configurando o nome da conta.
  9. Press Run, and the emulator should launch, providing you with the following experience.

    Executando o aplicativo.

Consulte também


Data da compilação:

2013-01-07

Contribuições da comunidade

Mostrar:
© 2014 Microsoft