AWS S3 Gradle dependency line - android

Is there any way to add AWS S3 compile line to build.gradle to load jar files to Android project?
I can add them to libs folder after downloading full zip package from Amazon. But I want to do it using dependency.
I've tried something like this, but have no luck.
dependencies {
compile 'com.amazonaws:aws-android-sdk:+'
}
The only solution had result was using java sdk, but I want to use new Android lib.
dependencies {
compile 'com.amazonaws:aws-java-sdk:+'
}
Can I find and read more info about how to build compile line, where to find this line in Maven repo? I need S3 and Core libs for my project.

It is found in the documentation:
compile 'com.amazonaws:aws-android-sdk-s3:2.+'
http://docs.aws.amazon.com/mobile/sdkforandroid/developerguide/setup.html

The AWS Android SDK does support Maven/Gradle.
Please see this blog post
https://mobile.awsblog.com/post/Tx33541C1DGXVQ2/AWS-Mobile-SDK-for-Android-Maven-Support
Or just search the Maven repo for "android" http://mvnrepository.com/artifact/com.amazonaws

The Android SDK libraries are not available in Maven Central therefore you cannot bring them in as a remote dependency. Apparently this is something the Amazon AWS team is looking into.

Related

Jar file in parse sdk android studio

I am trying to setup parse server in android studio.the problem which i face i am not able to found parse jar file and how i add in lib folder??
where I found jar file how we connect with parse server
I refer this tutorial http://brainwashinc.com/2017/02/17/setting-parse-sdk-android/
Downloaded SDK
Put jar file in ‘libs’ dir same level as project ‘java’ dir under src/main
Added Gradle line for jar file to build.gradle (for app module, not project):
I notice the guide you linked doesn't mention specifying the fileTree for jars.
In your module-level build.gradle, make sure you have this line:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
...
}
This will tell gradle that it should look for .jar files in the libs directory. Without this line, gradle has no way of finding your jar file.
Please let me know if this solves your issue!
The tutorial you are referring to is very old (according to the url path), and contains outdated steps for importing Parse SDK into Android project.
So to answer your question and add little background:
where I found jar file how we connect with parse server
Parse stopped distributing SDK .jar artifacts in 2017, so there is no .jar file to download. (I'm not counting old artifacts still hanging around JFrog's Bintray) More background info here.
The current way of importing Parse SDK is to add it as a gradle dependency.
Since they're distributing artifacts via Jitpack, which is not included by default in new Android Studio project, you must add this to your root build.gradle.
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
And then add the library to your module build.gradle (In most cases this would mean app/build.gradle). You can find latest version on Jitpack project page.
dependencies {
implementation "com.github.parse-community.Parse-SDK-Android:parse:latest_version"
}
For more information and to avoid similar problems with outdated instructions, I recommend reading the official docs.

Linux - How to install osmdroid libraries for android studio with Gradle?

I am trying to do a tutorial for making an Android application using osmdroid with android Studio, but I didn't succeed to use the library I download on https://github.com/osmdroid/osmdroid
My questions are following :
Where do I have to put the folder download at: github.com/osmdroid/osmdroid ? I don't find any libs folder in home/android/sdk.
Which version I have to put in this command:
dependencies {
compile 'org.osmdroid:osmdroid-android:(INSERT_VERSION_HERE):release‌​#aar'
}
instead of INSERT_VERSION_HERE. I don't know how to find it.
Follow the steps at https://github.com/osmdroid/osmdroid/blob/master/README.md
You don't have to download anything manually. Open your build.gradle and add the following lines (or amend your already existing sections):
repositories {
mavenCentral()
}
dependencies {
compile 'org.osmdroid:osmdroid-android:5.6.5'
}
For a list of released osmdroid versions see https://github.com/osmdroid/osmdroid/releases. Currently the newest release is 5.6.5 (as of Feb 4th, 2017).

How do I host Github repository to Gradle

I have a repository on Github, I would like to use my repository in Android Studio using: dependencies {compile 'com.google.code.gson: Gson: 2+'} for gradle. Does someone know how to do this?
You could use JitPack.io to expose your repository as a Maven dependency. Then including it in Android Studio is easy with gradle:
compile 'com.github.YourUsername:RepoName:ReleaseVersion'
There are more instructions on the website.
I don't know if I really got the question...I understood that you want to compile some jar files that are not local to your project and are hosted in your repository. If it is the matter, I guess you should use a custom maven repository, not a Github one. If this is the problem I can give you more details on how to create a custom maven repo.
It's like #dometheshooter said.
See:
How to publish aar file to Apache Archiva with Gradle
Guide to publish an aar to maven using gradle
How to deploy JAR to Maven remote repository
Guide to uploading artifacts to the Central Repository
Guide to deploying 3rd party JARs to remote repository

