Overview

The purpose of this document is to outline the steps needed to integrate the Symbol EMDK for Android into Android Studio, walk through the available methods in which you can add the EMDK library to your Android Studio project, and explain how to import the current Eclipse based EMDK sample projects into Android Studio.

The manual EMDK integration process is only temporary and will not be necessary after an installer for Android Studio has been completed.

Prerequisites

The following items must be installed before setting up Android Studio for EMDK development.

Make a note of the name and location where you install “Android Studio” and “Android SDK” on your system, you will need to refer to the Android SDK directory later when integrating EMDK for Android.

Setting up Android Studio for EMDK for Android development

EMDK SDK add-on Integration

Perform the following steps to make the EMDK available to Android API levels 16 & 19

  1. Locate the EMDK for Android installation root directory (default: C:\Program Files (x86)\Symbol EMDK for Android)

  2. Locate the Android SDK installation directory previously noted (default: C:\Users\xxx\ AppData\Local\Android\sdk)

  3. Copy the SDK add-ons from EMDK to Android SDK as mentioned below:

    Source: “…\Symbol EMDK for Android\v3.0\Integrator\add-ons\*.\”

    Destination: “…\Android\sdk\add-ons”

  4. Launch Android Studio

  5. Go to Tools > Android > SDK Manager

Now the integrated EMDK add-ons should appear in the SDK Manager:

img

EMDK Profile Manager Plug-in Integration

Perfom the following steps to integrate the EMDK Profile Manager into Android Studio’s Menu bar.

  1. Locate the Android Studio installation directory previously noted (default: C:\Program Files\Android\Android Studio)

  2. Download the “com.symbol.emdkplugin.zip” archive.

  3. Extract the archive.

  4. Copy the EMDK Wizard plugin into Android Studio as mentioned below:

    Source: com.symbol.emdkplugin”

    Destination: “…\Android Studio\plugins” (e.g.: “C:\Program Files\Android\Android Studio\plugins”)

  5. Exit & Launch Android Studio.

Now the EMDK menu should appear in the Android Studio menu bar.

img

EMDK for Android development with Android Studio

In order to enable EMDK development in your project, you must first add the EMDK library. The EMDK for Android library can be added to your project via one of the following three methods.

Specify the EMDK SDK add-on as the “Minimum SDK” in the New Android Studio Project wizard

  1. Launch Android Studio

  2. Select “Start a new Android Studio project” or File > New Project.

  3. Enter “Application name” and “Company Domain” and Click Next

  4. Select EMDK SDK add-on (ex: “Symbol Technologies, Inc.: EMDK API (16)”) as the “Minimum SDK” under Phone and Tablet.

    img

  5. Complete the New project Wizard by Clicking Next > Next > Finish

    Android Studio will display your project when Gradle build process is complete.

To verify that the EMDK has been added to your project.

  1. Go to File > Project Structure.

  2. Click on app under Modules in the Project Structure Window’s left-pane.

  3. Check the value of “Compile Sdk Version”. It should be the selected EMDK SDK add-on (see below)

Symbol Technologies, Inc.:EMDK 3.0 (API 16):16

Symbol Technologies, Inc.:EMDK 3.0 (API 19):19

img

Another method to verifiy EMDK project integration is via the build.gradle file.

Open build.gradle (Module: app) from the left-pane. The compileSdkVersion should be assigned to EMDK SDK add-on.

img

Your project is now ready for EMDK development (see EMDK Help for more information on creating an EMDK app).

Import EMDK lib JAR as a Module

Starting with a previously created Project with a minimum API level of 16 or 19

  1. Go to File > Project Structure

  2. Press the button marked with “+” at the top-left to add a new module.

  3. Select “Phone and Tablet Application”.

  4. Select “Import JAR or AAR Package” from the list More Modules then Click Next

  5. Click Browse button and locate the EMDK jar file (com.symbol.emdk.jar) from the SDK add-on folder and click OK

    img

    The new module will eventualy appear in the left-pane of the project structure window.

  6. Click on app in left-pane and select the dependencies tab

    img

  7. Press the button marked with the “+” at top-right to add select “Module Dependency”.

    img

  8. Select “com.symbol.emdk” from the “Choose modules” dialog then Press OK.

  9. The new dependency should be listed, now Press OK

    img

Your project is now ready for EMDK development (see EMDK Help for more information on creating an EMDK app).

Add EMDK SDK add-on name as the “Compile Sdk Version” in Project Structure

Starting with a previously created Project with a minimum API level of 16 or 19.

  1. Go to File > Project Structure

  2. Select app in the left-pane and Properties tab.

  3. Manually enter one of the following add-on names in the “Compile Sdk Version” depending on the API version (see below):

    SDK add-on (API 16) name: Symbol Technologies, Inc.:EMDK 3.0 (API 16):16

    SDK add-on (API-19) name: Symbol Technologies, Inc.:EMDK 3.0 (API 19):19

    img

  4. Click OK then Select Yes in the resulting dialog.

    img

Your project is now ready for EMDK development (see EMDK Help for more information on creating an EMDK app).

Importing EMDK Samples into Android Studio

Starting at the Android Studio Welcome Screen, Select “Import Non-Android Studio project”

  1. Locate the EMDK Samples path.

    For example:  “C:\Users\Public\Symbol EMDK for Android\v3.0\Samples\ADT”.

  2. Select the preferred sample, and press OK.

    img

  3. Click Next and then Finish to complete the import wizard.

    When Android Studio has completed the Gradle build, your sample project will be displayed.

  4. From the Build menu, select Rebuild Project.

    img

  5. Connect a Symbol Android device via USB, and select Run from the Run menu.

    img