Android Decompress Rar File

I want to learn how to unzip a .rar file in android. Zip files can be easily unzipped using ZipStream. Is there a similar way for rar files.

+4
source share
2 answers

I just figured it out with junarar from here https://github.com/edmund-wagner/junrar

Create a new package in the Android src directory called com.github.junrar You must remove com.github.junrar.vfs2 because it has some dependencies and you probably won't use it.

You will probably get some errors in the log class. You can either delete several lines of logging, or, as I wrote a small shell that links to android.util.Log. I did this and changed my inbox.

If you're done importing your code, take a look at jUnrars testutils. I used this and it worked out of the box:

https://github.com/edmund-wagner/junrar/blob/master/testutil/src/main/java/com/github/junrar/testutil/ExtractArchive.java

Hope this helps

+3
source

RAR is not used very often (with the exception of some niches), so you will not find support built into the Android libraries. Probably the easiest way is to get a Java library that processes RAR files as described in this question:

RAR archives with java

0
source

Source: https://habr.com/ru/post/1398440/


All Articles