Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Is there a startup procedure or config file to register applet for startup every time phone is powered?
Or is there a special type of resident or service applet?
Or is there a "kron" like service that can start applets on the regular interval?

I'm trying to find a way how to develop Scheduler type of applications.

I saw the feature request about year ago for this functionality. Has it been implemented in the latest API versions?

Thanks a lot!

It is possible for your application to receive BREW startup notification. But this is available in BREW 2.0 or above.
In your mif go to advanced option, add notification for NMASK_SHELL_INIT. In your event handler you handle the event, like starting your applet or other stuff.
ruben

It is possible for your application to receive BREW startup notification. But this is available in BREW 2.0 or above.
In your mif go to advanced option, add notification for NMASK_SHELL_INIT. In your event handler you handle the event, like starting your applet or other stuff.
ruben

thanks alot!

thanks alot!

hi,
1Q: i try to launch my application when turn on the device, is possible?
2Q: is threre a way of configure a "direct access" to my application
thanks

hi,
1Q: i try to launch my application when turn on the device, is possible?
2Q: is threre a way of configure a "direct access" to my application
thanks

1. Yes it is possible. In your mif file you need to register for NMASK_SHELL_INIT and handle the event notification in your event handler.
2. Not sure, if I am understanding your question.

1. Yes it is possible. In your mif file you need to register for NMASK_SHELL_INIT and handle the event notification in your event handler.
2. Not sure, if I am understanding your question.

What event represent a turn ON of application

What event represent a turn ON of application

What do you mean by turning on application? Your application gets EVT_APP_START as first event.

What do you mean by turning on application? Your application gets EVT_APP_START as first event.

ok, I try it and its resolved:
static boolean probeapp_HandleEvent(IApplet * pi, AEEEvent eCode, uint16 wParam, uint32 dwParam)
{
....
switch (eCode)
{
case EVT_NOTIFY:
ISHELL_StartApplet(pMe->pIShell, AEECLSID_PROBEAPP) ;
return(TRUE);
......
thanks a lot

ok, I try it and its resolved:
static boolean probeapp_HandleEvent(IApplet * pi, AEEEvent eCode, uint16 wParam, uint32 dwParam)
{
....
switch (eCode)
{
case EVT_NOTIFY:
ISHELL_StartApplet(pMe->pIShell, AEECLSID_PROBEAPP) ;
return(TRUE);
......
thanks a lot

I modifed MIF and try :
switch (eCode)
{
case EVT_NOTIFY:
ISHELL_StartApplet(pMe->pIShell, AEECLSID_PROBEAPP) ;
an it works with emulator, but when I try with the device, it not work:
1Q: When BREW gets initialized
2Q: I can configure something

I modifed MIF and try :
switch (eCode)
{
case EVT_NOTIFY:
ISHELL_StartApplet(pMe->pIShell, AEECLSID_PROBEAPP) ;
an it works with emulator, but when I try with the device, it not work:
1Q: When BREW gets initialized
2Q: I can configure something

I'm waiting on my test phone, so as of now I only have the emulator. I want to start an applet when the phone is turned on and immediately make a voice call. In my event handler I case on EVT_NOTIFY and handle the NMASK_SHELL_INIT notification. I can step through this code with the debugger and it is being hit, however it takes place before the emulator gui actually opens on my monitor. If the code is doing what I would expect, I would see a query as to whether I want to make the call on the screen, as well as a DBPRINTF() message on the output window. However, when the gui and output window open (after the code has been executed) the standard app screen is open and the call window doesn't contain the DBPRINTF(). Has anyone else seen this type of behavior, where the emulator lets very early events slip by?
Thanks for any help,
Rich

I'm waiting on my test phone, so as of now I only have the emulator. I want to start an applet when the phone is turned on and immediately make a voice call. In my event handler I case on EVT_NOTIFY and handle the NMASK_SHELL_INIT notification. I can step through this code with the debugger and it is being hit, however it takes place before the emulator gui actually opens on my monitor. If the code is doing what I would expect, I would see a query as to whether I want to make the call on the screen, as well as a DBPRINTF() message on the output window. However, when the gui and output window open (after the code has been executed) the standard app screen is open and the call window doesn't contain the DBPRINTF(). Has anyone else seen this type of behavior, where the emulator lets very early events slip by?
Thanks for any help,
Rich

I try to use ISHELL_OnInit(), and in the notify function to do that.
But it seems not working, and when I send a event to the class/applet from
another active applet such as press SELECT key, another instance of
that class/applet is created again, by adding some printing l ines in
AEEClsCreateInstance() and checking the output window.
So, what shall I do to reach my point?
Thx!

I try to use ISHELL_OnInit(), and in the notify function to do that.
But it seems not working, and when I send a event to the class/applet from
another active applet such as press SELECT key, another instance of
that class/applet is created again, by adding some printing l ines in
AEEClsCreateInstance() and checking the output window.
So, what shall I do to reach my point?
Thx!

In your MIF file add flag for power on signal. When your application gets loaded and receives notification, you need to call ISHELL_CloseApplet. In the EVT_APP_STOP event toggle the dwParam boolean value, this will put your application in background (there are couple threads on this forum where this was explained with code snippet). Background application cann't receive any key event and does not have any access to display.

In your MIF file add flag for power on signal. When your application gets loaded and receives notification, you need to call ISHELL_CloseApplet. In the EVT_APP_STOP event toggle the dwParam boolean value, this will put your application in background (there are couple threads on this forum where this was explained with code snippet). Background application cann't receive any key event and does not have any access to display.

Yes, I search all the forum, and know how to implement a background applet
and also how to set the flags in MIF when using ISHELL_OnInit()
But my question is how can I make a background work when power on and
can make it active when necessary?
Since the information I got from this forum is about BREW version < 3.0, and
now I use the 3.0.X SDK, I wonder if it will make some difference

Yes, I search all the forum, and know how to implement a background applet
and also how to set the flags in MIF when using ISHELL_OnInit()
But my question is how can I make a background work when power on and
can make it active when necessary?
Since the information I got from this forum is about BREW version < 3.0, and
now I use the 3.0.X SDK, I wonder if it will make some difference

At last, I succeeded . My method is the following:
1) Add Nofity Flags in MIF file:
AEECLSID_SHELL/NMASK_SHELL_INIT
value: 0x0000; //question: what this value means? when I change it to 0x1,
// it seems some wrong, and the program do not work as supposed
2) When receive EVT_NOTIFY event,
calling ISHELL_StartApplet() to start App
step1 tell BREW to load the module when it initializes, and send the applet a event when it finishes initialization.
step2 real start the Applet in ISHELL
So, there is no need to use ISHELL_OnInit();
Is this the correct way to do it?
BTW:
I can not figure out a scenario when ISHELL_RegisterSystemCallback() is used to register AEE_SCB_AEE_INIT, since no place to call ISHELL_RegisterSystemCallback() before or in BREW initialization, since this is not a callback funtion. So, is that type of event useful?

At last, I succeeded . My method is the following:
1) Add Nofity Flags in MIF file:
AEECLSID_SHELL/NMASK_SHELL_INIT
value: 0x0000; //question: what this value means? when I change it to 0x1,
// it seems some wrong, and the program do not work as supposed
2) When receive EVT_NOTIFY event,
calling ISHELL_StartApplet() to start App
step1 tell BREW to load the module when it initializes, and send the applet a event when it finishes initialization.
step2 real start the Applet in ISHELL
So, there is no need to use ISHELL_OnInit();
Is this the correct way to do it?
BTW:
I can not figure out a scenario when ISHELL_RegisterSystemCallback() is used to register AEE_SCB_AEE_INIT, since no place to call ISHELL_RegisterSystemCallback() before or in BREW initialization, since this is not a callback funtion. So, is that type of event useful?

1. Why do you have change the value of NMASK_SHELL_INIT? I am not sure what are you trying to achieve.
2. When BREW gets initialize BREW will call InitAPP funciton and provide you EVT_NOTIFY event, check for the correct flag (ie NMASK_SHELL_INIT) and then if you call ISHELL_StartApplet, your application will start in foreground/active application. You need to call ISHELL_CloseApplet to start in background.
This above mechanism will ensure that every time BREW gets initilized your app will start in background. If you need to bring your background app to foreground, call ISHELL_StartApplet.
Second method:
If you are using RegisterSystemCallback to register AEE_SCB_AEE_INIT, in that case you need to manually start your application at least once to get the desired result.

1. Why do you have change the value of NMASK_SHELL_INIT? I am not sure what are you trying to achieve.
2. When BREW gets initialize BREW will call InitAPP funciton and provide you EVT_NOTIFY event, check for the correct flag (ie NMASK_SHELL_INIT) and then if you call ISHELL_StartApplet, your application will start in foreground/active application. You need to call ISHELL_CloseApplet to start in background.
This above mechanism will ensure that every time BREW gets initilized your app will start in background. If you need to bring your background app to foreground, call ISHELL_StartApplet.
Second method:
If you are using RegisterSystemCallback to register AEE_SCB_AEE_INIT, in that case you need to manually start your application at least once to get the desired result.

Thanks a lot!
Since we can change the value in MIF file, why not change it ? and what is
usage of the value when setting NMASK_SHELL_INIT flags?
Still, I wonder whether ISHELL_RegisterSystemCallback() is called, the BREW is
already initialized, and if ISHELL_RegisterSystemCallback() can be called,
we know it is the time we can start our applet, so no need to register a
notify hook on AEE_SCB_AEE_INIT.
And the same with ISHELL_OnInit()
...
So, I am very confused and I wonder whether I missed something,
please help me to get the right point
Thanks

Thanks a lot!
Since we can change the value in MIF file, why not change it ? and what is
usage of the value when setting NMASK_SHELL_INIT flags?
Still, I wonder whether ISHELL_RegisterSystemCallback() is called, the BREW is
already initialized, and if ISHELL_RegisterSystemCallback() can be called,
we know it is the time we can start our applet, so no need to register a
notify hook on AEE_SCB_AEE_INIT.
And the same with ISHELL_OnInit()
...
So, I am very confused and I wonder whether I missed something,
please help me to get the right point
Thanks

Now, I can make background applet work when power on.
However, I still have a question:
If I have serveral background applets to startup when power on,
but they have to start according some sequence, so, the question
is how can I make the apps started in the supposed sequence?
One possible way maybe I do a event chain myself: Only the first app
calls StartApplet() when receiving EVT_NOTIFY of BREW ready, then
the first app responses to starting the second app, and so on.
But it seems a little complex, any better ways?

Now, I can make background applet work when power on.
However, I still have a question:
If I have serveral background applets to startup when power on,
but they have to start according some sequence, so, the question
is how can I make the apps started in the supposed sequence?
One possible way maybe I do a event chain myself: Only the first app
calls StartApplet() when receiving EVT_NOTIFY of BREW ready, then
the first app responses to starting the second app, and so on.
But it seems a little complex, any better ways?

Since you have started another thread on background app, it would have been better keep the discussion on that thread as this discussion is also of similar nature.
You have do the event chain on your own. It is rather simple, your first background app starts based on power on notification event, then you just call ISHELL_PostEvent for next background app and so on.

Since you have started another thread on background app, it would have been better keep the discussion on that thread as this discussion is also of similar nature.
You have do the event chain on your own. It is rather simple, your first background app starts based on power on notification event, then you just call ISHELL_PostEvent for next background app and so on.

Quote:
Since we can change the value in MIF file, why not change it ? and what is
usage of the value when setting NMASK_SHELL_INIT flags?
What are you trying to propose?
There are two ways to register for certain events, one via MIF file another via ISHELL_RegisterSystemCallback. Where is the confusion?

Quote:
Since we can change the value in MIF file, why not change it ? and what is
usage of the value when setting NMASK_SHELL_INIT flags?
What are you trying to propose?
There are two ways to register for certain events, one via MIF file another via ISHELL_RegisterSystemCallback. Where is the confusion?

Just for fun to change the value, I do not like thing that seems a mystery:-)
The document never gives any description of it.
About the second question, I just want to know, if that I use
ISHELL_RegisterSystemCallback() or ISHELL_OnInit() to register hook function,
which is called when BREW is ready, now where should I place the code to calling ISHELL_RegisterSystemCallback()/ISHELL_OnInit() in my source code of module?
And if there is some place to make ISHELL_OnInit() called, whether it is also
the right time that I can do the things which the hook function will do, since
system is ready now.
ruben wrote:What are you trying to propose?
There are two ways to register for certain events, one via MIF file another via ISHELL_RegisterSystemCallback. Where is the confusion?

Just for fun to change the value, I do not like thing that seems a mystery:-)
The document never gives any description of it.
About the second question, I just want to know, if that I use
ISHELL_RegisterSystemCallback() or ISHELL_OnInit() to register hook function,
which is called when BREW is ready, now where should I place the code to calling ISHELL_RegisterSystemCallback()/ISHELL_OnInit() in my source code of module?
And if there is some place to make ISHELL_OnInit() called, whether it is also
the right time that I can do the things which the hook function will do, since
system is ready now.
ruben wrote:What are you trying to propose?
There are two ways to register for certain events, one via MIF file another via ISHELL_RegisterSystemCallback. Where is the confusion?

