Coder Social home page Coder Social logo

mzip-android's Introduction

GitHub version

Mzip-Android

An Android compress and extract library support popular compression format such as rar, zip, tar, lzma that support android api >= 14 (may work >=9 not tested) also tested on android 7.1.1

ABOUT The LIBRARY....


The simple and useful library for android app developers to read/write archives like zip , rar , tar , tar.gz, tar.bz2. I needed compressing files for a project, Because I could not find a good and thorough library I wrote a nearly complete library. Other open source projects have been used to write this library.

Supported formats

.zip .tar .tar.gz & .tgz .tar.bz2 & .tbz2 .tar.xz & .txz .tar.lz4 & .tlz4 .tar.sz & .tsz .rar (extract only ,may you can find a method to create look ir.mahdi.mzip.rar classes)

Download

You can use Gradle:

repositories {
 maven { url 'https://jitpack.io' }
}

dependencies {
  compile 'com.github.ghost1372:Mzip-Android:0.4.0'
}

Or Maven:

Step 1. Add the JitPack repository to your build file

<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

Step 2. Add the dependency

<dependency>
	    <groupId>com.github.ghost1372</groupId>
	    <artifactId>Mzip-Android</artifactId>
	    <version>0.4.0</version>
	</dependency>

How do I use MZip?

Zip:

ZipArchive zipArchive = new ZipArchive();
zipArchive.zip(targetPath,destinationPath,password);

//Example
ZipArchive zipArchive = new ZipArchive();
zipArchive.zip("/sdcard/file.pdf","/sdcard/file.zip,"");

//if you want protect with password
zipArchive.zip("/sdcard/file.pdf","/sdcard/file.zip,"123456 or anything you want");

Unzip

ZipArchive zipArchive = new ZipArchive();
zipArchive.unzip(targetPath,destinationPath,password);

//Example
ZipArchive zipArchive = new ZipArchive();
zipArchive.unzip("/sdcard/file.zip","/sdcard/folder,"");

//if your file protected with password
zipArchive.unzip("/sdcard/file.zip","/sdcard/folder,"123456 or anything you want");

If your file does not have a password, Leave it blank.
Rar:

RarArchive rarArchive = new RarArchive();
rarArchive.extractArchive(file archive, file destination);

//OR use String path
rarArchive.extractArchive(string archive, string destination);

//Example
RarArchive rarArchive = new RarArchive();
rarArchive.extractArchive("/sdcard/file.rar","/sdcard/folder");


for other various format you can use RarArchive class and extractArchive function it must be work with tar and other formats.

mzip-android's People

Contributors

ghost1372 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.