Binding libaums AAR in a Xamarin Android project RRS feed

  • Question

  • User339795 posted

    I did a binding of libaums AAR in my Xamarin Android solution in Visual Studio. I used libaums-0.5.0.aar from here : https://bintray.com/package/files/mjdev/maven/libaums?order=asc&sort=name&basePath=com%2Fgithub%2Fmjdev%2Flibaums%2F0.5.0&tab=files At compile time I got 2 errors that I solved by adding those directives to my Metadata.xml file:

    IUsbFile IUsbFile

    Then I tried to implement the example found on the libaums github to get the mass storage devices:

                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);

    But at run time I have an exception on currentFs.Capacity which says 'no non-static method "Lcom/github/mjdev/libaums/fs/fat32/Fat32FileSystem;getCapacity()J"'

    Any ideas?

    Monday, October 23, 2017 3:15 PM

All replies

  • User339795 posted

    The directives in Metadata.xml are as follows :

    <attr path="/api/package[@name='com.github.mjdev.libaums.fs.fat32']/class[@name='FatDirectory']/method[@name='createDirectory']" name="managedReturn">IUsbFile</attr>

    <attr path="/api/package[@name='com.github.mjdev.libaums.fs.fat32']/class[@name='FatDirectory']/method[@name='createFile']" name="managedReturn">IUsbFile</attr>

    Monday, October 23, 2017 3:17 PM
  • User339795 posted

    I finally solved my problem in doing some modifications in the libaums Java source code.

    Thursday, October 26, 2017 12:18 PM