Setting Up the Gimbal SDK v1.x Beta in Android Studio

07. October 2014 Android 9

Important

This article only applies to the Gimbal Android SDK v1.x Beta. Gimbal is constantly making changes to their SDK and possible discrepancies may be found within this article depending upon the reader’s unique circumstances. Please refer to the official Gimbal documentation as the definitive source of official information.

Introduction

This article discusses how to setup the Gimbal SDK v1.x Beta in Android Studio. As of the date of this article, Gimbal has plenty of documentation on getting things working with Eclipse but many developers are moving to Android Studio. Following the instructions within will get that IDE working with Gimbal rather quickly. After reading this article, be sure to read this post to take a deep dive of how the SDK works with proximity beacons.

Setting up the Gimbal SDK with Proximity in Android Studio

  1. Download the applicable SDK from the Gimbal Developer site.
  2. Create a folder named libs in the root of the project. For example, \ProjectFolder\mobile\libs.
  3. Copy the following files from the SDK to the libs folder: android-dev-logging.jar, gimbal-proximity.jar, spring-android-core-1.0.1.RELEASE.jar, and spring-android-rest-template-1.0.1.RELEASE.jar.
  4. Modify AndroidManifest.xml and ensure the following permissions are added:
  5. Add the following code to the AndroidManifest.xml inside the application tag:
  6. Modify the code above and do the following (taken from the official documentation):

    Where it says “com.companyname.applicationname”, replace it with your application’s package name. (the package name you entered when you generated your API key)

  7. Open the file build.gradle. For example ProjectFolder\mobile\build.gradle.
  8. Ensure the dependencies node looks like this:
  9. Add the following right below the buildTypes node closing bracket:
  10. In Android Studio, go to File -> Synchronize.
  11. Then while still in the IDE, go to Build -> Rebuild Project.

Conclusion

If the steps above were followed correctly then no errors will occur upon building the project when using the Gimbal SDK. Hours of time were saved getting things working by following the advice of Rodrigo Esquivel who posted this answer (URL removed due to 404 error) to a question on the Gimbal Support page. It discussed how to modify the build.gradle file which was a life-saver so many thanks to such an excellent answer.

Keep in mind other steps will be needed to get it working even further (setting up application ID and secret key pragmatically with the SDK) but this article addressed getting the actual SDK files working with the IDE itself. It does not cover diving into the SDK but again that topic is discussed in this post.

Daniel Eagle

Currently residing in the Austin area, Daniel Eagle is an avid gamer, writer, technology/science enthusiast, software developer, and educator. He takes great pride in spreading knowledge and helping others.

More Posts - Website

Follow Me:
TwitterLinkedInYouTube