Hi
When end user install and access my application first time, i will write some entries in RMS. Next time when user access the app, it will check in RMS this application is accessed previously or not.
What my idea is to track the end user, when end user will install the app first time, it will send Text SMS for Registration to my cell no.
so only first time below code will executed.
----------------
int msgsendflag=1;
try {
String addr = "sms://" + "+919892238248";
MessageConnection conn = (MessageConnection) Connector.open(addr);
TextMessage msg = (TextMessage)conn.newMessage(MessageConnection.TEXT_MESSAGE);
msg.setPayloadText(smstext);
conn.send(msg);
msgsendflag=1;
} catch (IllegalArgumentException iae) {
//Some error has occured... take user to exit form. Next time user access app, the same code segment will get executed as we have not written RMS entry.
msgsendflag=1;
ExitForm exit = new ExitForm(getDisplay());
exit.exit(this);
}
catch (Exception e) {
//Some error has occured... take user to exit form. Next time user access app, the same code segment will get executed as we have not written RMS entry.
msgsendflag=1;
ExitForm exit = new ExitForm(getDisplay());
exit.exit(this);
}
if(msgsendflag!=0) {
//Message send successfully...Go ahead and execute the app, Write some RMS entry so next time this code segment will not get executed.
}
----------
We do not use any signing/trusted certificate etc.
This is working fine. however all mobile does not support WMA. What we want is below....
1. if mobile is supporting WMA, then SMS should be sent as per above logic.
2. if mobile is not supporting WMA, without SMS sent application should run fine.
3. when sending SMS, OS will ask end user, it will send SMS to xyz no, Yes and No. If user press NO, it should exit the app.
i.e. all case above logic should work, except if device is not supporting WMA.
Can anyone suggest what kind of exception/logic we should handle ?
PS : it should work fine on Nokia as well as Non-Nokia device
Thanks
Raxit Sheth
www.m4mum.com

Reply With Quote