Quote:
Just for fun to change the value, I do not like thing that seems a mystery:-)
The document never gives any description of it.
There is not much mystry in the MIF file event notification settings. BREW parses the MIF file sends notification based on the events value. If you setup some arbitrary value, BREW may not understand the value and nothing will happen (unless your abitrary value accidentally matches some predefined value).
It is upto your application requirement/objective. Without knowing your application design objective it would be difficult to provide any recommendation.

Quote:
Just for fun to change the value, I do not like thing that seems a mystery:-)
The document never gives any description of it.
There is not much mystry in the MIF file event notification settings. BREW parses the MIF file sends notification based on the events value. If you setup some arbitrary value, BREW may not understand the value and nothing will happen (unless your abitrary value accidentally matches some predefined value).
It is upto your application requirement/objective. Without knowing your application design objective it would be difficult to provide any recommendation.

So, why there is no document with the SDK to illustrate the proper value setting?
why keep the proper values in dark? Isn't it a mystery?
Why make it so uneasy to build a robust brew app? Since there are many details are not describled in public documents, the SDK user may
likely go into blackholes/traps and waste much time, which I do not think a good
things in competion with J2ME.
ruben wrote:There is not much mystry in the MIF file event notification settings. BREW parses the MIF file sends notification based on the events value. If you setup some arbitrary value, BREW may not understand the value and nothing will happen (unless your abitrary value accidentally matches some predefined value).
It is upto your application requirement/objective. Without knowing your application design objective it would be difficult to provide any recommendation.

So, why there is no document with the SDK to illustrate the proper value setting?
why keep the proper values in dark? Isn't it a mystery?
Why make it so uneasy to build a robust brew app? Since there are many details are not describled in public documents, the SDK user may
likely go into blackholes/traps and waste much time, which I do not think a good
things in competion with J2ME.
ruben wrote:There is not much mystry in the MIF file event notification settings. BREW parses the MIF file sends notification based on the events value. If you setup some arbitrary value, BREW may not understand the value and nothing will happen (unless your abitrary value accidentally matches some predefined value).
It is upto your application requirement/objective. Without knowing your application design objective it would be difficult to provide any recommendation.

Hi,
Is it possible to run an application in background when the phone starts. The background app is hidden (i.e. not visible to user). Pls in detail with revelent APIs in BREW SDK v 2.0
Thanks,
Jass

Hi,
Is it possible to run an application in background when the phone starts. The background app is hidden (i.e. not visible to user). Pls in detail with revelent APIs in BREW SDK v 2.0
Thanks,
Jass

You can register for NMASK_SHELL_INIT event in your MIF file. This event gets dispatched to the application when BREW gets initialized on power up. Handle EVT_NOTIFY event in your application event handler. This topic was discussed multiple times in these forums.

You can register for NMASK_SHELL_INIT event in your MIF file. This event gets dispatched to the application when BREW gets initialized on power up. Handle EVT_NOTIFY event in your application event handler. This topic was discussed multiple times in these forums.

