How do I build these libraries from GitHub - android

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.

Related

How to import existing projects from another folder to workspace in Android studio

I want to import an existing android project into my workspace using Android Studio. I tried by the common method like File->Import project->Selected folder but the problem i am facing that the project is getting imported in to the same existing project whereas in eclipse i will be having an checkbox stating that Copy projects in to workspace(so that i can copy my projects easily by ticking the checkbox into my workspace). Since i am new to Android studio i couldn't able to trigger the hidden features to import and copy the projects in to workspace. Kindly help me by your valuable replies.
Note: currently i am copying the file from another location in to my workspace and then importing a project in to Android studio. But it is becoming tedious while handling multiple projects at a time
This is how usually to import projects to Android Studio desired workspace.
Android Studio 1.0.2
File ---> Import Project ---> (your current project folder) ---> Import Destination Directory (your workspace location) ---> Finish
I am just having the same problem.
As it happens, if you have a complete AndroidStudio / gradle project and you want to import it in Android Studio, just copy (or move, which is faster) the entire folder in your workspace, and then Use File -> Open, instead of File -> Import Project.
It seems to be exactly the same for the IDE, I can "import" and build a project flawlessly, but of course the "import" is faster (I don't really know why it is working that way).
EDIT:
after looking closely at the "opened project" structure, I think Android Studio is doing something weird. I copied the project from directory A to directory B, and I'm opening the project on directory B, but some of the files are still pointing to directory A.
I retried copying the project in directory B and then importing the project from B, instead of opening; now the references seem correct.
I solved my problem editing the file settings.gradle in the root:
include ':app', ':myAnotherModule'
project(':myAnotherModule').projectDir = new File('../my-another-project/myAnotherModule')
After run gradle sync, you can import this module inside build.gradle file:
dependencies {
//...
implementation project(':myAnotherModule')
//...
}
If you are trying to import a whole project to your workspace by creating a new application from existing code then that is very easy as long as project you are importing is on already on the folder of your workspace or there is no conflicting project on your workspace with the same name.
On the other hand if you have a project on your workspace that you are working on and you want to import other projects to it then it becomes challenging especially if you dont have a well define working sets. I suggest that you:
Open particular folders of the project you want to import for instance the "src" folder and copy the java files in it directly to your project on your eclipse (If you are using it)
Right click on the src file on your eclipse and paste the java files. It will save you the time of changing the package name on the java files.
Do the same for the resources files by copy pasting them from the respective files to the corresponding files in your project.
Then when you do this dont forget to edit the manifest file with the new changes of the activities you imported. To do this you need to look into the manifest of the project you were importing so that you do not miss a point.
It may appear tidious and cumbersome but it will help you know what exactly you imported. But you will need to change package names in the java files to the current package name.

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.

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.

After importing does not see the library

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.

Why can't I add mopub-android-sdk as library?

I want to use MoPub for putting ads in my Android app.
I have downloaded the required resources and set-up a library project (mopub-android-sdk) in Eclipse. Now I want to add this project as a library to my Android app. But when I try to do that it gives this error:
Are the mopub-android-sdk files in the same parent folder as your project? This seems like the same problem addressed in this question/answer:
In eclipse, unable to reference an android library project in another android project
Place the referencing project in the same physical folder and see if the error persists.
To get around this, don't set up the mopub-sdk as a library project.
You can simply import it as a standard project.
Go to File > Import >Existing Projects Into Workspace, find the right project and click finish.
Right click your actual project and then click Build Path. Go to Link Source and then select the location of the project you just imported.
That should resolve the issue for you without requiring you to build a JAR.
-Franklin

Categories

Resources