Import "MPChartLib" Library to Eclipse - android

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.

Related

How to import com.android.support:design:23.0.1 in eclipse

I am learning the android tab with swipe functionality using material theme. I have a sample tutorials from here and it is build from Android studio.
I am currently using eclipse for my project.
I am following the tutorial and i can't import the TabLayout from com.android.support:design
Below is the code,
import android.support.design.widget.TabLayout;
Showing the error, The import android.support.design cannot be resolved
I downloaded support:design:23.0.1 from here and imported to eclipse, even then the error appears.
Can any one tell me where to download and import the com.android.support:design:23.0.1 in eclipse.
Thanks
Install Android SDK 23.0.1
Import design library from sdk\extras\android\support\design into eclipse workspace
To mark the design project as Library, open properties -> Select Android ->Check Library
Now import this design Library to your Project from project properties.
This worked for me in Tab material design.
If the design folder is not found in the said location, try to locate it in sdk\extras\android\m2repository\com\android\support\design instead, especially for the later version.
I have also face same problem then find solution like this.
It work for me hope same for You.
First Step:- find .aar file for design-23.0.1.aar
E:\new sdk\sdk\android-sdk-windows\extras\android\m2repository\com\android\support\design\23.0.1
Second Step:- copy that file and rename it like design-23.0.1.jar to be extract this.
After unzip it you find classes.jar, res, AndroidManifest etc.
Third Step:- Create Library project in eclipse Named design and copy
classes.jar in libs folder
all res in res/
replace AndroidManifest.xml
and last add lib appcompat-v7 by right click on lib project -> properties-> Android -> add -> appcompat-v7
Most important do not forgot clean project and can be restart eclipse for refreshing eclipse.
And more deep details follow steps Guided by commonsware's blog
Create an empty directory that will be the home for the Android
library project. For the rest of these steps, I will refer to this as
“the output directory”.
Copy the AndroidManifest.xml, res/, and assets/ directories from the
AAR into the output directory.
Create a libs/ directory in the output directory. Copy into libs/ the
classes.jar from the root of the unZIPped AAR, plus anything in libs/
in the AAR (e.g., mediarouter-v7 has its own JAR of proprietary
bits).
Decide what build SDK you want to try to use. You might just choose
the highest SDK version you have installed. Or, you can use the
android:minSdkVersion and the -vNN resource set qualifiers to get
clues as to what a good build SDK might be. If desired, create a
project.properties file with a target=android-NNN line, where NNN is
your chosen build SDK. Or, you can address this in Eclipse later on.
Import the resulting project into Eclipse, and if needed adjust the
build SDK (Project > Properties > Android). Also, you will need to
attach to this library project any library projects it depends upon
(e.g., mediarouter-v7 depends upon appcompat-v7).
Good Luck!
And Special thanks to commonsware !!
A great fix to that problem is that you copy the sdk\extras\android\support\design\libs\android-support-design.jar file to "libs" folder of your project

Project library not getting added to android project

Iam trying to reference a Android project library to my application. I do this:-
1)File->Import->General->Existing project into workspace->Select project library->check copy to workspace.
2)Right click on project->Properties->Android-> Add-> Select project library-> Apply-> ok.
But when I again check if the library is added I get the following:-
How do I resolve this?
Make sure that your library has the same location with your project source files.
It means that if your source is on your workspace , then your library should add into workspace. If not, you should copy your lib into same folder with source then mount it again.
Make sure the library project is checked as a library.
Go to the library projects BuildConfig -> Android -> Check "is library"
Make sure your project and the library project have the same target/min SDK versions.
It's also a good idea to clean your workspace and Build the library project - Right click on library project -> "Build Project"
Try this answer:
The project name needs match the folder name on the file system. What you are seeing in the Project Properties->Android->Library Reference is a relative file system path.
Reference:
In eclipse, unable to reference an android library project in another android project
Thanks to archie-bpgc for comment
i am also facing this problem i have solve this problem like
when import lib in to workspace tick mark as show in picture (basically library project and your project both are in same workspace)
now add lib to your project and clean project
you need to import the project to workspace and the library file into the same workspace.
Then you will not face this error. Kindly the root cause is not known. But this method works.
After all this .. one more way is you can alter the project properties last line where the library file path is specified.
Thank you.

How do I build these libraries from GitHub

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.

Importing google-play-service library showing a red X next to this reference android

Am trying to add google-play-service library in my project using import(For Google map). After adding the path am getting red X next to this reference and the reference is not adding . Know how to resolve this ?
The red X means its a broken link path.
http://developer.android.com/google/play-services/setup.html
Copy the google-play services_lib library project to your workspace (folder where your android map project is). The library project can be found under the following path.
<android-sdk-folder>/extras/google/google_play_services/libproject/google-play-services_lib library project .
Import the library project to your eclipse
Click File > Import, select Android > Existing Android Code into Workspace, and browse the workspace import the library project. You can check if it is library project. Right click on the library project. Goto properties. Click Android on the left panel. You will see Is Library checked.
Right click on your android project. Goto properties. Choose Android on the left panel. Click on Add and browse the library project. Select the same. Click ok and apply
Eclipse does weird things when importing an existing project (google-play-services-lib), especially if you try to import and then allow the project to be automatically 'copied' to your workspace. I had the same issue and here is how I fixed it:
Close Eclipse
Erase all google-play-services projects from your workspace
Manually copy the google-play-services-lib folder (....sdk\extras\google\google_play_services\libproject\google-play-services_lib) into your workspace
Open Eclipse
Add a new project, choosing 'Existing Android Project', then navigate to your workspace and add the newly copied google-play-services-lib project
Finally, add the google-play-services-lib to your project as a library (just like you normally would)
Hope this helps! :)
Though it's over a year for this question but never the less thought of putting it down here. Might help some one facing a similar issue.
While doing a File -> Import one probably might have selected the folder,
C:\adt-bundle-windows-x86-20130729\sdk\extras\google\google_play_services\
instead of
C:\adt-bundle-windows-x86-20130729\sdk\extras\google\google_play_services\libproject\google-play-services_lib
Quite strange as Eclipse did not correctly copy the google-play-services_lib project in my workspace, but this caused a cross mark to appear in my Project Properties.
got a perfect solution for your question. this problem is due to improper referencing of library projects. You need follow these step.
create a new project
copy all the java files from src of your previous project in which you are getting error to the new project you have created just now.
Also copy layouts xml files.
now import play services you will not get this error.
I was also getting same problem.
I copied google library folder into work space and import now it's working fine.
Try to place the Google-play-service library with in your same working Directory by coping the files from Click File > Import, select Android > Existing Android Code into Work space, and browse the work space import the library project.
This is common issue Youur google-play-service-lib project and your android project should be inside the same folder For example
if your Android Appplication name is MyMap is in D:/workspace t hen your play service lib project should be in the same directory D:/workspace
Close Eclipse. Delete
.metadata
and
.recommaditions
folders from your workplace. Import your projects back.
You add Project in to your workspace.
Start Eclipse and import project one option is ther copy to workspace do it.
After that add google play services it also copy in to your work space
and add it your library hope so its working.

Error when importing Android library

https://github.com/SimonVT/android-numberpicker
I am trying to use this library.
But I can't successfully use the Sample
Import sample
copy lib files (except manifest, build)
But the Sample still has an error at NumberPicker.java
I mean All(ever) R. giving an error, something like R.id.np_decrement, R.attr.numberPickerStyle, R.integer.np_config_longAnimTime...
Try this way
1st Download that project file
2nd Open the archive and you will see one folder with name android-numberpicker-master extract it to your hard driver
3rd In eclipse goto File -> Import and under Android tab select Existing Code into workspace
and import both the projects
NOTE: Both the projects must be in same folder
4th Right click on properties and goto android tab and see if project exists or add it
If the library and project are not in same folder then it will throw error, so both have to be in same folder
and now try to run it and it will work
The resources object (R.java) isn't being generated because of an error. Your targetSdkVersion should be set to at least 15 in your manifest, and you should also have theme.xml from the library's res/values folder copied to the same location in your own project.
First check out the sample application provided by the developer.
Right Click in your package explorer. Select Import. Select "Import existing Android Code into Workspace".
Browse to samples directory and import.
Similarly import Library and make it is marked as Library and other project is referencing it correctly.
Make sure JDK compliance is set to 1.6 and your project is targeted against SDK 15 i.e 4.0.3.

Categories

Resources