Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrating from GVR to Cardboard SDK in android #419

Open
ranaaditya opened this issue Jun 18, 2023 · 4 comments
Open

Migrating from GVR to Cardboard SDK in android #419

ranaaditya opened this issue Jun 18, 2023 · 4 comments
Labels
question Further information is requested

Comments

@ranaaditya
Copy link

ranaaditya commented Jun 18, 2023

Hi,

I have a Graphics library (based on OpenGLES) focused on android and has VR integration also via GVR (Old Google VR SDK) and this library is used by alot of developers. This Library solves the heavy coding problem issue of opengl in android devices.

I am facing issue in migrating it to new Cardboard SDK. I am little bit confused in how to migrate the existing gvr to cardboard sdk as I wasn't able to see any Migrating docs.

Is there any written docs / guide on how to migrate GVR to Cardboard sdk. I can see its using NDK heavily.

If there's any please share.

One more doubt I have - do we have kinda static jni files (just like other config files) or do we need to change the NDK/ JNI files as per our usage of the Cardbaord SDK ?

Any kind of help is very appreciable.

cc - @xinyunh0929

Thanks,
Aditya Rana

@ranaaditya
Copy link
Author

Hi @arilow can you please help us in this,

thanks in advance !

@arilow
Copy link

arilow commented Jun 29, 2023

Thanks @ranaaditya for reporting this and sorry for the long delay!

Unfortunately, there’s no migration guide from GVR to the Cardboard SDK.

All the information required to use the Cardboard SDK is in the Quickstart. There you will find the steps to run the native sample on your device using Android Studio.

Given that the API is written in C, you will require your own JNI files to make calls to the API. An example of how it is done is in the VrActivity where this is declared:

 private native long nativeOnCreate(AssetManager assetManager);

Which is defined here

Please take in to account that you will need to load the native library like it is done here:

 static {
    System.loadLibrary("cardboard_jni");
  }

Please let us know any other doubts you might have on this migration.

Thanks!

@arilow arilow added the question Further information is requested label Jun 29, 2023
@p4puniya
Copy link

p4puniya commented Sep 1, 2023

Hi @arilow ,
I'm working on the same right now. I see that the hellocardboard-android imports the "cardboard.h" that's defined in SDK folder here. I do have a few questions as I'm fairly new to NDK. There are other files except "hello_cardboard_jni.cc" in the cpp folder.

"hello_cardboard_app.h", "hello_cardboard_app.cc", "util.cc" and "util.h".

After going through the code, I got a basic idea that hello_cardboard_jni.cc is the JNI bridge that calls the cpp functions that are defined in hello_cardboard_app.h and the actual code for these functions exists in hello_cardboard_app.cc which uses the cardboard sdk imported using "cardboard.h" header file.

I'm a bit confused about how to proceed to import the sdk. Should I import the SDK folder(from here) which contains the "cardboard.h" in my project as it is, along with these files "hello_cardboard_app.h", "hello_cardboard_app.cc", "util.cc" and "util.h". and just write my own JNI file? Or do I need to write the above mentioned 4 files as well?

Would really appreciate if you can help.
Thanks,
G. Puniya

@arilow
Copy link

arilow commented Feb 26, 2024

Sorry @p4puniya I lost this comment. Please let me know if there is anything I can help you with regarding the use of the Cardboard SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants