Hello,
we can know if a MIDlet is activate by an icomming connection(Socket or Datagramm) but can know if a MIDlet is activate bye time alrame or by a SMS connection
Thank
Hello,
we can know if a MIDlet is activate by an icomming connection(Socket or Datagramm) but can know if a MIDlet is activate bye time alrame or by a SMS connection
Thank
Activate Midlet bye time alarm.....
/*register an alarm*/
public void setAlarm() {
try {
Date d = new Date();
String classname = "Midlet"
long previousAlarmTime = PushRegistry.registerAlarm(
classname,d.getTime() + MILLISECONDS_TILL_ALARM);
} catch (Exception e) {
}
}
Also Please checkout the link to activate the midlet thorugh sms..
http://wiki.forum.nokia.com/index.ph...try_in_Java_ME
If Im wrong and misunderstand ur need then please make me correct and reply with full explanation about ur requirement.
thanks,
jitu_goldie..
KEEP TRYING..
Yes you misunderstood my question . I want to get information about the orgin of a MID let activation . If the orgin is a network connection we can get this information using the code above
(ref to this http://developers.sun.com/mobility/m...icles/pushreg/)Code:/** * Determine if activated due to inbound connection and * if so dispatch a PushProcessor to handle incoming * connection(s). @return true if MIDlet was activated * due to inbound connection, false otherwise */ private boolean handlePushActivation() { // Discover if there are pending push inbound // connections and if so, dispatch a // PushProcessor for each one. String[] connections = PushRegistry.listConnections(true); if (connections != null && connections.length > 0) { for (int i=0; i < connections.length; i++) { PushProcessor pp = new PushProcessor(connections[i]); } return(true); } return(false); }
So my question is that:how could i determine that a MIDlet was activate by Time Alarm and not how to register for time activation
register midlet for activation after fix time interval..
PushRegistry.registerAlarm(""+midlet,TIME in MILLISECONDS);
thanks,
jitu_goldie..
KEEP TRYING..
if im not mistaken if u call the resiterAlarm method the last time for a registered alarm is returned...
if that time has passed (and alarm was set for that time) then I guess u might conclude that it was the alarm to start it up, especially if u get the time right away when midelt starts and then compare it to last known registry alarm...