programatically from a MIDlet ?
This is like creating something like a receipt from a MIDlet dynamically.
Is this possible? if yes, any leads/clues on how todo this?
thanks .
programatically from a MIDlet ?
This is like creating something like a receipt from a MIDlet dynamically.
Is this possible? if yes, any leads/clues on how todo this?
thanks .
yes you can create business cards. Use fileoutputstream and create a file with a .vcf extension.
Check out this link to see how to write a bussiness card.
http://affix.sourceforge.net/howto.shtml
Hope this helps
Thanks frozen rose. But what i want to know now is how do you send it from the java program(MIDlet) to another phone? you can't send it as normal sms can u?Originally Posted by thefrozenrose
If you create a .vcf file that contains the data of a business card then you can send it via bluetooth by opening an input stream and reading the file and send it byte by byte over an outputstream that is opened to the other device.
First you need to discover the device, then discover the services and find the OBEX push service. Then send the file over that profile.
As for the SMS, I think you need a special program to encode the vcard so that it can be sent over SMS.
Hope this helps
Yea it helps to an extent. Forgive my funny question above, Actually i know it can be sent via bluetooth, but what i want is for it to be sent via sms/mms/wap push so another user say in another state/country can receive it and then use it for the purpose its intended for.Originally Posted by thefrozenrose
Now, doing this programmatically is what i need. :-)
OK. First of all you need to write the business card e.g.
textResponse = "BEGIN:VCARD\r\nVERSION:2.1\r\nN";
if (unicodeFlag) {
textResponse += ";CHARSET=UTF-8";
}
textResponse += ":";
textResponse += document.forms[0].vCardName.value;
textResponse += "\r\nTEL;PREF:";
textResponse += document.forms[0].vCardPhone.value;
textResponse += "\r\nEND:VCARD\r\n";
Then for each character, get is decimal value and then convert it to hexedecimal.
for (var i = 0; (!error && (i < textResponse.length)); i++) {
var tempStr = decToHexUTF8(textResponse.charCodeAt(i));
hexText = hexText + tempStr;
}
After you have completed this process, put all the hexedecimal values in an SMS and send it over.
The code above is taken from the program NowSMS from the file Send WAP vCard.htm
www.nowsms.com
Good luck
noice man! noice!!
Thanks i will get on this and get back to you on it. **thumbsup**