Экспорт (0) Печать
Развернуть все

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.

ImportantВажно!
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.

Используемая версия Eclipse.

Используемые версии подключаемого модуля Eclipse.

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:

    Каталог, содержащий zipball.
  3. Open Eclipse. The default window looks something like the following.

    Первое представление 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.

      Импорт проекта git.
    2. Choose local (if you zipped or cloned on your own) or provide URI.

      Выбор расположения репозитория 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.)

      Выбор протокола git.
    4. Select the master branch (or another branch if you want to build newer versions in the testing phase).

      Импорт ветви проекта git.
    5. The repository is cloned to the repository path you specified in step c, above.

      Импортирование клонированного репозитория.
    6. Confirm that you want to import the existing projects.

      Выбор существующих проектов для импорта.
    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.

      Выбор проектов для рабочей области.
    8. The Eclipse workspace should open and appear something like the following graphic.

      Первое открытие проектов.
  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.

    Обновление цели проекта.
  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.

    noteПримечание
    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.

    Разблокирование эмулятора.
  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.

    Экран приложения с ошибкой конфигурации.
  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:

      Задание типа набора средств.
    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.

      Задание имени учетной записи.
  9. Press Run, and the emulator should launch, providing you with the following experience.

    Выполнение приложения.

См. также


Дата сборки:

2013-01-07

Добавления сообщества

Показ:
© 2015 Microsoft