Skip to content

Instantly share code, notes, and snippets.

@MRobertEvers
Last active June 25, 2018 18:10
Show Gist options
  • Save MRobertEvers/9d75911db4323f07fdf460f311b69ca8 to your computer and use it in GitHub Desktop.
Save MRobertEvers/9d75911db4323f07fdf460f311b69ca8 to your computer and use it in GitHub Desktop.
Mobile Dev Notes

Android Studio

What is Gradle

Gradle is a generic build system like Make (of course Gradle is more modern). It allows you to run scripts by using gradle.scripts or build.gradle. E.g.

dependencies{
    compile "Package..."
}

This tells the project to compile the Package... before compiling your project's code.

Gradle Package Management

Looks like gradle has its own package manager of sorts... It somehow knows how to download dependencies based on names like

dependencies {
    implementation 'com.amazonaws:aws-android-sdk-core:2.6.+'
    implementation 'com.amazonaws:aws-android-sdk-ddb:2.6.+'
    implementation 'com.amazonaws:aws-android-sdk-ddb-document:2.6.+'
}

When the build runs, it downloads these dependencies. How and where from?

Looks like this is specified in another gradle field

allprojects {
    repositories {
        google()
        jcenter()
    }
}

So when I name a package, gradle will look at these locations for packages.

For example

dependencies {
    implementation 'com.amazonaws:aws-android-sdk-core:2.6.+'
    implementation 'com.amazonaws:aws-android-sdk-ddb:2.6.+'
    implementation 'com.amazonaws:aws-android-sdk-ddb-document:2.6.+'
}

Gradle will look at https://bintray.com/bintray/jcenter/com.amazonaws%3Aaws-android-sdk-core for the first dependency above. (Note: I don't know why, but when I do a search on jcenter for "android-sdk-core" or "com.amazonaws", nothing comes up, but google found the link above just fine. Edit this search works "com.amazonaws:aws-android*"

Compiling and Using Java Libs

Java libraries must be compiled before use in your project just like C or C++.

Android Development Support Library

There is a support library with widgets and other tools for android development. https://developer.android.com/reference/android/support/v7/widget/CardView?hl=ko

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment