android-3D-model-viewer icon indicating copy to clipboard operation
android-3D-model-viewer copied to clipboard

Stream handler system property should not be required

Open upost opened this issue 4 years ago • 0 comments

Currently, to load 3d objects from assets URIs, we need to add a system property with our package name like so:

static { System.setProperty("java.protocol.handler.pkgs", MY_PACKAGE_NAME); URL.setURLStreamHandlerFactory(new AndroidURLStreamHandlerFactory()); }

Otherwise, SceneLoader will fail to parse the URI. See also this topic on Stackoverflow: https://stackoverflow.com/questions/51052403/malformedurlexception-unknown-protocol-android

Suggestion: Use android.net.Uri in favor of java.net.URI in SceneLoader (disclaimer: not sure if this would be sufficient, but you DO use Uri in ContentUtils)

upost avatar Dec 07 '20 12:12 upost