×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    34

    WMA Sending Text message, handling exception : expert query

    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

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: WMA Sending Text message, handling exception : expert query

    If you want to support devices without WMA, you must not attempt to execute code that uses WMA.

    This document describes a method for using an API that might not be available. It uses the Location API as an example, but the same applies to any API.

    Graham.

Similar Threads

  1. Replies: 0
    Last Post: 2009-01-15, 04:10
  2. Message Sending failed !!!!!
    By ankushbabrekar in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2007-03-21, 07:09
  3. VS.Net 2003 Carbide 2.01 and epoc32.exe
    By ValentinK in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 2
    Last Post: 2007-01-12, 12:31
  4. Unreadable long text sms message on some phone
    By Mic@Vox in forum General Messaging
    Replies: 0
    Last Post: 2006-03-07, 10:43
  5. Sending Commands to handset using a normal text message
    By ahmedb_ in forum General Messaging
    Replies: 1
    Last Post: 2002-08-15, 09:38

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •