this doesn't seems be a valid strategy for Android...
# android
e
this doesn't seems be a valid strategy for Android, where there is no
URI
. Reading around, it seems I should use
InputStream
to fetch the files (from
asset
), is that right?
w
elect: If you’re reading from your app then yes. Also if your implementation works against
InputStream
then one way or another you’ll be able to get files in Android as `InputStream`s
e
Actually I have this user having troubles, https://github.com/java-graphics/assimp/issues/5
I don't know if he is reading from his app, I assume so.
e
my actualy implementation is using
URI
I am wondering now if I should switch to
InputStream
completely
I'd like to have an unique code path for desktop and android if possible..
w
You can, you just have to be careful that classes that use Java APIs that aren’t available on Android aren’t even initialized
Basically you can’t even touch them (as in call static method on a class which has
java.nio.file.*
imports)
e
what would you suggest to do?
two different path code or an unique one?
w
Probably one router to check the environment, and two implementations of an interface
That’s what I used to do when I had to do different things if there was google play services library available and if there wasn’t