alvr-org / ALVR

Stream VR games from your PC to your headset via Wi-Fi
MIT License
5.52k stars 488 forks source link

Can I integrate aar or jar #1884

Closed xujunjie12345 closed 1 year ago

xujunjie12345 commented 1 year ago

Currently, the code is entirely built using cargo, but my lib is aar. Can I integrate and use it? txs

zmerp commented 1 year ago

No, the client does not support aar archives. If the aar contains only a native shared library, unzip it and include it using build.rs. If it contains any Java bytecode, it will not work with ALVR.

xujunjie12345 commented 1 year ago

No, the client does not support aar archives. If the aar contains only a native shared library, unzip it and include it using build.rs. If it contains any Java bytecode, it will not work with ALVR. you mean that we can only reflect the system's java code, but us can't use your own java libraries?

zmerp commented 1 year ago

you mean that we can only reflect the system's java code, but us can't use your own java libraries?

Exactly. You can access built-in android java objects/methods using JNI (with some caveats) but you can't add third party java libraries. This is mostly a limitation of the tool we use to build the APK. Techically nothing prevents us from packing the APK using custom code and adding the java bytecode dex.

xujunjie12345 commented 1 year ago

I see. Thank you very much.

xujunjie12345 commented 1 year ago

close