I had checked thr forum eariler, but didnt find any thing relevent to this. I think I go to search again.
But thanks for ur reply
Jass

I had checked thr forum eariler, but didnt find any thing relevent to this. I think I go to search again.
But thanks for ur reply
Jass

Hello everyone,
I was wondering, is there any way to make a BREW application start running immediately when a phone is powered on without the user explicitly starting it?
Any help would be greatly appreciated.

Hello everyone,
I was wondering, is there any way to make a BREW application start running immediately when a phone is powered on without the user explicitly starting it?
Any help would be greatly appreciated.

Hello everyone,
I was wondering, is there any way to make a BREW application start running immediately when a phone is powered on without the user explicitly starting it?
Any help would be greatly appreciated.

Hello everyone,
I was wondering, is there any way to make a BREW application start running immediately when a phone is powered on without the user explicitly starting it?
Any help would be greatly appreciated.

Hello everyone,
I was wondering, is there any way to make a BREW application start running immediately when a phone is powered on without the user explicitly starting it?
Any help would be greatly appreciated.

Hello everyone,
I was wondering, is there any way to make a BREW application start running immediately when a phone is powered on without the user explicitly starting it?
Any help would be greatly appreciated.

One way of doing is to register for AEE_SCB_AEE_INIT event in your MIF file.

One way of doing is to register for AEE_SCB_AEE_INIT event in your MIF file.

Hello everyone,
I was wondering, is there any way to make a BREW application start running immediately when a phone is powered on without the user explicitly starting it?
Any help would be greatly appreciated.

Hello everyone,
I was wondering, is there any way to make a BREW application start running immediately when a phone is powered on without the user explicitly starting it?
Any help would be greatly appreciated.

Don't post same question in multiple forum. It is nothing but spam.

Don't post same question in multiple forum. It is nothing but spam.

spam message

spam message

Sorry, I was just trying to make it seen by the most people. Thank you for your answer in the other 3.x section though.

Sorry, I was just trying to make it seen by the most people. Thank you for your answer in the other 3.x section though.

Thank you very much, I will look into what you said.

Thank you very much, I will look into what you said.

Register for NMASK_SHELL_INIT. Call ISHELL_StartApplet() when you receive the notification.

Register for NMASK_SHELL_INIT. Call ISHELL_StartApplet() when you receive the notification.

Thank you. That is exactly what I was looking for. :)

Thank you. That is exactly what I was looking for. :)

In my app, in the mif file, I added a notification for AEECLSID_SHELL/NMASK_SHELL_INIT
According to the this post
http://brewforums.qualcomm.com/showthread.php?p=26222#post26222
I should get you an notification when Brew is done initializing.
So what method I write is handling the event? Is it AEEClsCreateInstance? Do I then call AEEApplet_New
and pass in the pointer to the function that gets the notify?
Or is it somewhere in the mif and I am just not seeing it.
When I test my app in the emulator it does not start until after 30 seconds or so after the emulator starts...
that does not seem correct.
Any advice or demo code would be greatly appreciated,
Thanks
Karl

In my app, in the mif file, I added a notification for AEECLSID_SHELL/NMASK_SHELL_INIT
According to the this post
http://brewforums.qualcomm.com/showthread.php?p=26222#post26222
I should get you an notification when Brew is done initializing.
So what method I write is handling the event? Is it AEEClsCreateInstance? Do I then call AEEApplet_New
and pass in the pointer to the function that gets the notify?
Or is it somewhere in the mif and I am just not seeing it.
When I test my app in the emulator it does not start until after 30 seconds or so after the emulator starts...
that does not seem correct.
Any advice or demo code would be greatly appreciated,
Thanks
Karl

The event is then sent to your event handler function. If you want to start the application, you'd need to call ISHELL_StartApplet().

The event is then sent to your event handler function. If you want to start the application, you'd need to call ISHELL_StartApplet().

you have register the event handler inside of
AEEClsCreateInstance with AEEApplet_New.
I have a simple DBGPRINTF statment at the top of the AEEClsCreateInstance .
It is not being called on power despite having that event in the mif.
thats what I dont get....

you have register the event handler inside of
AEEClsCreateInstance with AEEApplet_New.
I have a simple DBGPRINTF statment at the top of the AEEClsCreateInstance .
It is not being called on power despite having that event in the mif.
thats what I dont get....

Is it possible to somehow load a BREW app automatically when the phone is switched on or restarted? I need to create a background application which needs to work in the background as long as the phone is on.
Regards.
Deepak.

Is it possible to somehow load a BREW app automatically when the phone is switched on or restarted? I need to create a background application which needs to work in the background as long as the phone is on.
Regards.
Deepak.

You can listen for the NMASK_SHELL_INIT notification. But be careful, because if your app is buggy and crashes, you're likely to ruin your handset (as the device powers on and your app crashes over and over again).

You can listen for the NMASK_SHELL_INIT notification. But be careful, because if your app is buggy and crashes, you're likely to ruin your handset (as the device powers on and your app crashes over and over again).

Instead starting your app immediately you may want to wait for couple of minutes and then start (at least during development phase) this way you can avoid the problem mentioned by Nathan.

Instead starting your app immediately you may want to wait for couple of minutes and then start (at least during development phase) this way you can avoid the problem mentioned by Nathan.

In Brew, I'm trying to do some automated testing. Is there away to select an application automatically as soon as BREW is started?
Thanks

In Brew, I'm trying to do some automated testing. Is there away to select an application automatically as soon as BREW is started?
Thanks

You can launch an app automatically when the phone is powered on, by registering for the NMASK_SHELL_INIT notification, but this is not recommended.
You could also launch an app by sending a startup command over the serial port using standard AT command syntax.
Lastly, there is the new BREW Tools Interface Layer, supported on BREW 3.1.4 devices and higher, which would allow you to do some pretty sophisticated automated testing. But of course, that will require you to wait until some actual BREW 3.1.4 devices become available.

You can launch an app automatically when the phone is powered on, by registering for the NMASK_SHELL_INIT notification, but this is not recommended.
You could also launch an app by sending a startup command over the serial port using standard AT command syntax.
Lastly, there is the new BREW Tools Interface Layer, supported on BREW 3.1.4 devices and higher, which would allow you to do some pretty sophisticated automated testing. But of course, that will require you to wait until some actual BREW 3.1.4 devices become available.

How do I register this mask?
THanks.

How do I register this mask?
THanks.

In the MIF Editor, click on the "Notifications, Flags, Settings..." button.

In the MIF Editor, click on the "Notifications, Flags, Settings..." button.

