I want to build a java library with some useful things I done to Android. Just like my other project: https://github.com/MarkyVasconcelos/Towel
My question is, what is the best way to share a library on Android?
Source codes from a entirely Android project(res, src, Manifest, etc..)?
Only source codes(.java)?
A generated jar with the 'src' folder?
Thanks.
I'd distribute an Android library project. I have several such projects in my various GitHub repositories -- those links are just three of 'em.
Although never done myself I think you have to provide an Android Library Project if your library contains android specific content.
Related
I have an android library project, which I want to include to my titanium android module. In the documentation I found no way to reference the library project. For adding a third party library the documentation has a guide to include a .jar file. So I tried to add the .jar file.
The library project also depends on native libraries (.so files) and resources. I experimented a little bit and I got it somehow working, that the ressources and native libraries are included in my .apk. The problem is: at runtime I get a ClassDefNotFoundError.
I tried pretty much everything and I don't know how to get this running.
BTW I'm a newbie, so maybe it is not even possible what I'm trying to do.
Can anyone please help?
This
fixed it. Just modify the script.
I was wondering what the easiest way is to display a simple graph of any sort based on values that I already have. I tried using a library but ended up with more errors than i can count. What is the trick to using libraries and can someone take a second and help walk me through the steps because online all i can find is tutorials that just go: Download this jar. put it in libs and tah dah. But I am not seeming to find such luck.
Is there a way to download it as if it was a compelete project and then just import it? Or do you have to go through and pick out each little thing?
Quoting the project documentation:
Recommended: If you use Gradle/Android Studio you can use the library from Maven Central.
Add that line to your build.grade file into the dependencies block:
compile 'com.jjoe64:graphview:3.1.3'
Download .jar file and copy it into the libs folder of your project.
GraphView-3.1.3.jar
Download or clone the git repository and link your project with the GraphView library project.
jjoe64/GraphView on GitHub
Since you have the question tagged with eclipse, option #2 would seem to be the most likely choice.
Note that the author also provides:
a series of demo projects
JavaDocs for the library
both of which may help you learn how to use it, as an adjunct to the rest of the documentation.
I want to create an Android jar library which has activities which use layouts that are all within the jar file.
I have been researching and trying different methods for the last few days and exhausted the related posts here. I have managed to get drawables and other raw assets to reside and be loaded from within the jar. However I have not been able to include valid resources which include the layouts. The official view is that it is not supported yet however I am sure it can be done.
I see that this is possible with .aar libraries when using Gradle but I am unsure if .aar libraries are compatible with older Android projects.
Could anyone shed some upto date info on this issue of resources/layouts in jar libraries and also the compatibility of .aar libraries.
Many thanks
I want to create an Android jar library which has activities which use layouts that are all within the jar file.
That is not possible, sorry. However, you are welcome to create an Android library project that serves this role, and that library project can ship a JAR instead of Java source code (see the Play Services SDK's library project for an example). The layouts would not be inside of the JAR file, though.
The official view is that it is not supported yet however I am sure it can be done.
I am sure that you are incorrect in your assessment.
I see that this is possible with .aar libraries when using Gradle but I am unsure if .aar libraries are compatible with older Android projects.
Project age has nothing really to do with it. If you are using Gradle, AAR files work. If you are not using Gradle, AAR files do not work.
I have split out common components into libraries using Eclipse. Everything works great. I have resources/etc in the library. However, I need to make the same functionality work with using make instead of Eclipse. I need the libraries to recompile every time the APK is made.
Completely a noob question, but everything I am finding deals with making it work in Eclipse or creating a Jar file and inserting it into the project.
Thanks - Keith
create jar file:
You could use the Export->Java->Runnable Jar to create a jar that includes its dependencies
check this tutorial, And this similar type question
I am successfully linking some of my code stored in a .jar-based library to my Android app. The .jar code references Android library content just fine.
The problem is I need to include 'res' resources in the library but can't work out how to do this.
Any suggestions?
This discussion http://www.anddev.org/viewtopic.php?p=30725 indicates this isn't currently possible.