compress and uncompress files (zip or tar file)

8 posts / 0 new
Last post
sikamedia
sikamedia's picture
Offline
Mobile Conjurer
Joined: 23 Jun 2010
Posts:
compress and uncompress files (zip or tar file)

Any examples of compress and uncompress files (zip or tar type file)??

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:

Hi,

We've not built a zip library into MoSync. One of the reasons for this is that they can be very memory hungry and won't work well on all the devices we support. You should be able to build zlib (zlib.net) on MoSync though, and I can help you if you want to do this.

Thanks

sikamedia
sikamedia's picture
Offline
Mobile Conjurer
Joined: 23 Jun 2010
Posts:

Could you give me some reasons why it wont work well on all the devices we support? for using the file compression functionality , we can reduce the data transmission size between mobile client and server in order to cut the cost of transmission in mobile network. It is also easy to arrange files in some points. Will be appreciated if you could give more comments on it.

Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:

Hi, the problem I was thinking of was heap size. Memory compression (particularly so) and decompression (less so) can consume a large amount of memory, with catalogues, indices and swap space. It depends on your target device, but if you want to support a Motorola PEBL, then you may find that there is very little memory left for you application.

It can reduce transmission size, I approach this by stripping down the amount of data I send into tight binary packages rather than verbose XML documents for instance.

Its all going to be down to the devices you want to support. If you're only targeting modern phones, then you will probably be alright. My point is that it is very difficult to predict the amount of memory you may need.

As I said, I can't see any reason why zlib won't build on MoSync, so try it. I'll help you out if you need it.

pengliang
pengliang's picture
Offline
Joined: 31 May 2011
Posts:

I am interesting in building zlib on MoSync.

Is anyone already done that?

Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:

I've never heard of anyone trying it - give it a go and let me know if there is a problem.

pengliang
pengliang's picture
Offline
Joined: 31 May 2011
Posts:

Hi, Sam

Is the fopen function in newlib still not working?

I successfully compiled the zlib using newlib. But, failed testing about fopen file...

Thx!

David Freitas
jddcef's picture
Offline
Mobile Conjurer
Joined: 28 Jul 2011
Posts:

Have a look at some libraries here:
http://stackoverflow.com/questions/124239/fastest-c-file-compression-library-available

There are libraries that require no memory for decompression. e.g. UCL, miniLZO

This would also serve as a good unit test for the MoSync target platforms.