Oculus mobile project outside of SDK directory — Oculus
Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

Oculus mobile project outside of SDK directory

tomeetomee Posts: 5
NerveGear
Hi,

I have tried many things, but have not managed to get a pure Oculus Mobile project running outside of the SDK directory. There is a tool that creates a new project out of the VrTemplate directory, but it is simply put into the examples directory. That works fine, but if I try to move that out of there into a new directory it no longer works. Am I missing something, or am I maybe making some incorrect assumptions? I would have thought that one could take a project similar to one of the examples and have that as the project, point it to the Oculus Mobile SDK directory and compile it.

Any help on that would be appreciated.

Comments

  • tomeetomee Posts: 5
    NerveGear
    I have at least found something about this, which is that there are projects out there that also haven't solved this problem. For example:

    https://github.com/DrBeef/QuakeQuest

    To compile this project, it must be located in the VrSamples directory in the Oculus Mobile SDK directory. It would be nice if there was a better way than this though.
  • cnn_idcnn_id Posts: 8
    NerveGear
    edited June 25
    Sorry, dummy post, lag net connection.
  • cnn_idcnn_id Posts: 8
    NerveGear
    edited June 24
    Hi, tomee.
    Yes you can compile project outside oculus sdk mobile directory. Follow the steps in my github gist 
    https://gist.github.com/cnnid/6819aba7de6044871c597cadb363894e
  • tomeetomee Posts: 5
    NerveGear
    Thank you so much, that is exactly what I was looking for! Works great!
  • tomeetomee Posts: 5
    NerveGear
    One more thing to note, if the project name has underscores in it, it will cause a build error due to the name of the nativeSetAppInterface function implementation. So better to avoid underscores in project names.
  • cnn_idcnn_id Posts: 8
    NerveGear
    I'm glad to help.

    About. If the project name has underscores...:
    I use oculus mobile sdk v1.23.0, ndk-r17c, ndk-r20, gradle v5.4.1, 4.10.1
    VrSamples/VrTemplate/make_new_project.bat My_Project (build successful)
    VrSamples/VrTemplate/make_new_project.bat _My_Project (error is not a valid Android package name)
    If I'm correct understood your note .)
  • tomeetomee Posts: 5
    NerveGear
    I tried naming the project "vr_project_test", which creates a project fine and even compiles fine, but it crashes on startup on the device since it can't find the native implementation of the function "nativeSetAppInterface". My guess is that this has something to do with how JNI escapes underscores in function names, since it uses underscores itself. I got it to compile by renaming the function from

    Java_com_yourcompany_vr_project_test_MainActivity_nativeSetAppInterface

    to

    Java_com_yourcompany_vr_1project_1test_MainActivity_nativeSetAppInterface

Sign In or Register to comment.