How to zip / unzip OR tar / untar files in a native app through code

1,131 views
Skip to first unread message

PSK

unread,
Jun 11, 2012, 3:14:33 PM6/11/12
to android-ndk
Hi All,

I have written a small native application, which need to unzip or
untar a zip or tar file.
The zip or tar file will have multiple files.

I would like to know how we can do this through code or command lines
[adb shell ]

Appreciate your support.

Thanks

Chris Stratton

unread,
Jun 11, 2012, 10:43:29 PM6/11/12
to android-ndk
On Jun 11, 3:14 pm, PSK <androiddevelo...@gmail.com> wrote:

> I have written a small native application, which need to unzip or
> untar a zip or tar file.
> The zip or tar file will have multiple files.
>
> I would like to know how we can do this through code or command lines
> [adb shell ]

The "adb shell" is not usable by applications.

There is a build of zlib included in the ndk, which you may be able to
leverage with additional code - see for example:
https://github.com/android/platform_external_zlib/tree/master/contrib/minizip

Or you can port some other solution and build it as a shared library
to load into and call from your application process.

There are also zip file classes available in the java side of things
(not surprising, when you consider that apk's and jar's are zip files)

PSK

unread,
Jun 12, 2012, 2:46:27 PM6/12/12
to andro...@googlegroups.com
Thanks Chris.
Reply all
Reply to author
Forward
0 new messages