Skip to content

Files

Latest commit

213a08a · Apr 16, 2022

History

History
56 lines (34 loc) · 3.59 KB

cognitive-services-speech-service-quickstart-java-android-create-proj.md

File metadata and controls

56 lines (34 loc) · 3.59 KB
author ms.service ms.topic ms.date ms.author
trrwilson
cognitive-services
include
10/15/2020
travisw
  1. Open Android Studio, and select Start a new Android Studio project in the Welcome window.

    Screenshot of the Android Studio Welcome window.

  2. The Choose your project wizard appears. Select Phone and Tablet and Empty Activity in the activity selection box. Select Next.

    Screenshot of the wizard for choosing a project.

  3. On the Configure your project page:

    1. For Name, enter Quickstart.
    2. For Package name, enter samples.speech.cognitiveservices.microsoft.com.
    3. For Save location, select a project directory.
    4. For Minimum API level, select API 23: Android 6.0 (Marshmallow).
    5. Leave the two check boxes clear, and select Finish.

    Screenshot of the selections for configuring a project in the wizard.

Android Studio takes a moment to prepare your new Android project. Next, configure the project to know about the Azure Cognitive Services Speech SDK and to use Java 8.

[!INCLUDE License notice]

The current version of the Cognitive Services Speech SDK is 1.21.0.

The Speech SDK for Android is packaged as an Android Archive (AAR) file, which includes the necessary libraries and required Android permissions. It's hosted in a Maven repository at https://azureai.azureedge.net/maven/.

Set up your project to use the Speech SDK. Open the Project Structure window by selecting File > Project Structure from the Android Studio menu bar. In the Project Structure window, make the following changes:

  1. In the list on the left side of the window, select Project. Edit the Default Library Repository settings by appending a comma and the Maven repository URL enclosed in single quotation marks: 'https://azureai.azureedge.net/maven/'.

    Screenshot of the Project Structure window.

  2. In the same window, on the left side, select app. Then select the Dependencies tab at the top of the window. Select the green plus sign (+), and select Library dependency from the drop-down menu.

    Screenshot of a library dependency in a project structure.

  3. In the window that appears, enter the name and version of the Speech SDK for Android: com.microsoft.cognitiveservices.speech:client-sdk:1.21.0. Then select OK.

    The Speech SDK should now be added to the list of dependencies:

    Screenshot of the Speech SDK in the list of dependencies.

  4. Select the Properties tab. For both Source Compatibility and Target Compatibility, select 1.8.

    Screenshot of selections for Source Compatibility and Target Compatibility.

  5. Select OK to close the Project Structure window and apply your changes to the project.