First, be very careful when doing this on a handset. If your applet causes it to crash, then you'll get into a failure loop when it restarts. Test it *thoroughly* as a manually started applet before attempting to auto-start it.
Here's the sequence of events:
When BREW starts up, it will send your applet a notification event. It knows that your applet hasn't been created yet, so first it calls your AEEClsCreateInstance() function. In your AEEClsCreateInstance(), call AEEApplet_New as normal to allocate storage for your applet data and register your event handler.
You'll then receive a call to your registered event handler with an AEEEvent of EVT_NOTIFY, and a dwParam that represents a pointer to an AEENotify structure with a cls of AEECLSID_SHELL and a dwMask of NMASK_SHELL_INIT. Just handle this event as you would any other.
Note that despite receiving this event, your applet isn't yet started or active. If you want it to become active, call ISHELL_StartApplet with your applet's own clsID (applet.clsID), or ISHELL_StartAppletEx with a flag of SSA_BACKGROUND to start it in the background (in the latter case, you'll receive an event of EVT_APP_START_BACKGROUND instead of EVT_APP_START).
This is how it should and does work on the emulator, but I'm not getting the notification on startup on an Audiovox 8940, so your milage may vary.

First, be very careful when doing this on a handset. If your applet causes it to crash, then you'll get into a failure loop when it restarts. Test it *thoroughly* as a manually started applet before attempting to auto-start it.
Here's the sequence of events:
When BREW starts up, it will send your applet a notification event. It knows that your applet hasn't been created yet, so first it calls your AEEClsCreateInstance() function. In your AEEClsCreateInstance(), call AEEApplet_New as normal to allocate storage for your applet data and register your event handler.
You'll then receive a call to your registered event handler with an AEEEvent of EVT_NOTIFY, and a dwParam that represents a pointer to an AEENotify structure with a cls of AEECLSID_SHELL and a dwMask of NMASK_SHELL_INIT. Just handle this event as you would any other.
Note that despite receiving this event, your applet isn't yet started or active. If you want it to become active, call ISHELL_StartApplet with your applet's own clsID (applet.clsID), or ISHELL_StartAppletEx with a flag of SSA_BACKGROUND to start it in the background (in the latter case, you'll receive an event of EVT_APP_START_BACKGROUND instead of EVT_APP_START).
This is how it should and does work on the emulator, but I'm not getting the notification on startup on an Audiovox 8940, so your milage may vary.

I have a question on applets launched at startup. In particular I am trying to figure out how they interact with a phone's "regular" (main/idle screen) UI.
I have my applet configured to start up at powerup, using the technique of having the applet registered for NMASK_SHELL_INIT and having it launch itself using ISHELL_StartApplet when it receives EVT_NOTIFY of the correct flavor - class ID of event is AEECLSID_SHELL and dwMask has the NMASK_SHELL_INIT.
When I power up the phone (Samsung a890), my applet is started, and I can see it draw to the screen - simple text rendering during EVT_APP_START. So far so good.
But then the phone renders its idle screen, without sending any more events to my applet. I log all events to a file, but I'm not seeing any suspend events or anything else. Just the initial call to AEEClsCreateInstance, the EVT_NOTIFY, and the EVT_APP_START.
My applet is still running, and the consumer of events like EVT_KEY. So if I draw things later or process events, all is fine. But I'd like for my applet to know when the phone has completely started up and drawn its idle screen, so I can defer deciding if I need to render anything or if I should just exit, to a time well after the idle screen comes up. Or I'd like to be able to keep control of the screen until the user exits my app or my app decides it's time to quit.
So... does anyone know how the startup of BREW interacts with the regular phone UI startup? Or a way I can detect / control this so I can make the user experience good, without an annoying flicker of the idle screen.
("Idle screen" in this context means the root-level screen that shows the user's wallpaper and a "Menu" / "Contacts" pair of softkeys on the device)
OOPS - just realized this is in the BREW 2.0 forum, but I'm developing under 2.1.3 and targeting 2.1.3 devices.

I have a question on applets launched at startup. In particular I am trying to figure out how they interact with a phone's "regular" (main/idle screen) UI.
I have my applet configured to start up at powerup, using the technique of having the applet registered for NMASK_SHELL_INIT and having it launch itself using ISHELL_StartApplet when it receives EVT_NOTIFY of the correct flavor - class ID of event is AEECLSID_SHELL and dwMask has the NMASK_SHELL_INIT.
When I power up the phone (Samsung a890), my applet is started, and I can see it draw to the screen - simple text rendering during EVT_APP_START. So far so good.
But then the phone renders its idle screen, without sending any more events to my applet. I log all events to a file, but I'm not seeing any suspend events or anything else. Just the initial call to AEEClsCreateInstance, the EVT_NOTIFY, and the EVT_APP_START.
My applet is still running, and the consumer of events like EVT_KEY. So if I draw things later or process events, all is fine. But I'd like for my applet to know when the phone has completely started up and drawn its idle screen, so I can defer deciding if I need to render anything or if I should just exit, to a time well after the idle screen comes up. Or I'd like to be able to keep control of the screen until the user exits my app or my app decides it's time to quit.
So... does anyone know how the startup of BREW interacts with the regular phone UI startup? Or a way I can detect / control this so I can make the user experience good, without an annoying flicker of the idle screen.
("Idle screen" in this context means the root-level screen that shows the user's wallpaper and a "Menu" / "Contacts" pair of softkeys on the device)
OOPS - just realized this is in the BREW 2.0 forum, but I'm developing under 2.1.3 and targeting 2.1.3 devices.

This is an interesting thread, I'm also trying to create an auto starting background apps. But because the risk involved (hp crashing), does anyone with experience can give us some snippet on implementing the NMASK_SHELL_INIT notification, also how to delay it for a few minutes after the phone starting up??
Thx for the reply.

This is an interesting thread, I'm also trying to create an auto starting background apps. But because the risk involved (hp crashing), does anyone with experience can give us some snippet on implementing the NMASK_SHELL_INIT notification, also how to delay it for a few minutes after the phone starting up??
Thx for the reply.

You should register for events under the advances tab of the MIF editor. Clisk "add" under "Notifications".
To start an applicaiton on init do the following:
case EVT_NOTIFY:
{
AEENotify *not = (AEENotify *)dwParam;
if((not->dwMask == NMASK_SHELL_INIT))
{
if(SUCCESS != ISHELL_StartBackgroundApplet(pMe->pIShell, AEECLSID_MYCLASS, NULL))
DBGPRINTF("***ISHELL_StartBackgroundApplet() failed");
return TRUE;
}
}
To delay the application from starting immediately, set an alarm on initialization and start the app after the alarm has expired.

You should register for events under the advances tab of the MIF editor. Clisk "add" under "Notifications".
To start an applicaiton on init do the following:
case EVT_NOTIFY:
{
AEENotify *not = (AEENotify *)dwParam;
if((not->dwMask == NMASK_SHELL_INIT))
{
if(SUCCESS != ISHELL_StartBackgroundApplet(pMe->pIShell, AEECLSID_MYCLASS, NULL))
DBGPRINTF("***ISHELL_StartBackgroundApplet() failed");
return TRUE;
}
}
To delay the application from starting immediately, set an alarm on initialization and start the app after the alarm has expired.

Hi all,
I am trying to implement this functionality and have a couple of questions...
First, is this supported in the emulator? I would love to be able to get it to work on the emulator before trying it on a real device, but so far it doesn't appear to be working. I want to know if it is worth my time to continue trying getting it to work on the emulator.
Second, there seem to be a number of ways of potentially doing this. Are there any real differences among the following?
1: The stated way... (Register for SHELL_INIT in the mif file and process the EVT_NOTIFY event. I assume that handling EVT_NOTIFY is done in the HandleEvent subrouting of the Applet.)
2: Instead of registering in the MIF file, use ISHELL_RegisterNotify() in the code itself. What is the actual difference between this and the previous? Does this call actually change the mif file?
3: Use ISHELL_RegisterSystemCallback() on the type AEE_SCB_AEE_INIT. I've not tried this one -- what does it do differently than the previous two?
Cheers,
Dave

Hi all,
I am trying to implement this functionality and have a couple of questions...
First, is this supported in the emulator? I would love to be able to get it to work on the emulator before trying it on a real device, but so far it doesn't appear to be working. I want to know if it is worth my time to continue trying getting it to work on the emulator.
Second, there seem to be a number of ways of potentially doing this. Are there any real differences among the following?
1: The stated way... (Register for SHELL_INIT in the mif file and process the EVT_NOTIFY event. I assume that handling EVT_NOTIFY is done in the HandleEvent subrouting of the Applet.)
2: Instead of registering in the MIF file, use ISHELL_RegisterNotify() in the code itself. What is the actual difference between this and the previous? Does this call actually change the mif file?
3: Use ISHELL_RegisterSystemCallback() on the type AEE_SCB_AEE_INIT. I've not tried this one -- what does it do differently than the previous two?
Cheers,
Dave

hyperdex wrote:
First, is this supported in the emulator? I would love to be able to get it to work on the emulator before trying it on a real device, but so far it doesn't appear to be working. I want to know if it is worth my time to continue trying getting it to work on the emulator.
Yes it is supported.
hyperdex wrote:
Second, there seem to be a number of ways of potentially doing this. Are there any real differences among the following?
1: The stated way... (Register for SHELL_INIT in the mif file and process the EVT_NOTIFY event. I assume that handling EVT_NOTIFY is done in the HandleEvent subrouting of the Applet.)
2: Instead of registering in the MIF file, use ISHELL_RegisterNotify() in the code itself. What is the actual difference between this and the previous? Does this call actually change the mif file?
3: Use ISHELL_RegisterSystemCallback() on the type AEE_SCB_AEE_INIT. I've not tried this one -- what does it do differently than the previous two?
Only the first method will work. Notifications through ISHELL_RegisterNotify are not persistant through powercycles.

hyperdex wrote:
First, is this supported in the emulator? I would love to be able to get it to work on the emulator before trying it on a real device, but so far it doesn't appear to be working. I want to know if it is worth my time to continue trying getting it to work on the emulator.
Yes it is supported.
hyperdex wrote:
Second, there seem to be a number of ways of potentially doing this. Are there any real differences among the following?
1: The stated way... (Register for SHELL_INIT in the mif file and process the EVT_NOTIFY event. I assume that handling EVT_NOTIFY is done in the HandleEvent subrouting of the Applet.)
2: Instead of registering in the MIF file, use ISHELL_RegisterNotify() in the code itself. What is the actual difference between this and the previous? Does this call actually change the mif file?
3: Use ISHELL_RegisterSystemCallback() on the type AEE_SCB_AEE_INIT. I've not tried this one -- what does it do differently than the previous two?
Only the first method will work. Notifications through ISHELL_RegisterNotify are not persistant through powercycles.

Dear all
I am developing an application which needs to start on handset power on. I have registered the NMASK_SHELL_INIT and AEECLSID_SHELL in the mif. App works fine on the emulator. But when I test it on handset(kyocera), the app gets launched when pwered on, but the app screen disappears and the phone's main screen comes in few secods. I dont want the app to go to backgound on launch as I want user input on the screen. So I did not set dwParam to false in EVT_APP_STOP. App works fine on emulator, but has the above problem on the handset. Need ur help in solving this.
thanks in advance.

Dear all
I am developing an application which needs to start on handset power on. I have registered the NMASK_SHELL_INIT and AEECLSID_SHELL in the mif. App works fine on the emulator. But when I test it on handset(kyocera), the app gets launched when pwered on, but the app screen disappears and the phone's main screen comes in few secods. I dont want the app to go to backgound on launch as I want user input on the screen. So I did not set dwParam to false in EVT_APP_STOP. App works fine on emulator, but has the above problem on the handset. Need ur help in solving this.
thanks in advance.

Jonathan,
My app is supposed to get started when upon an incoming call. So, when using emulator 2.1.0 and 3.x, the boot app gets started when there is an incoming call and the real app is started by the boot app using ISHELL_StartApplet...
Problem is...the entire emulator goes into SUSPENDED state...QUE?
So, I am about to test the code on a few phones, but it would be nice to know if the emulators (2.1.0 and 3.x) support TAPI incoming call starting of an application?
By stepping through debug, I know the boot app and the real app do get started upon an incoming call, but alas, the emulator goes into a Suspended state...
Thank-you
:)
Jonathan wrote:Yes it is supported.
Only the first method will work. Notifications through ISHELL_RegisterNotify are not persistant through powercycles.

Jonathan,
My app is supposed to get started when upon an incoming call. So, when using emulator 2.1.0 and 3.x, the boot app gets started when there is an incoming call and the real app is started by the boot app using ISHELL_StartApplet...
Problem is...the entire emulator goes into SUSPENDED state...QUE?
So, I am about to test the code on a few phones, but it would be nice to know if the emulators (2.1.0 and 3.x) support TAPI incoming call starting of an application?
By stepping through debug, I know the boot app and the real app do get started upon an incoming call, but alas, the emulator goes into a Suspended state...
Thank-you
:)
Jonathan wrote:Yes it is supported.
Only the first method will work. Notifications through ISHELL_RegisterNotify are not persistant through powercycles.

Yes, this is supported, but you'll need to put the application in the background. You can not take control of the display while the application is in the background. You can not be in the foreground during an incoming call.

Yes, this is supported, but you'll need to put the application in the background. You can not take control of the display while the application is in the background. You can not be in the foreground during an incoming call.

Jonathan wrote:Yes, this is supported, but you'll need to put the application in the background. You can not take control of the display while the application is in the background. You can not be in the foreground during an incoming call.
What happens when there are multiple apps that need to get started upon a power up? Will all of them get notified? What happens if all of the apps need to grab the display upon getting the INIT notification?
Thank-you!
BI

Jonathan wrote:Yes, this is supported, but you'll need to put the application in the background. You can not take control of the display while the application is in the background. You can not be in the foreground during an incoming call.
What happens when there are multiple apps that need to get started upon a power up? Will all of them get notified? What happens if all of the apps need to grab the display upon getting the INIT notification?
Thank-you!
BI

Multiple apps can get the init event. If the multiple apps are foreground apps (i.e. use display) then the apps should all start, but as an application starts, it will suspend the currently running app. So only one app can be in the foreground at one time. You can't determine which application will start last (be in the foregound).
Background apps will not suspend, but can't use the display.

Multiple apps can get the init event. If the multiple apps are foreground apps (i.e. use display) then the apps should all start, but as an application starts, it will suspend the currently running app. So only one app can be in the foreground at one time. You can't determine which application will start last (be in the foregound).
Background apps will not suspend, but can't use the display.

Hello Everyone there,
I too find this thread an interesting one. I am also working with an application in which i can give alarm based trigger.
What happens is through one of the applications we are allowed to set the trigger time. And another application should be triggerred everyday at this particular time.To accomplish this i need to start a background applet to check the trigger time .
Now since i m working in 2.0 , i know there is no such ISHELL_StartBackgroundApplet() .Is there any way to create a background applet in BREW 2.0 since, ISHELL_StartBackgroundApplet isnt supported for 2.0 version.
Or can anyone tell me a more better way to accomplish the mentioned functionality.
Hoping for a good support..

Hello Everyone there,
I too find this thread an interesting one. I am also working with an application in which i can give alarm based trigger.
What happens is through one of the applications we are allowed to set the trigger time. And another application should be triggerred everyday at this particular time.To accomplish this i need to start a background applet to check the trigger time .
Now since i m working in 2.0 , i know there is no such ISHELL_StartBackgroundApplet() .Is there any way to create a background applet in BREW 2.0 since, ISHELL_StartBackgroundApplet isnt supported for 2.0 version.
Or can anyone tell me a more better way to accomplish the mentioned functionality.
Hoping for a good support..

Thanks Jonathon.
The doc that you mentioned about workd for me .
But theres another query coming up.Say there are two apps- App1 & App2 ,where App2 is the background applet.
What I have done is
1) From App1 I have called App2 by ISHELL_Start Applet(pshell,App2);
2) In the EVT_APP_START of App2 i have called the function associated with App2 and immediately sent the EVt_App_Stop event to App2 as follows:
case EVT_APP_START:
StartAlarmTimer(pMe)
ISHELL_SendEvent(pIShell,APP1,EVT_APP_RESUME,wParam,dwParam); ISHELL_CloseApplet(pMe->m_Applet.m_pIShell, FALSE);
return TRUE;
Since i want that as soon as my app2 goes in the abckgorund i should be able to get back to APP1. For the same i had posted EVT_APP_RESUME event fromAPP2 to App1 .
As is mentioned in the doc, to set the wParam to FALSe while closing the application to send App2 in the background, have done the same
case EVT_APP_STOP:
*((boolean*) dwParam) = FALSE;
return TRUE;
But after this i get a blank screen .How do i revert back to App1 as soon as i have started APP2.Just to mention,There is no display associated with APP2 and.And theres a display function immediately called after ISHELL_Start Applet(pshell,App2) in App1.
Pls suggest.
Thanks

