I don't know if this is the right thread to put this question into but since i am kind of stuck at the issue therefore i am putting the question here.
Actually i want to put the jar file into the XML and since the jar file is a binary data i need to MIME encode it. I am stuck at the issue that how to encode the jar file and put that file into the XML. Please provide me with some sample code or links or some guidance on how to achieve this goal?
Also if it is not the appropriate thread please move it to more appropriate thread.
But the best aproach, in my humble opinion, is to have a URL in the XML-file that points to a server from where the jar-files can be downloaded. That is the way it is done in Eclipse Update manager, IntelliJ uppdate manager and other similar applications.
Joined: Apr 24, 2008
Thank you very much for your reply. But the actual issue is that my client want me to send the jar file using an SMS so that there is no need for GPRS on the other end(Mobile user). That is why i have to send the file itself in an XML.
Also note that the classes in a jar are binary data. XML is required to be character data (UNICODE). In order to pass binary data in XML you will have to base64 encode and decode, just setting the MIME type is not enough. In base64, 3 bytes turn into 4 character, thus limiting the size even more.
Bill [ September 04, 2008: Message edited by: William Brogden ]
Is the receiving system a mobile phone? How is a mobile phone going to process an SMS message containing XML with an encoded JAR file?
Well yes the receiving end is a Mobile. Well I am not going to send the jar file in one SMS.Can't I send it in multiple messages as we know that when the data length extends the 160 characters the SMS is broken into multiple parts and when it is received at the mobile end it is assembled into one message. So why don't we apply the same concept in case of receiving jar file. Can't the mobile phone recognize the fact that the content is a jar file and treat the content accordingly.
Originally posted by Girish Vasmatkar: Can't the mobile phone recognize the fact that the content is a jar file and treat the content accordingly.
Suppose you have a JAR file of 20 KB, which is very small. If you break that into parts of 160 bytes, that would be 128 SMS messages! Mobile phones normally have a limit to how many SMS messages they can store. I think mine can't store more than 100 or so at one time.
The mobile phone will ofcourse not automatically recognise that the content is a JAR file and do something with it.
Joined: Apr 24, 2008
Got the point. I am dumping the idea of SMS. Thank you all for taking time out of your schedule. But here is another question. Can i send the file using MMS? But my fear is that many phone softwares do not provide facility to send the jar file. Only image files, sound files or video files are displayed while browsing for the content to be sent over MMS. So can we write a program which follows MMS specifications and send a jar file OTA.