Modifying SubModules - android

I have a project I am working on. I use a library that is on GitHub. Normally I have been using this library via Maven. However there are some bugs in the library so I would like to include this library in my repo so I can modify it. I then build the library myself.
What is the best strategy for this? I have tried using sub modules, however this explains that it is not possible to modify the library in this way.

Since you are wanting to make your own changes to the library, create a copy of the repository (fork) to make your changes in. This way, your changes can be committed, pushed to the server and if warranted, shared with the original repository.
Bring this new repository into your project the same way you have been for the original.

Related

Creating a Library without using github repository

i have a project to create android library for my client, i searched and look several tutorial, but they recommend me for using github and publish it using jitpack.
My questions is
is there any other way to create library without using github repository?
you see, i want to create library without making it public, only me and my client know the resource code, i know there is private hosting in github but it must paid for use that.
is there any option for archive this? thanks
If you don't want to use the GitHub public repository, there's another alternative you can use BitBucket, it's more like GitHub and the best part is, it offers free private repository. And for library publishing you can use jCenter, maven, bintray and more, there are so much options available there.

How to create Android custom view library in Android Studio?

I've created a custom view that extends a RelativeLayout for a project I'm working on. I think it might be useful to others, so I've been trying to set it up as a library so others can find and use it.
I've haven't been able to find a clear answer on how to go about setting this up in Android Studio.
To be clear - I have already built the view and it is working fine, I just want to package it up as a library.
Do I create a new project and simply put my code there, or do I need to make a new module too? Once I do either of those things, which parts of the manifest and gradle files do I need to change?
Lastly, do I need to somehow get an AAR from the files or is it best to just upload it to GitHub and let others clone it?
In Android Studio (v 1.0.2):
File -> New module... -> Android Library
In this new module put all the code you want to share. Android Studio should update Gradle's settings accordingly.
You can publish your library as source code and/or artifacts in some Maven/Gradle repository. Publishing source code allow others to contribute to your work, fixing bugs or extending functionality. However, if you just do that, it won't be very convenient to reuse it for other developers, because working with source requires checkout and build. If you publish also artifacts (in some Maven/Gradle repository) built from that code, you will simplify the life of people using your code :)

Android project as library to another project on github

Now I have two projects one is like model and another is like view. Now I use it in eclipse and model is used as library for view. But now I need to move this projects on Github. But I don't want every time to checkout both projects. Is there any way how to do it easily?
Easy but wrong
Most Android library projects which contain a Library and a Sample project have done the following:
Put them both in a empty folder (eg. your workspace)
Call git init in that folder, normally this is called within the project itself.
The right way
As indicated by the titles, the method above is not the normal way,
You should take a look at Submodules,
which is the standard procedure for having multiple projects with git

Multiple Android Projects with Common Library Projects?

I have multiple Android applications, and I've created a common Android library project, and a common Java library project (The Android library project compiles the java one). These libraries are filled with common components that I use for all my Android apps.
I'm using gradle as my build system.
I'm using git for versioning.
What would be the best way to link everything together? Keep in mind things are still being added / changed in the library, and I need a way to propagate changes to all the Android apps. Copy / Paste wouldn't be a great option. I've tried a few things, and they aren't working out very well, so I'd love some input.
EDIT: It's probably also worth mentioning that multiple people are working on these projects. It's not just me.
The current version of Android Studio has a limitation that all of its modules must be under the project's root directory in the filesystem, and this limitation hampers a lot of people in your situation, because frequently they want those common libraries to live someplace else. It seems like this is the case for you as well.
We're in the process of lifting this limitation in Android Studio, and soon you'll be able to have modules outside the project root. I think this might be the best solution for you -- you can pull your common libraries from wherever makes sense in source control, put them wherever makes sense in your filesystem, and link them up into whatever projects need them. However, this isn't available yet, but will show up in v0.5.0, which will hopefully go out this week. I haven't personally tested it in our dev builds and can't vouch for how well it works, but at any rate it should be coming along soon.
Some developers have worked around the limitations by adding script to their settings.gradle files to set different module root directories. They say it works, but I find it a little scary because the IDE just isn't expecting things to work that way, and I don't know for sure if there are problems with it.
If you read other answers to this question on Stack Overflow, they're written before this feature was implemented and will have different advice. If you don't want to wait for 0.5.0 or there are problems in it that prevent you from using it, you can follow that general advice, which is to have your common code compile to libraries that you publish to a Maven repository (which can be local to your machine or common to the developers in your group), and pick up those libraries with Maven-style dependency statements in the projects that need them. This has the disadvantage that you'll need to open up separate projects to edit the code in those libraries, along with a more complex build process, but it will work.

Version controlling Android/Eclipse project with all it's 3rd party libraries

So here is the deal. Let's say I'm developing an app depending on the Facebook SDK and Chris Banes PullToRefreshListView. I import the SDK's to my workspace(which I don't really like since it fills upp the workspace!) and reference it in my app as libraries. I'm making some changes to the PullToRefreshListView, let's say I'm adding a custom font or changing the color of one of the labels.
Now, I'm using Git to version control my project. I would like to be able to put up my project to our Git server and make my colleagues able to pull the project and get to work without having to struggle with getting the same SDK's (of the same versions as I used) setup and referenced in the project. Since I've made some changes to one of the libraries, the project could never be fully restored by another person if I don't provide the code.
How should I act in this situation?
Is it possible to put an uncompiled library in the libs folder or something like that?
If not, what is the right way of accomplishing this?
All I can find when Googling or searching Stack Overflow is how-to's on using compiled .jar files in the libs folder, which is good but not what I'm looking for.
Essentially, I'm looking for a good way of structuring projects using 3rd party libraries.
It sounds like these are android library projects (they contain assets). If that's the case, you can't turn them into JAR files.
The easiest way that comes to mind is to have your root project folder contain your app and all said libraries:
Root
-\Your app
-\src
-\res
-\3rd party lib 1
-\3rd party lib 2
-\3rd party lib 3
This structure would make it pretty simple to push to git and manage in eclipse.

Categories

Resources