×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    5

    Help me on Auto Sending SMS

    Hi....Experts
    I'm Woking on Auto Sending Sms can any send me the code form that.....

  2. #2
    Nokia Developer Champion
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,192

    Re: Help me on Auto Sending SMS

    Auto send? Are you talking about the fact that the MIDlet asks for permission to send SMS messages (getting rid of the confirmations requires signing which requires you to buy a certificate and even that does not guarantee that you get rid of the confirmations as on some phones the confirmations will be always there). For more information see for example here http://wiki.forum.nokia.com/index.ph...curity_Domains

    If you are just looking for code samples for sending SMS messages see here http://wiki.forum.nokia.com/index.ph...aging_Articles

    Hartti

  3. #3
    Registered User
    Join Date
    Apr 2011
    Posts
    5

    Re: Help me on Auto Sending SMS

    if I gave the date and time sms Should go on that time...
    now i did that the problem is that that application should be running till the sms to go... if exit sms wont go...

  4. #4
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: Help me on Auto Sending SMS

    Quote Originally Posted by Dushyanth View Post
    if I gave the date and time sms Should go on that time...
    now i did that the problem is that that application should be running till the sms to go... if exit sms wont go...
    You can set a Push Registry Alarm to launch the app incase the app is closed and then send the SMS.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  5. #5
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Help me on Auto Sending SMS

    However keep in mind that you need to provide the permission to the app at the time of the invocation of the application using the push registry. This permission even will asked if the app is signed using the third party certificate.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  6. #6
    Regular Contributor
    Join Date
    Jul 2010
    Location
    Hyderabad
    Posts
    63

    Re: Help me on Auto Sending SMS

    For more clearance,
    Your application would register for push registry with alarm of specific date and time. and your applications sms sender module should always become active on app start, if the system time reach the specified time, than it will initiate the sms sending task.
    If the application is closed than alarm will push start your application and your sms sender module will send the defined sms, followed by permission querry.
    - Mekal

  7. #7
    Registered User
    Join Date
    Apr 2011
    Posts
    5

    Re: Help me on Auto Sending SMS

    can one of you give me that code plz...

  8. #8
    Registered User
    Join Date
    Apr 2011
    Posts
    5

    Re: Help me on Auto Sending SMS

    This is my code plz help me....class name is Alarm.. plz fix the problem


    import java.io.IOException;
    import java.util.*;
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import java.util.Timer;
    import java.util.TimerTask;
    import javax.microedition.io.Connector;
    import javax.wireless.messaging.MessageConnection;
    import javax.wireless.messaging.TextMessage;

    public class Alarm extends MIDlet implements ItemStateListener,CommandListener {
    private Alert alert;
    private String port;
    private Display display;
    private Form fmMain;
    private Command cmAlarm;
    private Command cmReset;
    private Command cmExit;
    private DateField dfAlarmTime;
    private TextField desc,number;
    private int dateIndex;
    private Date currentTime;
    private Timer tm;
    private AlarmTimer tt;
    private boolean dateOK = false;

    public Alarm() {
    display = Display.getDisplay(this);
    port = "50055";
    if(getAppProperty("Port-SMS") != null)
    port = getAppProperty("Port-SMS");
    alert = new Alert(null);
    alert.setTimeout(3000);


    fmMain = new Form("When to Send SMS:");


    currentTime = new Date();


    dfAlarmTime = new DateField("", DateField.DATE_TIME);
    dfAlarmTime.setDate(currentTime);


    cmAlarm = new Command("Sleep", Command.SCREEN, 1);
    cmReset = new Command("Reset", Command.SCREEN, 1);
    cmExit = new Command("Exit", Command.EXIT, 1);
    desc = new TextField("Description", "", 20, TextField.ANY);
    number = new TextField("Number", "", 20, TextField.PHONENUMBER);


    dateIndex = fmMain.append(dfAlarmTime);
    fmMain.addCommand(cmAlarm);
    fmMain.addCommand(cmReset);
    fmMain.addCommand(cmExit);
    fmMain.append(desc);
    fmMain.append(number);
    fmMain.setCommandListener(this);
    fmMain.setItemStateListener(this);
    }

    public void startApp() {
    display.setCurrent(fmMain);
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }

    public void itemStateChanged(Item item) {
    if (item == dfAlarmTime) {
    if (dfAlarmTime.getDate().getTime() < currentTime.getTime())
    dateOK = false;
    else
    dateOK = true;
    }
    }

    public void commandAction(Command c, Displayable s) {
    if (c == cmAlarm) {
    if (dateOK == false) {
    Alert al = new Alert("Unable to set alarm",
    "Please choose another date and time.", null, null);
    al.setTimeout(Alert.FOREVER);
    al.setType(AlertType.ERROR);
    display.setCurrent(al);
    }
    else {
    tm = new Timer();
    tt = new AlarmTimer();

    long amount = dfAlarmTime.getDate().getTime() -
    currentTime.getTime();
    tm.schedule(tt,amount);

    fmMain.removeCommand(cmAlarm);
    fmMain.removeCommand(cmReset);

    fmMain.delete(dateIndex);
    fmMain.deleteAll();

    fmMain.setTitle("Sleeping...");
    }
    } else if (c == cmReset) {
    dfAlarmTime.setDate(currentTime = new Date());
    } else if (c == cmExit) {
    destroyApp(false);
    notifyDestroyed();
    }

    }

    private class AlarmTimer extends TimerTask {
    public final void run() {

    Alert al = new Alert("");
    al.setTimeout(Alert.FOREVER);
    AlertType.CONFIRMATION.playSound(display);

    MessageConnection conn = null;
    String address= "sms://" + number.getString();
    try {
    conn = (MessageConnection) Connector.open(address);
    TextMessage msg = (TextMessage)
    conn.newMessage(MessageConnection.TEXT_MESSAGE);
    msg.setAddress(address);
    msg.setPayloadText( desc.getString());
    conn.send(msg);
    alert.setString("Sending to " +address.substring(6));
    alert.setType(AlertType.INFO);
    display.setCurrent(alert);
    } catch (IOException ioe) {
    ioe.printStackTrace();
    }
    if (conn != null) {
    try {
    conn.close();
    } catch (IOException ioe) {
    ioe.printStackTrace();
    }
    }

    cancel();
    }
    }
    }
    Last edited by Dushyanth; 2011-04-14 at 20:25.

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

    Re: Help me on Auto Sending SMS

    Quote Originally Posted by Dushyanth View Post
    plz fix the problem
    What problem? It would really help to know:

    * on what device or emulator you are running the code
    * what happens... errors, exceptions, messages, anything.

    Graham.

  10. #10
    Registered User
    Join Date
    Apr 2011
    Posts
    5

    Re: Help me on Auto Sending SMS

    if I gave the date and time sms Should go on that specified time...
    i did that ... but the problem is ., that application should be running till the sms is sent....
    and if i exit the application sms wont go....

Similar Threads

  1. Auto sending sms????
    By chandantheracer in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2006-12-29, 07:44
  2. Help me... problem on mms sending error in mime type
    By micren2000 in forum General Messaging
    Replies: 0
    Last Post: 2006-03-08, 07:04
  3. (HELP ME PLEASE) Sending SMS with 3330 using SDK's
    By Eman_Mughal3 in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2002-11-21, 04:37
  4. Pls. Help Me !!! - Error sending SMS with pc connectivity sdk
    By GianlucaMazzoli in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2002-10-11, 09:28
  5. Pls. Help Me !!! - Error sending SMS with pc connectivity sdk
    By GianlucaMazzoli in forum General Messaging
    Replies: 1
    Last Post: 2002-10-11, 07:32

Posting Permissions

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