aspose file tools
The moose likes Java Micro Edition and the fly likes Calculating Data being transfered Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Reply Bookmark "Calculating Data being transfered" Watch "Calculating Data being transfered" New topic
Author

Calculating Data being transfered

Nicky Formosa
Greenhorn

Joined: Mar 05, 2007
Posts: 14
Hi All,

I'm currently running my j2me app by emulating tru Eclipse. I would like to know if there is a way to simply calculate the amount of data is being transfered from my server to the app so that i can calculate cost eventually!?

Thanks all..

regards
Nick
Caius Jard
Greenhorn

Joined: Mar 31, 2004
Posts: 8
I'm working with MIDP1.0 and gthere isnt a way to find out the size of the request from the java side, but here's a thought:

The server is much more intelligent and powerful; It is perfectly capable of sizing the request, counting the bytes of the response, and then telling the midlet.. So basically I reckon you can get the server to do this?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14491
    
    7

You are correct. In many cases, this information can be extracted directly from the server log files.

Example:


This is actually a robot spidering the website (an infamous spammer, I think), but that's not important. What is is the numbers following the "200"s.

The "200"s are HTTP status codes, the numbers following them are the downloaded data size in bytes.

To count bytes going up to the server, look at the POST requests, which also have a length in bytes. For more accurate stats, look the the URLs of the GET requests and compute their string lengths.

I don't think I'm actually capturing transfers of headers and cookies, so the final tally may require figuring out the average overhead and adding it in.


Customer surveys are for companies who didn't pay proper attention to begin with.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14491
    
    7

... And yes, the robot.txt files really ARE only 1 byte long!

It's a hint to spiders NOT to do what they're doing and the mere presence of the file is a signal, so there's nothing in it but a single blank line (Unix-style).
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Calculating Data being transfered
 
Similar Threads
progressbar in real time and streams
query regarding getFetchSize
hyper terminal - javax.comm
payment gateway integration
Performance issue if I do not retrieve the rest of result set