Getting Started

This guide teaches developers how to set up their workstations in order to use Samsung Mobile SDKs in their apps. It covers basic topics such as how to download and install the SDK.

This section covers:

  1. 1.

    System Requirements.

  2. 2.

    Downloading Samsung Mobile SDKs.

  3. 3.

    Getting started with Android Studio.

1. System Requirements

To develop apps for Samsung mobile devices, you must first set up your Android development environment. If your development environment is already configured, you can skip this section.

  1. 1.

    Verify that your development system meets the requirements specified by the Android System Requirements.

  2. 2.

    Set up your Java environment:

    To develop Android apps in Java, you need the following:

    • Java Development Kit (JDK) — this provides the tools required to build a Java app.

    • Java Runtime Environment (JRE) — this lets you run Java apps on your computer.

    To set up these components:

    1. 1.

      Go to Java SE Downloads.

    2. 2.

      Click Java Download to display the download page for the latest version of JDK, which includes JRE.

    3. 3.

      Click the download package for your operating system: Windows, Mac OS X, or Linux.

    4. 4.

      Install the JDK package. For details about the installation, see the Java Platform Installation.

  3. 3.

    Download Android Studio:

    1. 1.

      Go to Android Studio.

    2. 2.

      If the browser has detected your operating system, click Download Android Studio.
      Otherwise, click Download Options and select a different platform: Windows, Mac OS X, or Linux.

    3. 3.

      Unzip and install the bundle. It includes essential components and the Studio IDE.

    4. 4.

      Launch Android Studio.

    5. 5.

      If you get a notice of Platform and Plugin Updates, click update to exit Studio and launch the SDK Manager. Then install the suggested packages.

2. Downloading Samsung SDKs

Samsung offers two ways for you to download an SDK, through the:

  • To download SDKs from Samsung Developers:

    1. 1. Go to Devices > Galaxy

    2. 2. Select the SDK you want to download.

    3. 3. Click the download button.

    4. 4. Read the license agreement, select I agree to this SDK License Agreement and click Download.

    5. 5. Unzip the downloaded SDK to a folder of your choice. The SDKs typically provide the following folders:

      • Docs: Programming guides and API references

      • Libs: Java and C libraries to use in your app

      • Samples: Sample apps showing example source code

      • Tools: Additional tools that may be needed to use the SDK

      • Extras: Additional support resources

  • The Android SDK Manager is a tool that helps you install Android SDK and external add-on packages. To run the Android SDK Manager:

    1. 1. Launch Android Studio.

    2. 2. In the top toolbar, select Tools > Android > SDK Manager

    3. 3. In the SDK Manager, Select Launch Standalone SDK Manager.

    4. 4. Select Tools > Manage Add-on Sites.

    5. 5. Click User Defined Sites and then click New.

    6. 6. Copy this URL into the text-field and click OK:

      http://developer.samsung.com/sdk-manager/repository/Samsung-SDK.xml

    7. 7. Click Close. On the Android SDK Manager, under the supported API level (in this case 21), the Samsung SDKs are listed:

    1. 1. In the Android SDK Manager, select the SDKs you would like to install and click Install packages.

    2. 2. For every SDK, you must select the Accept button to agree to the displayed SDK license. If you select the Accept License button, it automatically accepts the license for every SDK in one click.

    3. 3. Check the installation status at bottom of the window.

3. Getting started with Android Studio

This section describes how to create your first project in Android Studio and run an app.

    1. 1. Launch Android Studio.

    2. 2. Create a new project by clicking File > New Project

    3. 3. Fill out the fields:

      1. a) Application name: your app name

      2. b) Company domain: the qualifier for your app package name.

      3. c) Package name: this is the combination of the company domain and application name, which must be unique across all packages in the Android environment. Android generates this from the application name and company domain values.

      4. d) Project Location: the directory where your app is stored. You can use the default or specify another location, if desired.

    4. 4. Click Next.

    5. 5. Select the type of device you want to target, for example, Phone and Tablet.

    6. 6. Select the Minimum SDK level you need to support the SDKs you’re using. In this example, select API 21. Click Next.

    7. 7. Use the default Empty Activity type and click Next. For more about activities, see Android Activities.

    8. 8. Use the default Activity Name and Layout Name and click Finish.

      For more about creating a project in Android Studio, see Creating projects.

  • To use a Samsung SDK in your app, you add the library files that are bundled with the SDK to your Android Studio project.

    1. 1. Open your project in Android Studio.

    2. 2. Use a file browser to navigate to the folder containing the Samsung SDK.

    3. 3. Open the add-on SDK folder, then open:

      1. a. Docs > API Reference > index.html: to see what libraries and API methods are provided by the SDK

      2. b. Libs folder: to copy the libraries you want to use in your app

    4. 4. In your Android Studio project, top-left drop-down menu, change the Android view to Project.

    5. 5. Right-click your app’s libs directory and select Paste.

    6. 6. In the Copy dialog, click OK to paste the copied files into your project.

    7. 7. The libraries now appear in your project under the libs folder:

    8. 8. Right-click the libraries and select Add As Library.

    9. 9. Select the module to add the library to. If your app contains several modules, ensure that you add the library to the appropriate module. Click OK.

      Your project now includes the SDK you downloaded.

  • Android Studio provides two ways to compile and test your app:

    • On an Android Virtual Device (AVD)

    • On a physical Samsung device.

    To run your app:

    1. 1. Plug your Samsung mobile device into your computer using a USB cable.

    2. 2. If you are using a Windows computer, go to Samsung Android USB Driver for Windows, then download and install the USB driver onto your computer.

    3. 3. Enable developer options on your device by going to Settings > About device > Software info and tapping Build number seven times. (Devices with Android 4.1 or older already have developer options displayed by default.)

    4. 4. Turn on USB debugging by tapping Settings > Developer options > USB debugging.

      Note

      If My Knox is installed, USB debugging is grayed out; try using another device.

    5. 5. In Android Studio, with your project open, click Run > Run 'app' (or press Shift + F10).

    6. 6. Select the device you want run the app on, under either Connected Devices or Available Emulators.

  • The sample apps are in the Samples folder of the SDK you downloaded.

    To run a sample app:

    1. 1. Open Android Studio.

    2. 2. In the top navigation menu, select File > Open.

    3. 3. Navigate to the sample app directory in the SDK you downloaded.

    4. 4. Click OK to import the file to your project.