Using Android Studio with Vuforia [closed] - android

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
Here is how I run a Vuforia Sample on Android Studio on Window 8
Download, extract sample, remove files .project and project.properties
On Android Studio : Import project, next, next ...
Download & install android NDK http://developer.android.com/tools/sdk/ndk/index.html
Download & install cygwin http://cygwin.com/
Edit the file jni/Android.mk
LOCAL_SRC_FILES = C:/Vuforia-sdk/build/lib/$(TARGET_ARCH_ABI)/libQCAR.so
LOCAL_EXPORT_C_INCLUDES := C:/Vuforia-sdk/build/include
where Vuforia-sdk is your vuforia sdk
Open cmd in your project folder and do "ndk-build"
In android studio, click on project structure, modules, "YourModuleName", Dependencies, add jars, select the correct path to vuforia sdk for me it was :
C:\Vuforia-sdk\build\java\QCAR\QCAR.jar
build & run your project in Android Studio
Have fun!
*Don't forget the PATH variable for the ndk & cygwin

Read our Getting Started Guide for instructions on setting up the Java SDK, Android SDK and NDK:
https://developer.vuforia.com/resources/dev-guide/getting-started-android-native-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
Clean and rebuild the project
Run the app on your device

Try this,
Exporting Eclipse Project with vuforia into Android Studio, which worked for me.
Below are the steps which i followed to the project work fine in Android Studio.
Export the Eclipse project from Eclipse as a Gradle project.
Go to the welcome to android studio window in android studio.
Click on Import Non android studio project.
Locate the project that you exported from eclipse, expand it and select the build.gradle file and click ok.
Copy the vuforia.jar file from the vuforia sdk.
Right click on the project in android studio and click on Show in Explorer option.
Locate the libs folder and paste the copied vuforia.jar file.
Make a folder lib ( NOTE: it is not libs) in the same structure as APK file.
Make another folder armeabi inside lib folder.
Copy .so files and paste it inside armeabi folder. and zip the lib folder into lib.zip
Rename the lib.zip to armeabi.jar
Include the armeabi.jar inside libs folder.
Then clean build and run the project.

Related

Cant import OpenCV module in android studio

I've been trying to import Open CV module to android studio exactly as many tutorials online told me to but it wont work. I googled the issue a bit and found a solution to choose the sdk folder as the directory and not java but even that dosent work.Im using Android Studio v4.0.1 and the latest version of OpenCV. Help.
First of all make sure your sdk folder in your downloaded opencv sdk contains a build.gradle file. If your downloaded sdk doesn't have build.gradle try another version of opencv sdk, Unless you have to select java folder in the opencv sdk and after that copy jni files into your project tree.
The easiest way to import OpenCV sdk into your project is as follow:
Create an Android Project
File -> New -> Import Module -> path to OpenCV/sdk/ -not java folder! (opencv 4+)
File -> Project Structure -> add OpenCV as 'Module Dependency' of 'app'
Clean Project
Done! no need to copy jni libs and other things.
Importing opencv to androidstudio
->First download opencv from https://opencv.org/releases/
for your current using android studio version,and extract it.
->open android studio create new project if project is already
exist follow the below.
->in android studio choose option in MENU->File->Import
Module here please select the your opencv-android directory
till sdk selection
eg:("E:\stardev\OpenCV-android-sdk\sdk") and
then finish, if your downloaded same version it's good to go
else change the build.gradle setting from opencv build.gradle
and sync.
->after this to add as a dependency in android studio
Choose
Menu->File->Project Structure->dependencies,
select app from tab and add(+ icon) from menu select module
dependency and select sdk from here.
->to test goto your project activity and
(import org.opencv.core.Core)
If you are using Arctic fox and still facing this issue, This Solution worked for me.
If your next and/or finish buttons is still not clickable after adding the right path
https://stackoverflow.com/a/68738767/12052997

Project files are not showing in android studio

I Just cloned android project from the bitbucket which doesnot contains gradle folder in it.
I imported it as an eclipse project in my android studio but problem is I cannot see any files when I select android from the top left corner drop down menu but some files are seen under project menu.
doesn't show any files.
shows some of files only.
check the settings.gradle and add this line and save include ':app'**

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.

How to import dropbox Chooser SDK in Android Studio?

https://www.dropbox.com/developers/dropins/chooser/android
I am trying to use the android chooser in Android Studio but I not sure how to import it to my project and user it. I am using Android Studio, not Eclipse Android Studio if that has any relevance. I just have no idea how to being the unzipped file into use in my project.
It's more complex than it ought to be, but this procedure worked for more than just the Dropbox SDK.
Unzip the Dropbox Chooser SDK somewhere
Open your project in Android Studio
Create a new sub-directory "libraries" (right-click -> new -> directory)
Create a new module in the libraries directory (right-click -> new -> module)
In the "New Module" window, from "More Modules" select "Android Library"
Click Next
Edit "Library name" to "dropbox-chooser"
Edit module name to "dropbox-chooser"
Edit package name to "com.dropbox.chooser.android"
Click next until done
Navigate to "libraries/dropbox-chooser/src/main"
Delete everything within the "java" and "res" directories, but do not remove the directories
Navigate to the directory where you have unzipped the SDK
Copy everything in the "src" directory to the "java" directory of the new module
Replace the "res" directory in the new module, with the one from the SDK
Do the same with AndroidManifest.xml
Now, to reference the library in your main project:
Open/Create "settings.gradle" in your main project dir
Add include 'libraries:dropbox-chooser' to the file
In build.gradle, withing the dependencies section add compile project(':libraries:dropbox-chooser')
This should do the trick.
Sync, build, and all should be good.
The Dropbox developers page now includes documentation on how to use the Chooser SDK with Android Studio.
Basically, you create a module from the SDK, and then you add it as a dependency to your project.
Detailed steps are described here: https://www.dropbox.com/developers/dropins/chooser/android

How do I add the appcompat library to an android project in netbeans?

I have the support libraries installed via the SDK manager.
I have copied the C:\Program Files\Android\android-sdk\extras\android\support\v7\appcompat folder to my projects libs folder.
I have added the \tools folder of the sdk to my command line path. I have then run
android update project --path . --library C:\Users\srayner\dev\android\AndroidTest1\libs\appcompat
But now netbeans gives me this error;
Failed to resolve library path: C:\Users\srayner\dev\android\AndroidTest1\libs\appcompat
What is the correct method to setup an android support library with resouses in netbeans?
I have successfully build and added the appcompat project in NetBeans.
Create a new android project in netbeans - I called mine "appcompat".
Build your new project just make sure it can be successfully build.
Delete everything inside the src directory and rebuild. My project just contained the default MainActivity that was created by NetBeans. You don't need it.
Navigate to your android sdk install directory
"androidSdkPath\extras\android\support\v7\appcompat and copy all
the contents within that folder
Paste the copied contents to the android project that you
created in step 1 (again mine was named as appcompat).
Very important - Open project.properties and ensure that the "target" property matches the following: "target=android-21"
Build your project and Voila... you should be all set.
If you are still having issues compiling the project that will be using the appcompat library, change your project library properties target=android-21"

Categories

Resources