How to add a github library to gradle

I made a android library in github that i want to add to Gradle,
that other people can add
compile "my project ..."
to there android build.
how can i upload it to Gradle?
(I didn't find an answer for this anywhere)
EDIT:
To clear my question, I want to release a library for developers.
Thanks
You don't "upload a library to gradle" ;-), you make it accessibla via gradle, so you first have to compile your library and publish the generated artefacts (aar or jar files) to a central repository, like Maven Central.
There are two common Maven repositories at time of this writing:
Maven Central http://search.maven.org/
JCenter https://bintray.com/bintray/jcenter
See this guide as a direction for mavenCentral:
http://www.vandalsoftware.com/post/52468430435/publishing-an-android-library-aar-to-a-maven
Since recent Android Studio versions, JCenter is the preferred default repository, so you may register there and upload your archives to it, like explained here:
https://www.virag.si/2015/01/publishing-gradle-android-library-to-jcenter/
Hope that helps.
The easiest way to expose your library to other developers is by using the JitPack service.
The requirement is that you create a GitHub release and that you have a build file in your repository. It doesn't require that you upload your library.

The best way to integrate third party library in Android studio

We can find some very good open source libraries for android. I want to know what is the best way to integrate them to our own projects in Android studio. Here are some basic methods:
Copy the source code and resource files into our own project. We need to change a lot of codes (the package name, and the name in xml,etc)
If jar files is provided, I just create libs folder for my project and copy the jar files inside. And add the jar file in Module setting's dependencies. But unfortunately I got a lot of error messages like "Gradle: Package com.google.gson doesn't exist".
Is there a general rule to add third party source or jar files into an existing android studio project? Thanks
I prefer to use central repository for dependencies management. So for gson 2.3 dependency you should add to build.gradle file:
Specify that you want to use maven central repository for your dependency
repositories {jcenter()}
Add compile dependency to gson 2.6.2
dependencies {compile 'com.google.code.gson:gson:2.6.2'}
Android Studio as well as your CI server should easily build your project now. And you can continue app development.
I prefer to use central repository for dependencies management because:
easier scope management - some libraries are only for testing, some should be included to apk and some are part of running environment (like android.jar itself)
easier transitive dependencies management - it is quite hard to collect libraries dependencies and if you use "jar-with-dependencies" you could get error "class already added" during dexing
lighter repository and easier dependency upgrade
Examples:
Robolectric jar should be used for unit testing only and shouldn't be part of apk itself
Repository is clean from different folders with jars, checkout takes much less. No needs to download and replace old jars with new jars
I should notice:
Not many libraries are in maven central and you should make some effort to use them such way in your project
You could much easier get to "class already added" error during dexing with central repository approach
You can mix usage of dependencies from central repository and from lib folder, but I prefer to use only one way for simplicity
Put the Gson jar (in my case, gson-2.2.4.jar) into the libs folder
Right click it and hit 'Add as library'
Ensure that compile files('libs/gson-2.2.4.jar') is in your build.gradle file
Do a clean build (you can probably do this fine in Android Studio, but to make sure I navigated in a terminal to the root folder of my app and typed gradlew clean. I'm on Mac OS X, the command might be different on your system
This series of steps was taken from Android Studio: Add jar as library? and is not my original answer. I am posting them here, again, because your question was the third in search results on Google when looking up this same topic. Hence, copying.
All credits to the one who wrote the steps.
Download & Copy Your .jar file in libs folder then adding one line to build.gradle:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar']) ----> AS creates this
compile 'com.google.code.gson:gson:2.3.4' ----------> I added this one
}
Do not forget to click "Sync now"
I´m using Android Studio 1.1.0
Download and copy your jar to libs folder then add the following to your app.gradle file and SYNC.
dependencies {
compile 'com.google.code.gson:gson:{version_you_need}'
}
repositories{
flatDir{
dirs 'libs'
}
}

Categories

Resources