I am evaluating Xamarin (v4.8) and for my Android application I would like to read files from Windows shared folders.
In Java application I was able to do this with using jcifs library. When I tried to add java binding to Xamarin project, I was not able to do this.
First I got error:
'Name': member names cannot be the same as their enclosing type \Android\Xamarin\XamarinTest1\JCIFS\obj\Debug\generated\src\Jcifs.Netbios.Name.cs
I have added the following:
This helped for the previous error, but produces 5 new errors about wrong access modifies - for example:
'Jcifs.Util.MD4.EngineDigest()': cannot change access modifiers when overriding 'protected' inherited member 'Java.Security.MessageDigestSpi.EngineDigest()' \Android\Xamarin\XamarinTest1\JCIFS\obj\Debug\generated\src\Jcifs.Util.MD4.cs
I have fixed that with:
After that all hell break loose - I got 289 (!!!) errors. At that point I gave up.
I have also seen that in the release notes for v4.8 the following bug is marked as fixed:
11783: jcifs: binding generator tools miss some methods that involves derivation in different jars
I would suspect that fixing that bug would mean that jcifs can now be bound without any problems.
Therefore I am asking if it is possible to use jcifs in Xamarin?
I think that accessing windows shares could be quite important for .net developers for Android in iOS.
Therefore I have two recommendations:
1) jcifs is just one of the commonly used java library - it would be great if you at Xamarin would prepare open source Java Binding libraries for the most common use cases - with already defined Metadata.xml and other adjustments to build the projects. This would be much easier done by you because you have much more experience than we have (and it could be also used to improve the binding mechanism). You should also list the java libraries that cannot be binded - so we (other developers) will not lose time with trying to find the magic formula.
2) It would be great if you at Xamarin would invest some time to convert the jcifs library into .net library (this would make it useful for iOS also). I am sure that this could be very useful for many Xamarin users - especially for business applications that are used internally in the companies (and need access to internal company storage). You could also sell it in your components store. Maybe even Microsoft could be interesting in helping you with that - if they can provide you the native c++ code to connect to shared folders and you could add cifs support natively this would be amazing (using jcifs from java is already quite slow).