Thanks Jonathon.
The doc that you mentioned about workd for me .
But theres another query coming up.Say there are two apps- App1 & App2 ,where App2 is the background applet.
What I have done is
1) From App1 I have called App2 by ISHELL_Start Applet(pshell,App2);
2) In the EVT_APP_START of App2 i have called the function associated with App2 and immediately sent the EVt_App_Stop event to App2 as follows:
case EVT_APP_START:
StartAlarmTimer(pMe)
ISHELL_SendEvent(pIShell,APP1,EVT_APP_RESUME,wParam,dwParam); ISHELL_CloseApplet(pMe->m_Applet.m_pIShell, FALSE);
return TRUE;
Since i want that as soon as my app2 goes in the abckgorund i should be able to get back to APP1. For the same i had posted EVT_APP_RESUME event fromAPP2 to App1 .
As is mentioned in the doc, to set the wParam to FALSe while closing the application to send App2 in the background, have done the same
case EVT_APP_STOP:
*((boolean*) dwParam) = FALSE;
return TRUE;
But after this i get a blank screen .How do i revert back to App1 as soon as i have started APP2.Just to mention,There is no display associated with APP2 and.And theres a display function immediately called after ISHELL_Start Applet(pshell,App2) in App1.
Pls suggest.
Thanks

