How do I import twitter4j into eclipse? - android

I have downloaded twitter4j-4.0.1.zip from the twitter4j page and from github in eclipse I unzip then file>import>Existing Android Code Into Workspace>next>browse file location, and eclipse does not find any projects. This says to copy the jar file into the lib folder, but am I supposed to import as a library first? Not sure what I am doing wrong.

This was correct. Right click your project>Properties>Java Build Path>Add External JARS>twitter4j-core

Related

How to import android library from GitHub to eclipse

How to add gradle library in android project.
We download the project from github.
https://github.com/michael-rapp/ChromeLikeTabSwitcher
We follow these step but it showing the error.
Import the library folder from above zip as Android project.
It create folder of main with blank src, so we copy the data from folder java
to src.
After refresh in eclips it's showing error in src folder of functions.
We also import example folder and follow the same step as above, but no luck.
Let me know if i do something wrong or can you test this library on your eclips.
Thanks..
Download archive android.jar from https://jar-download.com/download-handling.php in Downloads folder. Then connect it to android project in Eclipse by means of project Properties/Java build path. That is all.
This will be the universal solution for all your eclipse android projects while android.jar is in Downloads folder.

eclipse + eclim + android support library

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.

Import "MPChartLib" Library to Eclipse

I tried to add "MPAndroidChart" library in Eclipse but when I try to import this lib:(https://github.com/PhilJay/MPAndroidChart/archive/master.zip) .
Amongst the downloaded files , I found a folder called "MPChartLib". This is the actual library folder, I need to add this folder to my project to be able to use the full functionality of the library.
I tried to import the library folder into my workspace, using File-->Import-->Android-->Existing Android but I have this message " Select at least one project eclipse import" !!!!
The lib uses gradle, because of that you can't "import a eclipse project"
You have 2 options, install a gradle plugin for eclipse, or use the lib as a jar
From the lib README:
Download the latest .jar file from the releases section
Copy the mpandroidchartlibrary-.jar file into the libs folder of your Android application project
Start using the library
I hope the same named file is already there or else you can do one thing check the file name to the New Project Name column and check the same file name in your workspace. I must say you that the same named file is definitely there.
So once you will find this, just rename your file name into your workspace and try again importing this.
I hope this will work for you. Any help will be needed, do let me know.
"Select at least one project eclipse import" this message inform you that you have already added Lib in Work Space check for already added "MPChartLib" Lib followed this step:-
Write click on your project and select Properties.
On left select Android.
In Android->Library section click Add
Select for "MPChartLib" (note: name can be change).
Or If you unable to find lib please make new workspace if possible then import MPAndroidChart on workspace.

ZXing-2.1 - Missing libraries

EDIT ::: For people who may be searching for a solution, Here it is.. (using ZXing 2.1)
Follow the steps below :::
First you have to import the existing code into your workspace
File -> import -> android -> existing android code into workspace
Browse to the unzipped folder of ZXing 2.1
You will have two projects in the list. Select both and click OK.
They will be imported into your workspace and you will have errors.
For the first Project (CaptureActivity in my case), you have to add the core.jar file present in ZXing2.1\zxing2.1\core
For the second project (ZXingTestActivity in my case), you have to add the core.jar file present in ZXing2.1\zxing2.1\core and android-integration.jar present in ZXing2.1\zxing2.1\android-integration
That's it.. You are done...
Hope this helps...
I have an application where we use ZXing. I have to update the library to the latest one. So I downloaded the code from ZXing-2.1.zip from here. When I try to compile I get errors in the import statements.
import com.google.zxing.BarcodeFormat;
import com.google.zxing.DecodeHintType;
import com.google.zxing.Result;
I couldn't find these libraries anywhere in the zip that I have downloaded. Can someone please guide me on how this is done? What am I doing wrong?
If you have a step by step tutorial, please do link them.
The classes are found in core.jar. You build this from the source code you downloaded.
I suggest you use the latest code from Subversion actually. If you do that, here's how you can get a pre-compiled JAR, or build one yourself: https://code.google.com/p/zxing/wiki/GettingStarted
(We are releasing 2.2 in a week or two by the way.)
Or if you want to build 2.1, see this previous documentation: https://code.google.com/p/zxing/source/browse/wiki/GettingStarted.wiki?spec=svn2659&r=2659
Extract zip
Right click on project-> properties-> Java Build Path-> Libraries-> Add External Jars-> select the jar file where it is in your Pc-> click ok.

Twitter APIs and adding Jars to Build path

I am trying to manually add a jar file to my project for the 1st time.
I have downloaded Twitter4j in order to use these APIs in my app.
I extracted twitter4j-core-2.2.6-sources.jar and twitter4j-core-2.2.6-javadoc.jar and copied them to my /libs folder. Refreshed the folder in eclipse and added the 2 files to my build path.
In the 'referenced libraries' and 'android dependencies' folder I can see my 2 new jars.
But I now have the following issues:
a)the sources cannot be viewed(I'll understand if they cannot be viewed, I am a C++ programmer, do I have to rely on the documentation to find out about the API names in Java?)
b)In eclipse, the javasources cannot be seen either: When i click on an item i get: Problem opening an editor. Reason Problem opening editor for (Annotations.xml)Unable to open external editor null xxx (org.eclipse.ui.browser.editorsupport)
c)I added one of the example files to my project and it does not compile:
import twitter4j.Status; ==> The import twitter4j.Status cannot be resolved
Any help much appreciated
Don't create lib folder..you should have libs folder and eclipse will automatically add everything inside it to the build path for you. You don't need to do anything else except putting your jars there.

Categories

Resources