Binding libaums RRS feed

All replies

  • User339795 posted

    Did you get it to work?

    I am trying to do the same but I am having this issue : https://forums.xamarin.com/discussion/105463/binding-libaums-aar-in-a-xamarin-android-project

    Tuesday, October 24, 2017 7:07 AM
  • User1504 posted

    @ebesnard try to add these into Metadata file:

    <attr path="/api/package[@name='com.github.mjdev.libaums.fs.fat32']/class[@name='FatDirectory']/method[@name='createDirectory' and count(parameter)=1 and parameter[1][@type='java.lang.String']]" name="managedReturn">Com.Github.Mjdev.Libaums.FS.IUsbFile</attr> <attr path="/api/package[@name='com.github.mjdev.libaums.fs.fat32']/class[@name='FatDirectory']/method[@name='createFile']" name="managedReturn">Com.Github.Mjdev.Libaums.FS.IUsbFile</attr>

    Tuesday, October 24, 2017 7:10 AM
  • User339795 posted

    Yes I did that but I am having an exception while querying currentFs.Capacity in the below code :

            UsbMassStorageDevice[] devices = UsbMassStorageDevice.GetMassStorageDevices(Global.MyActivity.ApplicationContext);
            foreach (UsbMassStorageDevice device in devices)
                // before interacting with a device you need to call init()!
                // Only uses the first partition on the device
                IFileSystem currentFs = device.Partitions[0].FileSystem;
                Console.WriteLine("Capacity: " + currentFs.Capacity);
                Console.WriteLine("Occupied Space: " + currentFs.OccupiedSpace);
                Console.WriteLine("Free Space: " + currentFs.FreeSpace);
                Console.WriteLine("Chunk size: " + currentFs.ChunkSize);
    Tuesday, October 24, 2017 7:32 AM
  • User339795 posted

    What version of libaums did you use ? I am using libaums-0.5.0.aar from here : https://bintray.com/package/files/mjdev/maven/libaums?order=asc&sort=name&basePath=com/github/mjdev/libaums/0.5.0&tab=files

    Tuesday, October 24, 2017 7:35 AM
  • User1504 posted


    Tuesday, October 24, 2017 7:37 AM
  • User339795 posted

    And where did you get the AAR? I cannot find it on the web. Could you please share it?

    Tuesday, October 24, 2017 7:49 AM
  • User339795 posted

    Also, I am using Visual Studio 2015, and you? Would be great if you could share your 0.5.2 AAR cause I still can't find it on the web.

    Tuesday, October 24, 2017 8:07 AM
  • User1504 posted


    Tuesday, October 24, 2017 8:10 AM
  • User339795 posted

    Thanks but I built the 0.5.2 AAR under Android Studio 2.3.3, then I did bind the AAR under an Android Binding Library project under Visual Studio 2015 but I am still facing the same exception.

    Do you have an example of a code that works for you when you call the binding library?

    Tuesday, October 24, 2017 10:23 AM
  • User339795 posted

    Though I am new to Java I did some modifications to the libaums source code and I got it to work. I am now able to list the content of the root directory of a USB stick, create a foler and a text file Inside that folder. But sadly every call to UsBMassStorage.Init() has a bad interaction with my app as it ends in a crash after the several operations on the USB stick.

    Tuesday, October 24, 2017 2:39 PM
  • User339795 posted

    I finally found why UsbMassStorage.Init() had a bad interaction with the rest of my code, it wasn't due to the libaums Library.

    Thursday, October 26, 2017 12:23 PM
  • User386795 posted

    @ebesnard , I also have problem on UsbMassStorage.Init() and it crash my app. Could you please tell me know where the problem is?

    Monday, June 24, 2019 12:05 AM