First, remove the ISHELL_SendEvent from EVT_APP_START from APP_2. Next, Put a display update in EVT_APP_RESUME in APP_1. In general, an application should always update the screen when it is resumed.

First, remove the ISHELL_SendEvent from EVT_APP_START from APP_2. Next, Put a display update in EVT_APP_RESUME in APP_1. In general, an application should always update the screen when it is resumed.

I had already taken care of calling IDISPLAY_Update in the EVT_APP_RESUME of App1.I had tried removing the ISHELL_Send Event from EVT_APP_START of App2, but it is still showing the blank screen.
I had tried debugging the same also.I noticed that though EVT_APP_SUSPEND is getting called , when i call IShell_StartApplet from App1 , but after closing the APP2(sending it to backgroud), EVT_APP_RESUME of App1 is not getting called.
Do i need to add sumthing else also?
Thanks

I had already taken care of calling IDISPLAY_Update in the EVT_APP_RESUME of App1.I had tried removing the ISHELL_Send Event from EVT_APP_START of App2, but it is still showing the blank screen.
I had tried debugging the same also.I noticed that though EVT_APP_SUSPEND is getting called , when i call IShell_StartApplet from App1 , but after closing the APP2(sending it to backgroud), EVT_APP_RESUME of App1 is not getting called.
Do i need to add sumthing else also?
Thanks

Are you returning TRUE to EVT_APP_SUSPEND? DOes APP1 ever receive EVT_APP_STOP?
Can I see your code in EVT_APP_RESUME? Are you calling any IDISPLAY_ functions before calling Update? You'll need to draw something to the screen before IDISPLAY_Update, otherwise you'll get a blank screen.

Are you returning TRUE to EVT_APP_SUSPEND? DOes APP1 ever receive EVT_APP_STOP?
Can I see your code in EVT_APP_RESUME? Are you calling any IDISPLAY_ functions before calling Update? You'll need to draw something to the screen before IDISPLAY_Update, otherwise you'll get a blank screen.

Jonathan wrote:Are you returning TRUE to EVT_APP_SUSPEND? DOes APP1 ever receive EVT_APP_STOP?.
Yah certainly I m returning TRUE after releasing the BREW controls on EVT_APP_SUSPEND.
Eventually , when i try to terminate the application,the application receives EVT_APP_STOP
Jonathan wrote:Can I see your code in EVT_APP_RESUME? Are you calling any IDISPLAY_ functions before calling Update? You'll need to draw something to the screen before IDISPLAY_Update, otherwise you'll get a blank screen.
Yah certainly i had drawn an image in EVT_RESUME. Just to mention , in other cases when we try to ssupend and resume the application manually ,the suspend/resume code works functionally well.
Heres My code Snippet of APP1:
case EVT_APP_SUSPEND:
ReleaseMenuCtl(pMe);
IDISPLAY_ClearScreen(pMe->m_applet.m_pIDisplay);
IDISPLAY_Update(pMe->m_Applet.m_pIDisplay);
return TRUE;
case EVT_APP_RESUME:
DrawMenuCtrl(pMe);
IIMAGE_Draw(pMe->m_pImgIcon,0,20);
IDISPLAY_Update(pMe->m_Applet.m_pIDisplay);
return TRUE;
Thanks

Jonathan wrote:Are you returning TRUE to EVT_APP_SUSPEND? DOes APP1 ever receive EVT_APP_STOP?.
Yah certainly I m returning TRUE after releasing the BREW controls on EVT_APP_SUSPEND.
Eventually , when i try to terminate the application,the application receives EVT_APP_STOP
Jonathan wrote:Can I see your code in EVT_APP_RESUME? Are you calling any IDISPLAY_ functions before calling Update? You'll need to draw something to the screen before IDISPLAY_Update, otherwise you'll get a blank screen.
Yah certainly i had drawn an image in EVT_RESUME. Just to mention , in other cases when we try to ssupend and resume the application manually ,the suspend/resume code works functionally well.
Heres My code Snippet of APP1:
case EVT_APP_SUSPEND:
ReleaseMenuCtl(pMe);
IDISPLAY_ClearScreen(pMe->m_applet.m_pIDisplay);
IDISPLAY_Update(pMe->m_Applet.m_pIDisplay);
return TRUE;
case EVT_APP_RESUME:
DrawMenuCtrl(pMe);
IIMAGE_Draw(pMe->m_pImgIcon,0,20);
IDISPLAY_Update(pMe->m_Applet.m_pIDisplay);
return TRUE;
Thanks

Hmm...your code looks fine to me. Is this on the Emulator or a device? Can you put a debug statement in the EVT_APP_RESUME/EVT_APP_SUSPEND to be sure these events are being received?
I'll try to take a closer look sometime today.

Hmm...your code looks fine to me. Is this on the Emulator or a device? Can you put a debug statement in the EVT_APP_RESUME/EVT_APP_SUSPEND to be sure these events are being received?
I'll try to take a closer look sometime today.

So far I have been trying the same to work successfully on the emulator, as i came to know that background applications function well on the Emulator.
I had tried debugging and as I mentioned in my last thread also, when the background applet(App2) is getting called by IShell_StartApplet() the APP1 receives an EVT_APP_SUSPEND event , it never receives the EVT_APP_RESUME.
And since there is no display associated with the background application, once the application APP2 is sent to the background, i get a blank screen appearing.
Lemme know if I am mising out sumthing.
Thanks,

So far I have been trying the same to work successfully on the emulator, as i came to know that background applications function well on the Emulator.
I had tried debugging and as I mentioned in my last thread also, when the background applet(App2) is getting called by IShell_StartApplet() the APP1 receives an EVT_APP_SUSPEND event , it never receives the EVT_APP_RESUME.
And since there is no display associated with the background application, once the application APP2 is sent to the background, i get a blank screen appearing.
Lemme know if I am mising out sumthing.
Thanks,

Hi.
I am trying to launch my application at device power on.
I got this article on the forum http://brewforums.qualcomm.com/show...26222#post26222
, which defines some steps to launch the application at startup.
I had made the following changes to my project:
1. Changed the mif file to add Notifier : AEECLSID_SHELL and Mask : NMASK_SHELL_INIT
2. Added the following lines to me project file under HandleEvent()
case EVT_NOTIFY:
DBGPRINTF("Received EVT_NOTIFY event - Launching Test App");
AEENotify* ns = (AEENotify *)dwParam;
if(NMASK_SHELL_INIT == ns->dwMask)
ISHELL_StartApplet(pMe->a.m_pIShell, pMe->a.clsID);
return(TRUE);
case EVT_APP_START:
DBGPRINTF("Received EVT_APP_START event - Starting Test App");
ISHELL_MessageBoxText(pMe->a.m_pIShell, pTitle, pText);
return(TRUE);
When I run the same code on the Simulator, everything seems to be working fine.
But as soon as I flash the mod file to the device, things don't work as desired.
I guess, EVT_NOTIFY is called, because I am not able to launch the application manually. But the dialog is never shown and nothing happens thereafter.
Please do let me know if I am missing on something.
With Regards,
Gautam Adlakha.

