I use AQuery, I have the last jar version and that works good. But i want to use the settempdir() function and i must build them self inside the file, when I try to do this, I can not change the class inside the jar file.
the sourcecode of Aquery is https://github.com/androidquery/androidquery and i have insert it into Android Studio, i have change the code from this link https://github.com/androidquery/androidquery/pull/38 but i can not make a jar file. i see no gradle tab on the right.
Can i use it without making a jar of it?
Greathings christophe
If you choose Build project you should have an aar file in the projects build folder which you can use just like a jar file.
Related
I have a jar file called PhoneGestures.jar which contains a bunch of java files I want to use in my project, which I have added to my project as a module using New->Module->Import .Jar :
I then added this jar module to my project dependencies like so:
and as you can see it is included in my project's build.gradle:
But now when I go to use one of the classes from my jar file, like "MobXRotate", for example, Android Studio does not recognise it:
Does anyone have any ideas why this might not be working? Thanks.
Make sure you have imported the class if the class isn't been found either,
try build your project first, that gradle copies the source code in your project structure!
There's no need to create a new module for a jar file.
Putting the jar file in libs folder will do the trick.
Hi I developed one small library in Java for my Android application. I want to do obfuscating for that library. I using Android version 4.1.2. First thing is that according to Google's Android documentation there is no proguard.cfg file in my project root directory. Instead of that proguard-project.txt is there. I add proguard.config=proguard-project.txt into my project-properties file.
After this configuration I tried to export this library project and try to do obfuscating of that project. It showing error can generate .apk file because it is library project.
Then I tried with another option in export. Instead of regular export android application I use general -> archive file and tried to export it and generate jar file but I check inside the jar and no encoding is done. That means anyone can extract and check classes and content inside my library. But the main thing is that it generates proguard folder inside my project and also generate dump mapping seeds usage.text files inside it.
So I need help to do proper ProGuard obfuscating of my Android library. Am I doing something wrong. What kind of configuration do I have to add inside my proguard-project.txt so that it will do proper encoding of my code?
Actually, you can obfuscate a library project, but not directly! You can only do that by exporting the entire application's project that uses that library.
With that in mind, you can set a different proguard.cfg at the root folder of your Library Project.
Hope this helps.
I create an Android project for build my custom widget, and I want to export it as a jar for other project so that reuse them conveniently, but now a problem is, I can't use resources which is included in my custom widget jar, for example a png picture, it gets a null from the resource Id of class R! How can I sovle it?
Update question:
How can I parse LayerDrawable xml from assets folder in code?
You cannot export self-contained Android Library jar at this time and announced will be available in the future SDK release.
https://developer.android.com/guide/developing/projects/index.html#LibraryProjects
You cannot export the Android Project to Jar with Resources. What you can do is Make First Project as Library and then Add that to another project.
See Documentation Here shows how to Setup a Project as Library and use in another Project
In order to get the app working with my exported library .jar file, I had to copy everything in the resources directory "res" from the library project to the application project. Also had to merge file string.xml as well as merge the ApplicationManfiest.xml files as well. To add the project as a library through eclipse is much simpler.
I am trying to use phonegap inside an android library project. The library project compiles just fine but when i try to start an activity that extends DroidGap, i get this error
01-02 10:12:17.575: W/dalvikvm(316): Unable to resolve superclass of Lcom/***/***.
I think this is because the phonegap.jar file is not included in the compiled jar file of the android library project. I have tried using ant to build but it doesn't seem to work.
Edit: I am building a android library that can be used in other android projects. I am using the standard android library project but activities in this lib project that extended DroidGap class in phonegap.jar are crashing with the above error.
I´m afraid that is not possible yet. The result jar file will contain all classes and resources defined in the android library project, but will not include external jar files added to the build path. You will have to add those to your final Android Projects using that library. You can also find similar questions in SO like this one
create one folder 'lib' in your project. put your .jar file in lib folder. select your .jar file right clicked on ,select buid path --->'add to build'. will add your .jar file. now you can use this .jar file classes.
I would suggest not making the 'lib' folder manually.
Instead:
Right click Project --> Properties --
Select Java Build Path
Make sure Libraries is the tab selected at the top
Click Add External JARs
Then find your JAR...
Basically, the same way you may have added the PhoneGap.jar
The ADT (Android Development Tool Eclipse plug-in) has built-in support for the creation and reference of library projects. See the example in section 5 of this tutorial.
Try changing the name of the folder to libs instead of lib.
have you added required permission in manifest file..
see the below links
http://docs.phonegap.com/en/1.4.0/guide_getting-started_android_index.md.html
I have made an android project in eclipse. This project has a library project:
the library project (marked with "is library") has included a jar file.
this library project does a lot of stuff with the use of the jar file.
in code everything is fine.
The problem is that the reference to the jar file doesn't exist anymore when it is compiled and installed to my phone.
When i add the jarfile also to my base project. Then the program works.
However, i don't believe that this is the right solution.
So what does i do wrong?
You should add a libs folder to your project
Then, add the jar to the folder and right click on the .jar file and go to Build Path, and select Add To Path or Build To Path. This way the library will be a part of your project. This should help.
The library jar you used in your Android Library Project must be manually added to the dependent application project's build path, not the Android library project build path itself, check out API here