I am using JCIFS in my new Android project. Somehow I decided to use the URL class to generalize the file path (so that I can add more protocol later). What I did as below
URL url = new URL("smb://192.168.1.1/filepath");
And then a java.net.MalformedURLException exception is thrown.
Exception in thread "main" java.net.MalformedURLException: unknown protocol: smb
at java.net.URL.<init>(URL.java:184)
at java.net.URL.<init>(URL.java:127)
Consulting Questions JCIFS shows that I must register a protocol before using the class. However, I really don't know how to do this in Android. I think the library is doing this already, but not on Android.
So what should I do?
source
share