Getting Started for Eclipse

This article explains how to start using Telerik UI for Android in Eclipse after you have completed the download steps.

Overview

The Telerik UI for Android Eclipse distribution comes as a set of Eclipse Shared Library projects. To be able to use Telerik UI for Android in Eclipse, you will need to complete the following steps:

  1. Add all Shared Library projects containing the Telerik UI for Android components in your workspace
  2. Some of the Telerik UI for Android components are referencing the v7 AppCompat and v7 RecyclerView libraries as described in the installation contents and dependencies section. The v7 AppCompat and v7 RecyclerView libraries for Eclipse are normally located in \sdk\extras\android\support\v7\ within your main Android SDK installation folder. You will need to import them into your worskpace as well.
  3. Make sure all dependencies (as described in the installation contents and dependencies section) between the Telerik UI for Android projects are correctly set.

The latest available version of Telerik UI for Android is built with versions 23.1.1 and targets API 23. The suite uses features that have been added with these versions which means that you need to reference the same appcompat version in your build.gradle and target the same API (or optionally newer versions in case they doesn't contain breaking changes). Please note, that the Target API level is different than the Minimum API level. UI for Android supports API 14 as a Minimum API level. Here's more about the difference between Minimum and Target API Levels.

Importing the Shared Library projects into your workspace

  1. Select File -> New -> Project from the menu bar in Eclipse. TelerikUI-Installation-Eclipse-New-Project

  2. In the New Project Wizard, select Android -> Android Project from Existing Code and click Next. TelerikUI-Installation-Eclipse-Existing-Code

  3. Use Browse to navigate to the Controls\Eclipse folder inside the installation folder of Telerik UI for Android and then click Finish. Please note that in Windows you may not be able to complete this step if the controls are installed in Program Files. If this is the case you can go to the installation folder for Eclipse (C:\Program Files (x86)\Telerik\UI for Android [Version]\Controls\Eclipse) and copy the contents to a safe location (or run Eclipse as administrator). Then you will be able to create the project from the copied code. Now you should have a workspace containing everything necessary to use Telerik UI for Android. Right-click on each project and select Properties. Make sure the project is marked as library: TelerikUI-Installation-Eclipse-Library-Project

  4. Add the following support libraries as explained in the 'Adding libraries with resources' section of this article :

    • v7 AppCompat (\extras\android\support\v7\appcompat)
    • v7 RecyclerView (\extras\android\support\v7\recyclerview) > Not all modules use the appcompat and recyclerview libraries. Make sure you import them if you are using the Telerik UI for Android modules that require them as explained in the installation contents and dependencies section.
  5. Your workspace is now ready to use Telerik UI for Android.

Using Telerik UI for Android in a brand new Android Application Project

  1. To create a new Android Application project in Eclipse select File -> New -> Android Application Project.

  2. Fill in the required information about your application project and make sure that you select API 14: Ice Cream Sandwich or newer as Minimum Required SDK. TelerikUI-Installation-Eclipse-Minimum-SDK

  3. You can fill the other settings from the wizard according to your preferences.

  4. Make sure you have imported the v7 AppCompat and v7 RecyclerView libraries and reference them if needed. For more information on which Telerik UI for Andriod modules require these libraries, take a look at the installation contents and dependencies section.

  5. Right-click the project in the Package Explorer and select Properties. Select Android and click Add and select the needed library projects from those you have already imported following the steps from the Importing the Shared Library projects into your workspace. TelerikUI-Installation-Eclipse-Add-Reference

  6. Click OK. After you rebuild the solution, you will be ready to use the controls from Telerik UI for Android inside your application.

Opening the Examples solution

We have prepared an Examples solution which you can find in the extracted archive (or the installation folder of Telerik UI for Android). In order to run the demo, you need to prepare your workspace by following the steps from the previous section. Then you can continue with the import of the Examples solution:

  1. Create another new project from existing code by using the files you will find inside the Eclipse\Examples folder in your main Telerik UI for Android installation folder (C:\Program Files (x86)\Telerik\UI for Android [Version]\Examples if you installed the controls). Again, you may not have a permission to create the project from code inside Program Files, so you may need to copy the content to another folder before the import.

  2. Add the following support libraries as explained in the 'Adding libraries with resources' section of this article :

    • v7 AppCompat (\extras\android\support\v7\appcompat)
    • v7 RecyclerView (\extras\android\support\v7\recyclerview)
    • Design (\extras\android\support\design)
  3. You will also need to reference the Google Play Services library which is located in the \extras\google\google_play_services\libproject\google-play-services_lib subfolder of your Android SDK installation folder. This is done similarly to the AppCompat libraries. If you need further guidance regarding the Play Services lib integration, you can take a look at the official guide provided by Google: Adding Google Play Services in Eclipse ADT project

  4. Another external reference, that you will need is the Fresco library. More about it you can read from its official documentation.

  5. After referencing the required libraries, you will need to reference the Telerik UI for Android framework to be able to run the examples application. Right-click the Examples project in the Package Explorer and select Properties. Select Android and click Add and select all library projects you have just imported by following the steps from the Importing the Shared Library projects into your Workspace section. TelerikUI-Installation-Eclipse-Add-Reference

  6. Add the folder java to the Java Build Path list: TelerikUI-Installation-Eclipse-Build-Path

  7. You can rebuild the solution and deploy it on your Android device and/or emulator.