Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 762
Freddy Martínez Avatar asked Apr 18 '16 16:04

Freddy Martínez


People also ask

How do I add Vuforia?

To activate Vuforia in your Unity project, access the Player Settings from Edit > Project Settings > Player and select the tab for the mobile device you are building to. Under XR Settings, tick the Vuforia Augmented Reality Support checkbox.

Is Vuforia a SDK?

Vuforia Engine is a software development kit (SDK) for creating Augmented Reality apps. With the SDK, you add advanced computer vision functionality to your application, allowing it to recognize images, objects, and spaces with intuitive options to configure your app to interact with the real world.

Is Vuforia compatible with Unity?

Vuforia Engine 10.9 Apps can be built with Unity, Android Studio, Xcode, and Visual Studio. Vuforia Engine can be easily imported into Unity by downloading and double-clicking the . unitypackage below.

Is Vuforia free for Unity?

Yes, it is free to build and publish apps that use the Vuforia Engine with a BASIC plan. However, If you want to publish an app with Model Targets and Area Targets, you will need a PREMIUM plan.


2 Answers

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:

    1. "Alternatively, you can fill in the actual path map in the table below":
    2. click to edit
    3. 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"

    1. select "App"
    2. then select the "Dependencies" tab
    3. 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 :)

like image 95
Sanket Prabhu Avatar answered Oct 20 '22 21:10

Sanket Prabhu


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,

  1. 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)

  2. 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.

like image 29
Saeid Avatar answered Oct 20 '22 22:10

Saeid