j2me http compression gzip/deflate

Forum for J2ME mobile games related topics including programming doubts, books and other resources for J2ME game development

j2me http compression gzip/deflate

Postby menis » Tue Dec 11, 2007 10:03 pm

Hello all,

I am currently building a Midlet in j2me platform which basically performs
http connections, parses the xml output and persents the results to the end
user. My question concerns the compression that the j2me's implementation
on mobiles has. Lets examine the following scenario: We have an apache server
that has "enabled" compression and on the other side My Midlet. If i construct
http header 'Accept-Encoding' in order to perform the http connection
like ---> httpConn.setRequestProperty("Accept-Encoding","gzip, deflate"),
the InputStream that i will have to parse will be zipped or plain?
Does the j2me implementation will do the "unzip" (transparently for the programmer)
OR i have to do it by my self? Is there another way to achieve compression without
implementing something from my side?
Generally can i use some other ways to 'save' some bandwidth?

Thanks in advance

NiKolaos
menis
 
Posts: 12
Joined: Sun Nov 25, 2007 6:11 pm

Re: j2me http compression gzip/deflate

Postby DevelopmentTeam » Wed Dec 12, 2007 3:45 am

I dont think we have inbuilt compression and deflate function in j2me. Meanwhile you need to check some light weight xml compression algo available opensource.

For another idea, we usually dont use xml based transfer but we simplify the formate with delimits while we have a definite system where we are not going to upgrade anything or change often data format often.
When you use xml format the size of xml syntax takes more than 50% of the complete data. And when you use delimits it is reduced upto 15 to 25%. So you need to think if your system really needs xml and if so you atleast have to keep the variable or tag names as small as you can.
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India


Return to J2ME Games

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron