Skip to main content

How to Check and Tackle My push Registry Activation.?

1 reply [Last post]
Joined: 2008-04-22

Hello All,

i want to check wether my j2me application is activated manually by user or automatically by pushregistry. I want o have different functionality in both different cases, is there any way of detecting the pushRegistry Activation?

The thing is i want to detect the dynamic pushRegistry Activations i.e. caused by PushRegistry.registerAlarm(agr, arg2);

so please kindly let me know...



Message was edited by: wasif

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2008-04-22

i used this for the problem and its working fine ...
there is no method provided by the pushregistry api to detect the automated activation we have to handle it by ourselves using RMS or any other method u think can work:

timeStampDB = RecordStore.openRecordStore("timeStampDB", true);
int dbsize = timeStampDB.getNumRecords();
System.out.println("TimestampDB Size: "+dbsize);
if (dbsize > 0) {
System.out.println("in Dbsize IF");
int recId = timeStampDB.getNextRecordID();
byte[] timeStampFromDB = timeStampDB.getRecord((recId-1));
pushDBTime = Long.parseLong(new String(timeStampFromDB));
System.out.println("pushDBTime - launchTime = "+(launchTime-pushDBTime));
if(pushDBTime > launchTime){
autoStart = false;
else if ((launchTime-pushDBTime)<=10000){
autoStart = true;
you can use the flag after wards