How to import android project with native language in eclipse properly - android

It is to be mentioned that I can configure NDK with project containing native code
I have downloaded a project from github. But the project is not importing as a project saying "no launcher file found". SO I created a "new project from existing android code". But it has been imported as two projects and showing errors. This is the project hierarchy:
And this is the project Link.
https://github.com/gnufabio/ics_keyboard_plus

If you want to "Create project from existing source", you need to create a new directory and then put the project directory tree into that new directory. Then point to the new directory when importing.
For me this worked the best solution !
File->Import->General->Existing Projects into Workspace, Next
Select root directory: /path/to/project
Projects->Select All
UNCHECK both "Copy projects into workspace" and "Add project to
working sets" Finish
More info also in this LINK

Related

Installing Vuforia in Android Studio

Can anyone give me some instructions of how I'm supposed to install Vuforia in Android Studio? I'm making a new app and I need to use augmented reality with Vuforia. Hope you can help me!
Thanks a lot!
You need to follow following Steps:
Read our Getting Started Guide for instructions on setting up the
Java SDK, Android SDK and NDK:
https://developer.vuforia.com/downloads/sdk
Make sure you have installed the latest version available of Android
Studio from:
http://developer.android.com/sdk/index.html
Use the Android SDK Manager (from within Android Studio) to get the
latest Android SDK and Android Platform and Build tools
Launch Android Studio
Select File - > Import Project ... and browse to the root directory
of the sample Vuforia project you want to open
Proceed in the Import Wizard dialog (click Next, Next) until you
reach a page with this message:
"Alternatively, you can fill in the actual path map in the table below":
click to edit
enter the actual path to the Vuforia.jar library (which is located under your vuforia_install_dir/build/java/vuforia)
In the Project view, right-click on the Project and expand the view
hierarchy so to locate the Vuforia.jar under app > src > main
right-click on Vuforia.jar to open the context menu
click on the "Add as library..." option in the context menu
Alternatively, if you cannot locate the Vuforia.jar in your project
hierarchy:
right-click on the Project and select, "Open Module Settings"
select "App"
then select the "Dependencies" tab
Click on the "+" button to Add a File Dependency and browse to the
Vuforia.jar file
Create a folder called "jniLibs" under the "app/src/main" folder under your Android Studio project directory
Copy the "armeabi-v7a" folder (including the libVuforia.so file
located inside it) from the "vuforia_install_dir/build/lib" to the
"app/src/main/jniLibs" folder
the resulting directory structure under your project root should be:
/app
/src
/main
/jniLibs
/armeabi-v7a
/**libVuforia.so**
If your project includes a "jni" folder, move it to a location
outside of your project (otherwise Android Studio may attempt to
compile the sources in that folder and may fail)
Clean and rebuild the project
Run the app on your device
Best Luck :)
answer from here and work for me:
(Seems like the project needs access to the Vuforia.jar file and can't access it outside of the sample folder(?))
So,
copy the Vuforia.jar file from the folder \vuforia-sdk-android-x-x-x\build\java\vuforia to a folder in the sample project, e.g. to \samples\app\libs
(it's important it's in the "\app" path, so you can find it in the next step)
in Android SDK hit F4 (or right click on the app folder in the project structure and click on "Open Module Settings".
Select the tab "dependencies", click on the "+" to add a dependency and select "2 File dependency".
Now select the above path and file ((\samples\app) \libs\Vuforia.jar) and the project will run just fine...
Good luck.

Can't import an Android project that was cloned from GIT into an eclipse workspace

I want to be able to clone a project into my workspace, and than import it into Eclipse.
When I choose "Import"->"Import existing Android code into workspace", I get:
Invalid project description. [ProjectName] overlaps the location of another project: [ProjectName]
When I choose "Import"->"Existing projects into workspace" I get nothing to import (because I keep only the "res" folder, "src" folder and AndroidManifest.xml files in the git repo.
Any solution that involves copying the repo outside the workspace and importing it will not work since I want it to be cloned into my workspace.
How can I achieve what I'm trying to do?
First make sure you do not have a directory named [ProjectName] in your workspace. If so delete it. After several tries I would not be surprised that the assistant created it and therefore is not letting you import it because it thinks it exists.
Then, git clone the project outside of your workspace.
Finally, go to new->Android project from existing source, select the cloned directory and make sure you tick the box : Copy the files into workspace
That should work.
UPDATE AFTER COMMENT :
Ok, I didn't understand the part about the direct to workspace import.
I just tried and had no problem :
clone the github project inside the workspace
In Eclipse : Right click in the Package Explorer
Click "Import...",
Under the directory Android choose : "Existing Android code into workspace"
Browse to your project directory
Make sure not to tick the "Copy projects into workspace"
Click finish

Importing android existing project

I am trying to import android existing project but it gives the warning 'No Project are found to import'. Please help me out of this.
Create new project and choose: "Android Project From Existing Source"
Then select the folder of that project
do you changed your workspace? if so, copy the folder of the project to your new workspace folder, then import..

Root directory/Archive file not found while importing

I am trying to import a archive file containing Android application project in Eclipse. But I receive a message No projects are found to import. Same goes when I am importing a root directory. Why I am getting this message?
The project in question may not have been set up to work with Eclipse. For example, it might not have .classpath and .project files.
If so, you can still "import" it into an Android project -- start a new Android project and choose "Create project from existing source".

How to import existing Android project into Eclipse?

I'm trying to import and existing Android project into my current Eclipse workspace. I select File->New->Android Project, which brings up the Android project dialog, I then select, "Create project from existing source", Location, Build Target and Finish.
I get the following error: Invalid project description.
Does anybody know how to get past this error?
File → Import → General → Existing Projects into Workspace → Next
Select root directory: /path/to/project
Projects → Select All
Uncheck Copy projects into workspace and Add project to working sets
Finish
Solved: If you want to "Create project from existing source", you need to create a new directory and then put the project directory tree into that new directory. Then point to the new directory when importing.
This error message appears when the source code you try to import is inside an existing workspace.
Put your source code in a directory OUTSIDE any existing workspace and then import
Just delete the ".project" file in your project folder (it's hidden on Linux, use "ls -a" to show), then from Eclipse, choose Create Android Project from existing source
Im not sure this will solve your problem since I dont know where it originats from, but when I import a project i go File -> Import -> Existing projects into workspace. Maybe it will circumvent your problem.
It seems you cannot have your project root, with the AndroidManifest.xml deeper than one directory level below your workspace root. I struggled for an hour with this before I just gave up and rearranged my repo.
You can also use Make new > General > Project, then import the project to that project directory
I found James Wald's answer the closest to my solution, except instead of "File->Import->General->Existing Projects into Workspace" (which did not work for me at all) I used "File->Import->Android->Existing Android Code Into Workspace". I am using Helios, maybe your version of Eclipse does not have this quirk.
I had the problem of getting errors when checking out an Android project from SVN. This is what I did and the whole thing settled down.
1. checkout the project from SVN as we normally do any other project
2. right click and get properties of the project
3. In the java build path->order and export tab select the android API and OK it
this removed all the project issues
so far so good but not sure if this is the 100% correct method
This post helped me: http://code.google.com/p/android/issues/detail?id=8431
In my Android Project folder .project file was missing. Restoring the .project file,which will be hidden in Unix OS environment resolved the error.
Updating #JamesWald's answer, and incorporating other comments. Assuming you want to create a cfesh copy from, say, a backup in your new workspace:
Put the existing project in a directory not inside the destination workspace.
In Eclipse: File->Import->Android->Existing Android Code into Workspace, Next
Select root directory: /path/to/project/from/step/1
Projects->Select All (or not, as the case may be)
Make sure you set the new project name correctly - To change one click on the old project name (left column) and then click on the new project name (right column) and then edit. It will default to the class name of the Default Activity.
Assuming you want a copy in the destination workspace, check "Copy projects into workspace"
uncheck "Add project to working sets"
Finish
Same problem happened to me as well and the .project file was not there in the project.
I copied a .project file from an existing android project and replace the project name with the name of the project I am trying to import.
Then using File -> Import -> Existing projects into workspace I was able to import the project.
What works for me is that: File > Import > Existing Project into Workspace (under General tab), then choose the project root folder. The importing of Existing Android Code into Workspace somehow does not work on Eclipse for me.

Categories

Resources