Support

Building Layer with Eclipse

Layer is has been designed and built with Android Studio in mind, however, it is relatively simple to use the Layer SDK with Eclipse. Follow the directions below if you are building your app in Eclipse.

Make Sure Eclipse is Prepared for Android Development

You will need to configure Eclipse to work with Android projects. If you have built for Android before, you can skip this section.

  1. Make sure you have the latest version of Eclipse with the Java Development Tool (JDT) plugin
  2. Install JDK 6 from the Oracle website
  3. Follow the instructions here to download and configure the Android Development Tool (ADT) plugin
  4. In Eclipse, go to Window -> Android SDK Manager and make sure that the latest versions of the following packages are installed:
    • Tools -> Android SDK Tools
    • Tools -> Android SDK Platform-tools
    • Tools -> Android SDK Build-tools
    • Android [version_number] -> SDK Platform
    • Android [version_number] -> Google APIs
    • Extras -> Android Support Repository
    • Extras -> Android Support Library
    • Extras -> Google Play services

 

Create a New Android Project

Layer only works with Android development, so make sure your project is configured correctly.

  1. Go to File -> New -> Project
  2. Select Android -> Android Application Project
  3. Configure your settings as you wish. Note: Layer only supports SDK version "API 14" and higher.

 

Configure Your Project to Work with Layer

In order to configure your project with Layer, you must add the Layer SDK, Google Play Services, and a 3rd party logging library (which is required) in order to build with Layer.

  1. Download the latest Layer JAR file
    • Go here to find the latest Layer SDK
    • Open the latest version folder
    • Click on the JAR file (labeled layer-sdk-[version_number].jar)
    • Select "Raw" to download the file.
  2. Add the Layer SDK to your project
    • Drag the downloaded layer-sdk-[version_number].jar file into your project's "Libs" folder (if prompted, make sure you select "Copy files")
    • Right-click on your project's name and select "Properties"
    • Select "Java build path" in the left panel, and choose "Libraries"
    • Click "Add JARs" and navigate to Your_Project_Name -> Libs and select the Layer SDK
  3. Add Google Play Services to your project
    • Go to Window -> Android SDK Manager
    • Make sure Extras -> Google Play services is installed
    • Mouse over Extras -> Google Play services and make a note of the "Location"
    • Return to Eclipse and select File -> Import
    • Select Android -> Existing Android Code into Workspace
    • Enter Google Play service's location (from the Android SDK Manager) into the "Root Directory" field
    • Make sure "google-play-services_lib" is the only selected project
    • Check "Copy projects into workspace" and select Finish
    • In the Package Explorer window, right click your project and select "Properties"
    • Click "Android" in the left panel, under the Libraries section select "Add"
    • Select "google-play-services_lib" and hit "OK"
  4. Add the Simple Logging Facade for Java library to your project (you can learn more about the library here)
    • Download the slf4j-api-1.7.7.jar file (attached at the bottom of this document)
    • Drag the downloaded lslf4j-api-1.7.7.jar file into your project's "Libs" folder (if prompted, make sure you select "Copy files")
    • Right-click on your project's name and select "Properties"
    • Select "Java build path" in the left panel, and choose "Libraries"
    • Click "Add JARs" and navigate to Your_Project_Name -> Libs and select the lslf4j-api-1.7.7.jar file

You can now build with the Layer SDK. If you haven't already, make sure you complete the Quick Start Guide.

 

Note: you will also need to use v7 (or higher) of the Android Support Libraries or higher. You can download the android-support-v7.jar library by following these instructions.

Have more questions? Submit a request