This Code here is a normal Java application not an android application, this is designed to send C2DM messages to a device with YOUR_REGISTRATION_STRING as the developer wit
The content length is set automatically. You can't set it yourself directly. You can however pass the correct length when setting fixed length streaming mode.