starting the application on startup
| Wed, 2006-04-26 22:16 | |
|
Hi,
I need to make my application start when the mobile starts up, because the application listens to incoming sms's and makes some scheduled actions. i am testing on series 60 fp2 specially 6630. the application has a GUI but i don't want the GUI to be opened on start up, i just want the active objects only to start on start up and i want to allow the user to open the GUI from the application icon in the menu at any time. i read about recognizers, sending application to background, but i am so confused what to use exactly? what does sending the application to the background does exactly? |
|






Forum posts: 51
1) write a server application (.exe) to do the monitoring etc.
2) write a client application (.app) to talk to the server and display a user interface
3) write a recogniser to start the server on boot-up.
To find out how to do 1 and 2 above, read "Symbian OS C++ for Mobile Phones" by Richard Harrison, it has a complete working example and lots of hints and advise. To write a recognisr, check out the EzBoot example on this site (http://www.newlc.com/EzBoot.html).
Forum posts: 40
I have a question on the same subject. I've managed to implement a recognizer to start my application on boot and installation. However, my application doesn't start on boot when installed on one of my 6600 device. I think that is because some resource that my app need are not loaded. I used a 20 seconds delay as a work-around but I wonder how I can know whar resources are needed and how I can check if they're loaded.
Thanks in advance,
Imzadi
Forum posts: 32
Does this mean that i have to make a server? can't i just make a recognizer to solve my problem?
- if the recognizer can start your app, can it also start it in the background?
- if an app is in the background can its active objects wait for event, and when those events trigger can the app remain in the background while it deals with those events?
- you want your app to start at machine start because it is listening and making some scheduled actions, therefore presumably you also want these actions to continue happening? So what happens if the app starts at machine launch, the user selects the application icon and then quits the application? If you don't want them to quit are you going to disable the quit option and thus break the UI standards? If its ok for them to quit the app and thus stop the sms listening then why is it important to launch at boot up? (after all the user could quit your app 5 seconds after the machine has booted).
Forum posts: 51
TRequestStatus status(KRequestPending);
RSystemAgent agent;
agent.Connect();
RTimer timer;
timer.CreateLocal();
TTimeIntervalMicroSeconds32 time(5000000);
TInt trycount = 0;
while ((agent.GetState(KUidSIMStatus) != ESASimOk) && (trycount++ < KMaxTries))
{
timer.After(status,time);
User::WaitForRequest(status);
}
timer.Close();
agent.Close();
It seems to work fine for Nokia devices, Sony Ericsson devices never return ESASimOk, so that's why the KMaxTries is there.
Forum posts: 40
Yes.
As you for your last question. I'm not sure what you mean, but I don't recommend breaking the UI standard. If the user wants to quit, let him. It's his responsibilty.
BRoberts, maybe you could help me. I'm developing a dialer application. Do you know what states I should look for in my recognizer before launching my app?
regards,
Imzadi
Forum posts: 32
I wrote a function that sends the application to the background, but i don't know where should it be called because it is not working, or may be it won't work before i make the application autostart?
Forum posts: 104
you mention:
"I've managed to implement a recognizer to start my application on boot and installation. However, my application doesn't start on boot when installed on one of my 6600 device"
one quick thing to check... make sure recogniser comes after your app in the pkg file. otherwise when you copy the recogniser onto the phone the app won't be there to launch
why does this only happen on older devices eg 6600?
good question. i don't know, i could guess but that just ain't the same as knowin' Â
PL
Forum posts: 40
My recognizer is indeed come after my app in the pkg file. The recognizer works well and actually, on a different 6600 phone, I don't need to put the timeout in the it. The same is true for a 6630 phone.
So, I'm guessing that on the problematic 6600 phone, some resources are not loaded when the recognizer launch my app and this causes my application to quit.
Problem is I don't know what those resources are.
Imzadi
Forum posts: 32
I saw recognizer example posted on forum nokia, but i didn't know where exactly (in which lines) i should change to make the recognizer recognize my application?
Forum posts: 104
I think that there is some confusion here.
I see many people asking the question "how can i start my app at install and device boot?"Â and the answer comes swiftly back "use a recogniser"
this has lead to FALSE belief that recognisers are for starting apps at install and device boot.
What recognisers are REALLY designed for is detecting the use of a file of a particular MIME type and launching the appropriate application to deal with it. an example of this that will be familar to all would be that there is a recogniser that detects the use of the proprietory .sis file format and launches the installer.Â
Now, in order for a recogniser to do it's job it must be run by the system at boot time. Here we can take advantage of this to "mis-use" the recogniser concept to launch our app when the recogniser gets booted.
So basically what you do is write a dummy recogniser that isn't really looking for any meaningfull MIME type but that runs your app when it, the recogniser, is constructed.
there is a health warnings here:
things like recognisers, notifiers etc are all run up by the system, you don't control them. So if they panic or behave badly you can have all sorts of rather nasty problems. be carefull.
Happily there is a easy route, you could try using ezBoot. this is a kind of configurable recogniser that has been created for the purpose of booting apps.Â
http://www.newlc.com/EzBoot.html?var_recherche=ezboot
Best regards
PL
Forum posts: 32
I already found some codes and i wrote the .mmp, .cpp and .h for the recognizer as i found here: http://discussion.forum.nokia.com/forum/showthread.php?t=71272&goto=nextnewest,
but nothing happens when i run.
what else should i do? is there something i should write in the application that i want to autostart or in the recognizer? should i write something in the .pkg of the application?
Forum posts: 40
If you liked the EzBoot idea, why not have a look at the source code? here http://www.newlc.com/Writing-a-recognizer-The-EZBoot.html
Imzadi
Forum posts: 2009
This kind of architecture looks mandatory if you want to start an app which has a GUI. But note that the server may not need to be a server as defined by Symbian OS (i.e. it does not need to derive from a CServer class): it may only be an exe which runs on background and decide when the GUI application shall be launched.
Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant
Forum posts: 1
HI first of let me thank the whole team for the information on moving the app to boot up.
I want this application which i have moved to the boot up to run in the background so that the user doesnt know its running. Please can anyone suggest the best way to do this
many thanks