{"componentChunkName":"component---src-templates-tag-js","path":"/tags/android/","result":{"data":{"site":{"siteMetadata":{"title":"LoginRadius Blog"}},"allMarkdownRemark":{"totalCount":1,"edges":[{"node":{"fields":{"slug":"/engineering/how-to-use-jcenter-dependencies-in-android-studio/"},"html":"<p>jCenter is the public repository hosted at <a href=\"https://bintray.com/\">bintray</a> that is free to use for open source library publishers. It is the largest repository in the world for Java and Android OSS libraries, packages and components. All the content in JCenter is served over a CDN, with a secure HTTPS connection. In this article, we’ll discuss how to make use of jCenter dependencies in Android Studio.</p>\n<p>Prerequisites</p>\n<ul>\n<li>Android Studio</li>\n<li>Existing project in Android Studio</li>\n<li>Active internet connection</li>\n</ul>\n<p>If you don’t have Android Studio installed, you can download from the following link:</p>\n<p><a href=\"https://developer.android.com/studio/index.html\">Android Studio</a></p>\n<p>After successfully installing Android Studio, you can open an existing project or create a new project to start with.</p>\n<p><strong>Usage</strong></p>\n<p>After opening or creating a new project, you can find two files named “build.gradle” under Gradle Scripts section in the left pane. The first one will be suffixed with “Project” and another with “Module”. We’ll start with the “Project” one.</p>\n<p>Add jCenter repository in project’s build.gradle file as shown below and sync your project:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">allprojects {</span>\n<span class=\"grvsc-line\">   repositories {</span>\n<span class=\"grvsc-line\">       jcenter()</span>\n<span class=\"grvsc-line\">\t   . . .</span>\n<span class=\"grvsc-line\">   }</span>\n<span class=\"grvsc-line\">}</span></code></pre>\n<p>On successful sync, you’re now able to add any Android dependency hosted on jCenter repository. The dependency will be added to “Module” build.gradle. It’s also known as app’s build.gradle.</p>\n<p>For example, if you want to add LoginRadius dependency/library, you can add in app’s build.gradle as follows and sync your project:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">compile &#39;com.loginradius.android:androidsdk:3.3.1&#39;</span></code></pre>\n<p>If all the steps are followed successfully, you’re now able to add a jCenter dependency in Android Studio.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n</style>","frontmatter":{"date":"July 11, 2017","updated_date":null,"title":"jCenter Dependencies in Android Studio","tags":["JCenter","Android"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.7699115044247788,"src":"/static/21f45b8f9eba48b3695a10929ce75fff/ee604/jCenter.png","srcSet":"/static/21f45b8f9eba48b3695a10929ce75fff/69585/jCenter.png 200w,\n/static/21f45b8f9eba48b3695a10929ce75fff/497c6/jCenter.png 400w,\n/static/21f45b8f9eba48b3695a10929ce75fff/ee604/jCenter.png 800w,\n/static/21f45b8f9eba48b3695a10929ce75fff/f3583/jCenter.png 1200w,\n/static/21f45b8f9eba48b3695a10929ce75fff/e4d72/jCenter.png 1280w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Hitesh Pamnani","github":null,"avatar":null}}}}]}},"pageContext":{"tag":"Android"}},"staticQueryHashes":["1171199041","1384082988","2100481360","23180105","528864852"]}