Android Question Compress data with Zlib

Blue.Sky

Active Member
Licensed User
Longtime User
Hi
I apply zlip function data in php (for compress) and uncompress in b4a
Example i compress "Hello Erel"
result is "eJzzSM3JyVdwLUrNAQATlQOd"
so result is longer than source,however i want to compress data
Please explain zlip usage to me
 

JohnK

Active Member
Licensed User
Longtime User
compression works best on MUUUUUCH longer data, with repeated patterns within them. Try compressing a string made up of 1000 "a"'s.
 
Upvote 0

Blue.Sky

Active Member
Licensed User
Longtime User
compression works best on MUUUUUCH longer data, with repeated patterns within them. Try compressing a string made up of 1000 "a"'s.
for 100 character not possible?
 
Upvote 0

Informatix

Expert
Licensed User
Longtime User
for 100 character not possible?
In such a case, it is better to not compress the data. The compressed result may be bigger because of the extra data, e.g. the dictionary. Usually, a compression is only interesting with uncompressed data (so compressing a JPG file is mostly a waste of time) and enough data to have repetitive patterns.
 
Last edited:
Upvote 0

Blue.Sky

Active Member
Licensed User
Longtime User
In such a case, it is better to not compress the data. The compressed result may be bigger because of the extra data, e.g. the dictionary. Usually, a compression is only interesting with uncompressed data (so compressing a JPG file is mostly a waste of time) and enough data to have repetitive patterns.
Thank you for your answer.
I use xmlrpc in my project and in php get list all files and folder and return to android
maybe user have many files for return
I want to compress it to transfer
have you idea?
 
Upvote 0

JohnK

Active Member
Licensed User
Longtime User
Try compressing all the files into a single compressed unit instead of compressing the individual items separately.
 
Upvote 0
Top