I am trying to utilize the Zip Expansion library from Google in my app, but I cannot seem to import the libraries correctly.
Right now, in my code, to test the library, I am using :
ZipResourceFile expansionFile = new ZipResourceFile();
This is throwing errors because I have not imported the expansion library correctly.
From scratch, could someone tell me how to use this library in my project?
Thanks so much.
In Eclipse, import the 'zip_file' project (using 'copy projects into workspace' option). Add a reference to this project under your project properties, then add the project to your Java Build Path. Add the namespace to your code file:
import src.com.android.vending.expansion.zipfile.*;
Using ZipResourceFile should not throw any errors at this point. You should also mark this dependency as an Android library under your project properties so that it will be managed properly when building.
Related
I have an android gradle project which I compile from the command line. I am using eclipse + eclim to have autocompletion and source code validation. I was an unable to get code completion to work by importing the project as an gradle project into eclipse. I therefore imported /path/to/gradle/project/app/src/main as an android project into eclipse and after some .classpath tweaking I was able to get autocompletion to work.
Now I wanted to import the following android support libraries:
import android.support.annotation.NonNull;
import android.support.v13.app.FragmentCompat;
import android.support.v4.app.ActivityCompat;
but got The import ... cannot be resolved error for all three lines. I then tried Android Tools -> Add Android Support Library which failed miserably. I then tracked down the libraries in question in the Android-SDK and added them manually to the Java Build Path in Eclipse. For some I needed to extract the JAR files from the AAR files as described in this answer. I added the following libraries:
appcompat-v7-26.0.0-alpha1.jar
support-annotations-26.0.0-alpha1.jar
support-v4-26.0.0-alpha1.jar
support-v13-26.0.0-alpha1.jar
This solved the problem for the the first two imports but I still get the error for import android.support.v4.app.ActivityCompat;. I have code completion up to v4 but app is not found.
How can I resolve this issue? Am I still missing some dependency? Is there a better way to get android code completion with eclim?
So i figured it out myself. There was still a dependency missing. In my case I also needed
support-compat-26.0.0-alpha1.jar
I wrote this script to extract all the jar class files that are somewhere hidden in the android-sdk/folder. It recursivly looks at all subdirectories of the specified Android SDK folder until it either finds a JAR file which is not Javadoc or Source and copies it to a destination directory. If an AAR file is found the content is extracted to a folder of the same name as described in the link of the question and the JAR file in that folder copied with an appropriate name to the given destination directory.
Is it possible to import only the jar files of a library project. For example: Aviary, telerik etc.
I am using the above features in my project. While i have done the samples i have to import the SDK projects into our workspace. Can we import only the jar files into our projects and use the above features in our app?
You can copy those jar from a library project to your lib
or
Right click on project-> properties -> java build path -> add jar -> project source lib project->lib->select jar ->ok->ok.
Hi #Jafeena for facebook 3.14 this is not allowed.
whats the problem, why not to add all of them as a library, if problem is related to same name then change library name with Eclipse->refractor functionality and use them as your library.
I'm having a lot of trouble figuring out how to build a jar of the Showcase View library so that I can import it into my application.
I've searched all around but can't find a process for it. I tried importing into Eclipse but I can't get it in there since it isn't a project and I'm not sure what type of project to create from source with.
Any help would be greatly appreciated.
Easiest way is:
Create an empty Android Application project in your Eclipse workspace.
Copy files in ShowcaseView/library/ folder of github to your new project base folder.
Refresh project in Eclipse.
Goto project properties - Android and select "Is Library"
Clean unnecessary stuff and build.
It should be ready to add as dependency of your app.
Alternatively you can pick another library project .project file and copy it inside this library folder, edit it to match your new project name, etc... And then import in Eclipse. But this is more hardcore if you don't know what you're doing.
I’m trying to get the facebook sample projects to code. Right now all my inports that begin with
import android.support……..
have a error that says
“the android port android.support cannot be resolved.”
I compared the face book project to a project I made. I found that my project had a folder called android dependencies and under that the file android-support-v4.jar. The facebook project did not have this.
I’m assuming this is why the face book projects are giving me the error. How would I put the file android-support-v4.jar. into my face book projects?
Try the following options:
As mentioned in comments by #yugidroid, try right clicking on the project->android tools->fix project dependencies.
add manually through project's properties, library tabs, add external jar and point to support lib you have downloaded.
right click on project->android tools->download support lib
After importing next problem, does not see the library as I understand.Tell me how to solve the problem
Again, I imported the project, now Screen is not quite empty but not full
aaa Sorry decided I did not put the settings
How did you do the import? I'm not too sure I understand your project structure. Do you have an available JAR file of the library you need? If you do, create a /libs folder in your Android app. Build the project and the import should be available.
If you are importing a library project, right click on your main project, choose Properties then Android then under Libraries, add the library project you need.