Hi.
I am trying to launch my application at device power on.
I got this article on the forum http://brewforums.qualcomm.com/show...26222#post26222
, which defines some steps to launch the application at startup.
I had made the following changes to my project:
1. Changed the mif file to add Notifier : AEECLSID_SHELL and Mask : NMASK_SHELL_INIT
2. Added the following lines to me project file under HandleEvent()
case EVT_NOTIFY:
DBGPRINTF("Received EVT_NOTIFY event - Launching Test App");
AEENotify* ns = (AEENotify *)dwParam;
if(NMASK_SHELL_INIT == ns->dwMask)
ISHELL_StartApplet(pMe->a.m_pIShell, pMe->a.clsID);
return(TRUE);
case EVT_APP_START:
DBGPRINTF("Received EVT_APP_START event - Starting Test App");
ISHELL_MessageBoxText(pMe->a.m_pIShell, pTitle, pText);
return(TRUE);
When I run the same code on the Simulator, everything seems to be working fine.
But as soon as I flash the mod file to the device, things don't work as desired.
I guess, EVT_NOTIFY is called, because I am not able to launch the application manually. But the dialog is never shown and nothing happens thereafter.
Please do let me know if I am missing on something.
With Regards,
Gautam Adlakha.

Hi.
I am writing an application which created a new PDP connection at startup.
This means that I need to launch the application once the phone had finished SIM reading and reading profile information.
I need to start my application at phone startup, but as it creates a new PDP connection, it needs to start after a certain set of operations are completed by the device.
Thus I can't use NMASK_SHELL_INIT event to launch my application.
Can anyone please guide me as to which even I can use so as to achieve this task.
Regards,
Gautam Adlakha.

Hi.
I am writing an application which created a new PDP connection at startup.
This means that I need to launch the application once the phone had finished SIM reading and reading profile information.
I need to start my application at phone startup, but as it creates a new PDP connection, it needs to start after a certain set of operations are completed by the device.
Thus I can't use NMASK_SHELL_INIT event to launch my application.
Can anyone please guide me as to which even I can use so as to achieve this task.
Regards,
Gautam Adlakha.

Hi friends,
I am writing an application which has to start automatically when the device is started. I found a procedure to do so from BREW forums.. The procedure is like we have to modify the mif by adding notifications for AEECLSID_SHELL. The mask value will be NMASK_SHELL_INIT. And we need to look for the event EVT_NOTIFY. Please look at the following code snippet...
case EVT_NOTIFY:
{
AEENotify *not = (AEENotify *)dwParam;
if((not->dwMask == NMASK_SHELL_INIT))
{
ret = ISHELL_StartApplet(pMe->m_pIShell, pMe->m_clsID);
ISHELL_CloseApplet(pMe->m_pIShell, FALSE);
return TRUE;
}
}
I tested this on simulator first. It worked fine. But it is not working on the device. Can anybody tell where i am going wrong?
Thanks & Regards,
Sunil Kumar

Hi friends,
I am writing an application which has to start automatically when the device is started. I found a procedure to do so from BREW forums.. The procedure is like we have to modify the mif by adding notifications for AEECLSID_SHELL. The mask value will be NMASK_SHELL_INIT. And we need to look for the event EVT_NOTIFY. Please look at the following code snippet...
case EVT_NOTIFY:
{
AEENotify *not = (AEENotify *)dwParam;
if((not->dwMask == NMASK_SHELL_INIT))
{
ret = ISHELL_StartApplet(pMe->m_pIShell, pMe->m_clsID);
ISHELL_CloseApplet(pMe->m_pIShell, FALSE);
return TRUE;
}
}
I tested this on simulator first. It worked fine. But it is not working on the device. Can anybody tell where i am going wrong?
Thanks & Regards,
Sunil Kumar

ret = ISHELL_StartApplet(pMe->m_pIShell, pMe->m_clsID);
ISHELL_CloseApplet(pMe->m_pIShell, FALSE);
Just out of curiosity, what are you trying to accomplish with that?

ret = ISHELL_StartApplet(pMe->m_pIShell, pMe->m_clsID);
ISHELL_CloseApplet(pMe->m_pIShell, FALSE);
Just out of curiosity, what are you trying to accomplish with that?

Hi,
I was doing some r&d work on Background applications. It was some where written that we have to exit the current application to start a new application. I want to start the app automatically on power-up. I think you can see my previous post to see wht i hav done. May be the 2nd line is not good there..I was doing some r&d work. Please suggest ur valuable ideas to run my app automatically on power-up...
Thanks for ur reply..
Sunil

Hi,
I was doing some r&d work on Background applications. It was some where written that we have to exit the current application to start a new application. I want to start the app automatically on power-up. I think you can see my previous post to see wht i hav done. May be the 2nd line is not good there..I was doing some r&d work. Please suggest ur valuable ideas to run my app automatically on power-up...
Thanks for ur reply..
Sunil

From your EVT_NOTIFY event, call ISHELL_CloseApplet(pMe->m_pIShell, FALSE);, don't Call ISHELL_StartApplet(pMe->m_pIShell, pMe->m_clsID);
In your EVT_APP_STOP event, toggle *((boolean*)dwParam) = FALSE; and that would place your application in background.

From your EVT_NOTIFY event, call ISHELL_CloseApplet(pMe->m_pIShell, FALSE);, don't Call ISHELL_StartApplet(pMe->m_pIShell, pMe->m_clsID);
In your EVT_APP_STOP event, toggle *((boolean*)dwParam) = FALSE; and that would place your application in background.

Hi Ruben,
I am not trying to send my app to background. Instead I want to make it as an active application on start-up..On power-up it has to start automatically.. I guess your suggestion will send the application to background...
Thanks & regards,
Sunil

Hi Ruben,
I am not trying to send my app to background. Instead I want to make it as an active application on start-up..On power-up it has to start automatically.. I guess your suggestion will send the application to background...
Thanks & regards,
Sunil

Get rid of the call to ISHELL_CloseApplet() and try it out.

Get rid of the call to ISHELL_CloseApplet() and try it out.

Thanx a lot mohlendo,
No luck again..There is no change in the behaviour. I am getting the EVT_NOTIFY Event from the Shell. As soon as ISHELL_StartApplet is executed it is calling APPData_FREE..Cracking my head from past 2 days...Plz help me.
Thanx in advance,
Sunil

Thanx a lot mohlendo,
No luck again..There is no change in the behaviour. I am getting the EVT_NOTIFY Event from the Shell. As soon as ISHELL_StartApplet is executed it is calling APPData_FREE..Cracking my head from past 2 days...Plz help me.
Thanx in advance,
Sunil

ret = ISHELL_StartApplet(pMe->m_pIShell, pMe->m_clsID);
You need to check the return value of ret.
You also need to debug to confirm that pMe->m_clsID has the correct value when this function is being called.

ret = ISHELL_StartApplet(pMe->m_pIShell, pMe->m_clsID);
You need to check the return value of ret.
You also need to debug to confirm that pMe->m_clsID has the correct value when this function is being called.

Hi All,
I am developing application which has to be started on the power on of device I have added Notifier : AEECLSID_SHELL and Mask : NMASK_SHELL_INIT in mif
In the code i am handling the EVT_NOTIFY as:
case EVT_NOTIFY:
[INDENT]AEENotify *not = (AEENotify *)dwParam;
if((not->dwMask == NMASK_SHELL_INIT))
{
ISHELL_StartApplet(pMe->m_pIShell, pMe->m_clsID);
DBGPRINTF("Received EVT_NOTIFY event - Launching App");
// Writing some text into a text file (.dat file) -> Sucessfully.
return(TRUE);
}[/INDENT]
When I run this on Emulator it works fine, But on the device it receives the Notification and wrting some text into the .dat file even then its not launching the application. Im trying this on LG 6335 device. After executing IShell_StartApplet & writing the text to a file it is exiting .....
Can anybody tell whats going wrong here?
Thankz,
Sunil

