JCenter hosts java applications that follow maven convention - android

After publishing library on bintray i received one mail from support. Below
Bintray (bintray) has sent you a direct message from Bintray:
Hi,
JCenter hosts java applications that follow maven convention.
In addition to the .pom file, your version should include a binary jar file, a sources jar, and optionally a javadoc jar.
Your files should be under a maven path layout.
(see https://bintray.com/docs/usermanual/uploads/uploads_includingyourpackagesinjcenter.html)
Once those files are added, we'll be glad to include your package in JCenter
Last activity on bitray account showing library released. What's the step need to follow now. Any help will be appreciated. Thanks

I got same Email once . I was trying only to upload library with out sample. Later I changed the format , Create a new android project and attach library to sample and pushed it and it got accepted .
Here is a sample library of mine which I created for learning purpose
https://github.com/Redman1037/MenuDrawer
In bintray account the structure should be like
it should contain all the below files

Related

APK Expansion Files: Specifying library path in Android Studio (Windows)

I am on Android Studio (Windows 10). I have been trying to follow the steps in https://developer.android.com/google/play/expansion-files.html but am stuck at the section "Preparing to use the Downloader Library". I have downloaded and installed Google Play License Library and Google Play Downloader Library. I have created the corresponding modules. But when I go to Module Settings and specify the path to the Library Repository, I get errors and when I open up Module Settings again, the Library Repository field remains blank. The error I get are :
10:23:57 PM IncorrectOperationException: Error while applying changes: cannot create file from text: C:\Users\n56\AppData\Local\Android\sdk\extras\google\market_apk_expansion\downloader_library\
10:36:23 PM IncorrectOperationException: Error while applying changes: cannot create file from text: C:\Users\n56\AppData\Local\Android\sdk\extras\google\market_licensing\library\
And the library repository paths I specified are :
C:\Users\n56\AppData\Local\Android\sdk\extras\google\market_apk_expansion\downloader_library
C:\Users\n56\AppData\Local\Android\sdk\extras\google\market_licensing\library\
I have tried various things like escaping the backslashes, importing the modules instead of clicking New Modules but to no available.
Would be grateful for any help. TIA.
The documentation of this tutorial miss the reference of the Android Manifes.xml file on the path for each android-library.
The correct path for each library are:
Google Play License Library
<sdk>/extras/google/play_licensing/library/AndroidManifest.xml
Google Play Downloader Library
<sdk>/extras/google/play_apk_expansion/downloader_library/AndroidManifest.xml
I noticed that on other tutorial from Google where use the same library for setting up the Licensing Verification Library
ANSWER UPDATED:
These previous method only reference one file of the whole library.
Actually I revert all this steps to use a library from gradle whit all we need to use Google Play License Library and Google Play Downloader Library there is the link for the repository
I tried and made it work with below Tags in individual Module's build.gradle . flatDir is the key to solution. and for Windows based Android Studio, the '\' needs to be escaped using double '\' backslashes.
repositories {
flatDir {
dirs "C:\\Users\\<username>\\AppData\\Local\\Android\\sdk\\extras\\google\\market_licensing"
}
}
I am still learning, but I think it has something to do with flatDirs container which should be child of repositories container.
it is now showing up a bit different but the Gradle Sync just works.

Is it possible to make android library contains readme.txt?

I am new in Gradle.
I've been made android library and I will upload this into maven repository.
But is it possible to add "Readme.txt" into my library?
for example,
When someone add my library into dependencies section in build.gradle and sync.
then Gradle creates(or copy) "Readme.txt" into target project(probably $projectDir or $projectDir/app) and user can read it(Like NuGet)
(Important things of this library, how to use example or something like that.)
I think it is really annoying visit project web-site and read "How to use" every using single library.
I want my library contains how to use text file.
Thank you.
I don't think this is possible, you don't know how the calling use is referencing your project. They are likely only referencing the compiled source code and never running your gradle file.
This is not a good idea, you don't know their exact folder structure, and even if you did you can not be sure that your readme.txt would have a unique name that did not conflict with their project file.s
When using a .jar file you cannot include this as resources cannot be compiled into it. But you can export your library as an *.aar file which can contain resource files. You get this by using "com.android.library" as your plugin type and can then find the aar-file in your build folder after you have built it.
This can then be included in your other project e.g. as a file reference.

How to post an Android Studio .AAR file to a local Artifactory repository

I'm using Android Studio 1.5.1 to build a self-contained library (no external dependencies). Let's call it "myLib.aar".
I've been asked to modify my Gradle build to push the .AAR file into the company's private, local Artifactory repository. I am an experienced developer but know very little about Java repositories.
There are a lot of search hits on this topic, but none of them have so far resulted in a solution for my particular situation. Even more troubling, I can't find any two posts that implement a solution the same way.
I'm further confused why one can't just use an/the Artifactory plugin. Apparently one must ALSO use a Maven plugin -- but why? Some use third-party Maven plugins, some use something which appears to be built into Android Studio.
So my question is simply what lines to add to which Gradle files in order to push my .AAR file into Artifactory?
You should use Artifactory plugin.
Re Maven plugin. The role of Maven plugin is to generate metadata about your package (the pom.xml file). Other option is using Ivy plugin to generate the metadata in an alternative format (the ivy.xml file). One way or another your package needs metadata. Select one of them (by applying maven, maven-publish, ivy, or ivy-publish plugin).
The instructions about Artifactory plugin show configuration examples for all the possible options.
JFrog GitHub repo contains project examples for all the possible options.
Hope that helps.
I am with JFrog, the company behind Bintray and [artifactory], see my profile for details and links.

How to create an android library and upload it on github?

I have created a new module in Android Studio, and wrote my code in it. Now i want to upload it on github and get a gradle dependency which others can include in their project and use my library. How can i get it?
PS. I know how to use git, i just don't know how to upload just the library module and get the gradle dependency.
The esiest way is to create a git repository in Github and upload it there.
After that, you can use jitpack.io to use it with gradle.
The long old way, it is to create a Bintray project, and deploy it at MavenCentral and/or JCentre.
What do you need to do is upload your project to Bintray or sonatype
See here a good tutorial:
how-to-upload-library-to-jcenter-maven-central-as-dependency

Hosting Gradle artifacts on GitHub

I know that people use GitHub to deploy Maven artifacts (in a new branch) but since we are using Gradle I would like to know if there is a simple way of handling those dependecies as well?
We have different little projects that are independent but used by our main project and we want to manage those dependencies without including them locally.
Thank you.
There is an unofficial gradle plugin called Gradle Git Repo plugin that claims to do what you're looking for. Note however, that I did not play with it myself to verify that it works.
You could use JitPack to include your GitHub projects as dependencies. The idea is that JitPack provides a Maven repository where each package comes from a GitHub project.
It doesn't require that you upload files so it's quite easy to use. Instead when you request a file it builds it from source code.
There are two requirements to start using:
1. You need to have a build file in your project (Gradle or Maven)
2. You shoud create a GitHub release so that your project gets a version

Categories

Resources