locked
How to work with .zip files in xamarin? RRS feed

  • Question

  • User21051 posted

    I need my app to look for a .zip file and then extract it and use it... is there a way to do it?

    Wednesday, October 23, 2013 4:46 PM

All replies

  • User21051 posted

    I'm still searching and i found http://dotnetzip.codeplex.com/, does anybody knows if it works with android or if there is an easy way to do this?

    Wednesday, October 23, 2013 4:57 PM
  • User209 posted

    Take a look at System.IO.Compression.GZipStream. It took me 2 seconds finding it on my favorite search engine with the query "C# unzip file". And there are loads of samples too!

    Wednesday, October 23, 2013 4:58 PM
  • User21051 posted

    Since its a native library and will be created as a .net application that dotnetzip should work fine on android with xamarin right?

    Wednesday, October 23, 2013 5:27 PM
  • User209 posted

    Run it through scan.xamarin.com and see for yourself if it will work.

    Wednesday, October 23, 2013 5:45 PM
  • User1603 posted

    As a rule, if it doesn't use any p/invokes, it should work. As Cheesebaron says though, get the dll and run it through the scanner.

    Wednesday, October 23, 2013 6:04 PM
  • User21051 posted

    Here i we have the documentation of this dll http://dotnetzip.herobo.com/DNZHelp/Index.html So im doing exactly what it says there

    path = System.IO.Path.Combine(constUrl,"/teste");
    foreach (ZipEntry e in zip)
    {
         e.Extract(path);
    }
    

    And zip is a file that i created from the same place where path is so the Path is right... But when i run it i got path i empty... even if it is right i tried everything if someone please may take a look... i found other guy with this problem but no answers...

    Wednesday, October 23, 2013 6:36 PM
  • User21051 posted

    Well i looked for dlls and c# stuff and nothing seem to work, i guess i ll have to use java stuff, i just want to know if is it possible to do this in xamarin

    http://stackoverflow.com/questions/3382996/how-to-unzip-files-programmatically-in-android

    I need a little help please

    Wednesday, October 23, 2013 7:07 PM
  • User21051 posted

    http://developer.android.com/reference/java/util/zip/ZipInputStream.html

    Maybe this >_> trying to understand something

    Wednesday, October 23, 2013 7:11 PM
  • User263383 posted

    Use System.IO.Compression and there is a sample at https://www.codeguru.com/csharp/.net/zip-and-unzip-files-programmatically-in-c.htm

    Wednesday, December 13, 2017 6:33 AM