Hi All,
I am developing application which has to be started on the power on of device I have added Notifier : AEECLSID_SHELL and Mask : NMASK_SHELL_INIT in mif
In the code i am handling the EVT_NOTIFY as:
case EVT_NOTIFY:
[INDENT]AEENotify *not = (AEENotify *)dwParam;
if((not->dwMask == NMASK_SHELL_INIT))
{
ISHELL_StartApplet(pMe->m_pIShell, pMe->m_clsID);
DBGPRINTF("Received EVT_NOTIFY event - Launching App");
// Writing some text into a text file (.dat file) -> Sucessfully.
return(TRUE);
}[/INDENT]
When I run this on Emulator it works fine, But on the device it receives the Notification and wrting some text into the .dat file even then its not launching the application. Im trying this on LG 6335 device. After executing IShell_StartApplet & writing the text to a file it is exiting .....
Can anybody tell whats going wrong here?
Thankz,
Sunil

chk for return value, if not enough heap is there then it cant start the app.
post the entire block of code then we can think over it.

chk for return value, if not enough heap is there then it cant start the app.
post the entire block of code then we can think over it.

Hi Ramesh,
I am checking for the return value of ISHELL_StartApplet & its returning 0 i.e., SUCCESS, but still not launching the app.
This is the code snippet
[INDENT]case EVT_NOTIFY:
[INDENT]{
char szFileStr[256];
int ret;
AEENotify *not = (AEENotify *)dwParam;
if((not->dwMask == NMASK_SHELL_INIT))
{
ret = ISHELL_StartApplet(pMe->m_pIShell, pMe->m_clsID);
SZ_PRINTF(szFileStr, "@@ Start Applect Returned ->%d",ret);
// Writing the return value of StartApplet into the .dat file -> its Printing 0 i.e., SUCCESS
DBGPRINTF("Received EVT_NOTIFY event - Launching App");
// Writing some text into a text file (.dat file) -> Sucessfully.
return(TRUE);
[/INDENT][/INDENT]
can any one plz tell me what is going wrong ?
Thankz
Sunil

Hi Ramesh,
I am checking for the return value of ISHELL_StartApplet & its returning 0 i.e., SUCCESS, but still not launching the app.
This is the code snippet
[INDENT]case EVT_NOTIFY:
[INDENT]{
char szFileStr[256];
int ret;
AEENotify *not = (AEENotify *)dwParam;
if((not->dwMask == NMASK_SHELL_INIT))
{
ret = ISHELL_StartApplet(pMe->m_pIShell, pMe->m_clsID);
SZ_PRINTF(szFileStr, "@@ Start Applect Returned ->%d",ret);
// Writing the return value of StartApplet into the .dat file -> its Printing 0 i.e., SUCCESS
DBGPRINTF("Received EVT_NOTIFY event - Launching App");
// Writing some text into a text file (.dat file) -> Sucessfully.
return(TRUE);
[/INDENT][/INDENT]
can any one plz tell me what is going wrong ?
Thankz
Sunil

Hi,
comment out the code writing some thing to file after ishell_startapplet.
try to load on differenr devices and check, it might be device specific issue.

Hi,
comment out the code writing some thing to file after ishell_startapplet.
try to load on differenr devices and check, it might be device specific issue.

Hi All,
The same code is working fine on Pantech 711 device, but when i load the same mod file in LG 6335 its not working can any one tell why is this happening, or is it a device specific issue.
Thankz
Sunil

Hi All,
The same code is working fine on Pantech 711 device, but when i load the same mod file in LG 6335 its not working can any one tell why is this happening, or is it a device specific issue.
Thankz
Sunil

Once a user downloads an app from the BREW deck, is there a way to configure it so that it will automatically launch whenever the phone is powered on?
(I realize an app like this could not pass NSTL under normal circumstances. In this case, the capability would be approved by the carrier).
Thanks

Once a user downloads an app from the BREW deck, is there a way to configure it so that it will automatically launch whenever the phone is powered on?
(I realize an app like this could not pass NSTL under normal circumstances. In this case, the capability would be approved by the carrier).
Thanks

Yes it is possible to hook, however it would require operator approval.

Yes it is possible to hook, however it would require operator approval.

Merging similar threads. Please search the forums.

Merging similar threads. Please search the forums.

Yes it is possible,u can set in the MIF of yours application AEECLSID_SHELL.But Then u can handel the application in the EVT_NOTIFY as from here send the ISHELL_CloseApplet then there take the application in to the background by setting (*dwparam) = FALSE.So now from here u can handel the application in the background.
But i doubt that this EVT_NOTIFY event will fire in case of the 2.X phone as evidenced on kyocera devices. but it is ok with 3.x.

Yes it is possible,u can set in the MIF of yours application AEECLSID_SHELL.But Then u can handel the application in the EVT_NOTIFY as from here send the ISHELL_CloseApplet then there take the application in to the background by setting (*dwparam) = FALSE.So now from here u can handel the application in the background.
But i doubt that this EVT_NOTIFY event will fire in case of the 2.X phone as evidenced on kyocera devices. but it is ok with 3.x.

Application on startop registers NMASK_SHELL_INIT...
Is this why I cannot remove the MIF file? I've tried to remove it as soon as the handset powers up...
I'm not sure what I can do to remove MIF.
Any thoughts?

Application on startop registers NMASK_SHELL_INIT...
Is this why I cannot remove the MIF file? I've tried to remove it as soon as the handset powers up...
I'm not sure what I can do to remove MIF.
Any thoughts?

Depending upon the phone (OEM), if you have startup trigger you wouldn't be able to remove MIF file. This is OEM bug. For example you would see this is Razr family phones.
Workaround is, delete the MOD file, reboot the phone and then you should be able to remove the MIF file.

Depending upon the phone (OEM), if you have startup trigger you wouldn't be able to remove MIF file. This is OEM bug. For example you would see this is Razr family phones.
Workaround is, delete the MOD file, reboot the phone and then you should be able to remove the MIF file.

Hi All,
Is there any way I can start BREW app while BREW Simulator starts.
I mean like startup program.
Thanks

Hi All,
Is there any way I can start BREW app while BREW Simulator starts.
I mean like startup program.
Thanks

Sure. Just register for the NMASK_SHELL_INIT notification in your MIF. This will be delivered via the EVT_NOTIFY event to your app's HandleEvent.

Sure. Just register for the NMASK_SHELL_INIT notification in your MIF. This will be delivered via the EVT_NOTIFY event to your app's HandleEvent.

markb wrote:Sure. Just register for the NMASK_SHELL_INIT notification in your MIF. This will be delivered via the EVT_NOTIFY event to your app's HandleEvent.
Why handle this in EVT_NOTIFY?
Is it not sufficient that NMASK_SHELL_INIT notification launches application, and then just call:
ISHELL_StartApplet(...) to start in foreground
or
ISHELL_CloseApplet() + toggle dwParam in EVT_APP_STOP alternatively use StartBackgroundApplet() to start in background
directly from ...InitAppData() since this is done upon launch?

markb wrote:Sure. Just register for the NMASK_SHELL_INIT notification in your MIF. This will be delivered via the EVT_NOTIFY event to your app's HandleEvent.
Why handle this in EVT_NOTIFY?
Is it not sufficient that NMASK_SHELL_INIT notification launches application, and then just call:
ISHELL_StartApplet(...) to start in foreground
or
ISHELL_CloseApplet() + toggle dwParam in EVT_APP_STOP alternatively use StartBackgroundApplet() to start in background
directly from ...InitAppData() since this is done upon launch?

Hi,
I defined a key with a value AVK_OEM_RANGE_START+1. I want to register for this key event in the MIF file. Any idea how it can be done. I tried to register the same with AEECLSID_SHELL and NMASK_SHELL_KEY. But when I am trying to provide the key value, the problem arises. Since its a OEM defined key , the MIF editor is not able to display that key value in the pop down list. It will be so much helpful if any body can provide a work around.
thanks,
Jins

Hi,
I defined a key with a value AVK_OEM_RANGE_START+1. I want to register for this key event in the MIF file. Any idea how it can be done. I tried to register the same with AEECLSID_SHELL and NMASK_SHELL_KEY. But when I am trying to provide the key value, the problem arises. Since its a OEM defined key , the MIF editor is not able to display that key value in the pop down list. It will be so much helpful if any body can provide a work around.
thanks,
Jins