You Are Here:

Community: Developer Discussion Boards

#1 Old Background processes doubts - 2008-07-02, 20:12

Join Date: Feb 2008
Posts: 28
totetote
Offline
Registered User
Hello. Once 1.4.4 have been released and notes using globalui work perfectly, I would like to improve my application.

What I want to do is have a listener always running that shows a note when SMS is received. I´m able to do it when the listener is running in foreground or in background (because I pressed symbian menu button or something). What I want to do is have this listener apart from my main app always running in background, even if I close the main app.

I dont know yet how (neither if its possible) to run 2 scripts at the same time, one of them always in background. Any help, tip or info about that?

Thank you very much.
Reply With Quote

#2 Old Re: Background processes doubts - 2008-07-03, 04:32

Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Online
Forum Nokia Champion
Quote:
Originally Posted by totetote View Post
Hello. Once 1.4.4 have been released and notes using globalui work perfectly, I would like to improve my application.

What I want to do is have a listener always running that shows a note when SMS is received. I´m able to do it when the listener is running in foreground or in background (because I pressed symbian menu button or something). What I want to do is have this listener apart from my main app always running in background, even if I close the main app.

I dont know yet how (neither if its possible) to run 2 scripts at the same time, one of them always in background. Any help, tip or info about that?

Thank you very much.
hi totetote
why dont you use something like a daemon process. I think it will be helpful to you.


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote

#3 Old Re: Background processes doubts - 2008-07-03, 10:42

Join Date: Feb 2008
Posts: 28
totetote
Offline
Registered User
Quote:
Originally Posted by gaba88 View Post
hi totetote
why dont you use something like a daemon process. I think it will be helpful to you.
Thanks for helping. I made some tests using a thread for the listener but the problem is still the same using callback in my main app. Once I close the main app, thread closes too.
Reply With Quote

#4 Old Re: Background processes doubts - 2008-07-03, 11:30

Join Date: May 2007
Posts: 2,737
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
Quote:
Originally Posted by totetote View Post
Thanks for helping. I made some tests using a thread for the listener but the problem is still the same using callback in my main app. Once I close the main app, thread closes too.
If you wish to call a script which runs in the background from the main script, refer this article on the Wiki.

How to execute another script from a script

Or may be you can have 2 python applications, one calling the another.

Best Regards,
Croozeus
Reply With Quote

#5 Old Re: Background processes doubts - 2008-07-03, 11:44

Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Online
Forum Nokia Champion
Quote:
Originally Posted by totetote View Post
Thanks for helping. I made some tests using a thread for the listener but the problem is still the same using callback in my main app. Once I close the main app, thread closes too.
hi totetote
really sad that didnt worked for you. I faced similar problem once and i got the solution accidentally in the forum there was a post regarding threads which explained scope of threads i am actually not getting that post in the search better you also try for that.


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote

#6 Old Re: Background processes doubts - 2008-07-03, 12:31

Join Date: Feb 2008
Posts: 28
totetote
Offline
Registered User
Thank you both for helping.

Also have the same problem with calling one script from another.

I think I´m misunderstunding how does interpreter work, and I´m trying to make something non-sense.

When you select python in installed programs, you open a console where you can run scripts. I have some questions about that "console".

Can you run a script directly, no needing to "Open the console->Options->RunScript->select the script"? (I read something about .py to SIS, ensymble, etc: Only yes or no and some keyword to search are enough)

When a script is running, and I press Symbian menu button, I it seems to get minimized. When i open the console again it keeps the previous status. When i close it with the red hang-on button, or with exit button, it doesn´t happen. Why? I want to always have the minimizing behaviour. Can I do it??


Thank you very much again
Reply With Quote

#7 Old Re: Background processes doubts - 2008-07-03, 12:49

Join Date: Jun 2005
Posts: 382
y.a.k
Offline
Regular Contributor
The Python Shell is just a small Symbian C++ application that loads the Python interpreter and starts a default.py script found in the app's directory. This script sets up the menu to include the options to start a script or a interactive console.

You can write your own default.py and build a standalone application in the same way. This is done using Ensymble. The tool is very user friendly so you shouldn't have much problems with it. It will create a sis file for you that you can simply install on your phone to get a separate icon for your script in the menu.

As for running a script in background. The PyS60 docs for the e32 module say:
Quote:
e32.start_server(fi lename)
Starts the Python script in file filename (Unicode) as a server in its own process. Note that appuifw module is not available to a server script.
I haven't tried but a script started this way should stay in memory even if you quit your app. Note that it won't be able to import the appuifw module (because it doesn't have its own window) but you should be able to use globalui from there. You will have to do some additional work to be able to debug the code running there since as the script won't have its window, it will have no place to print the traceback to in case of an error. It will most probably just shut down quietly. You have to catch all exceptions and print them out somewhere, probably to a file.

Good luck!
Reply With Quote

#8 Old Re: Background processes doubts - 2008-07-03, 12:54

Join Date: Jun 2005
Posts: 382
y.a.k
Offline
Regular Contributor
As for the red key behaviour. There are two ways to change that. Either you will have to install the envy module and use its capability to make your app a system app (which means it will close only when it chooses to do so, never by the OS itself) or you can use the trick discussed not long ago in this thread.
Reply With Quote

#9 Old Re: Background processes doubts - 2008-07-03, 13:24

Join Date: Feb 2008
Posts: 28
totetote
Offline
Registered User
Quote:
Originally Posted by y.a.k View Post
As for the red key behaviour. There are two ways to change that. Either you will have to install the envy module and use its capability to make your app a system app (which means it will close only when it chooses to do so, never by the OS itself) or you can use the trick discussed not long ago in this thread.
Thank you very much. Both posts were really helpfull. I will try
start_server and post the results (and probably more questions).
Reply With Quote

#10 Old Re: Background processes doubts - 2008-07-10, 13:49

Join Date: Feb 2008
Posts: 28
totetote
Offline
Registered User
Hello. I´m back again with some more problems. What I want to do now, is send to foreground my minimized app. I´ll explain.

When a global note is displayed and my app is in foreground I get the desired funcionality, my app loads new contents.
When my app is in background and the global note is displayed, the app loads the new contents, but it keeps in background and I have to open it again to see it.

What I need is a way to open my app without having to open it again manually.

Any help? Thx
Reply With Quote

#11 Old Re: Background processes doubts - 2008-07-10, 13:57

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
Offline
Forum Nokia Champion
Quote:
Originally Posted by totetote View Post
Hello. I´m back again with some more problems. What I want to do now, is send to foreground my minimized app. I´ll explain.

When a global note is displayed and my app is in foreground I get the desired funcionality, my app loads new contents.
When my app is in background and the global note is displayed, the app loads the new contents, but it keeps in background and I have to open it again to see it.

What I need is a way to open my app without having to open it again manually.

Any help? Thx
Hi,

You could try appswitch from Cyke64's page. It's for switching applications from background to foreground and vice versa. See this article for instructions.
Reply With Quote

#12 Old Re: Background processes doubts - 2008-07-10, 14:01

Join Date: Feb 2008
Posts: 28
totetote
Offline
Registered User
THx. I had already tried to install it on the emulator but get an "expired certificate" and cant install it.
Reply With Quote

#13 Old Re: Background processes doubts - 2008-07-10, 16:25

Join Date: May 2007
Posts: 2,737
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
Quote:
Originally Posted by totetote View Post
THx. I had already tried to install it on the emulator but get an "expired certificate" and cant install it.
1) Resign it! and then install !

Or

2) Just set the date 1 year back and it would install!

Br,
Croozeus
Reply With Quote

#14 Old Re: Background processes doubts - 2009-03-13, 12:35

Join Date: Mar 2009
Posts: 1
TechThirsty
Offline
Registered User
HI.....please help me with a problem in windows mobile(platform j2me)....
i have an application which writes a file locally in the mobile every 30 seconds with new entries in append mode,now when i exit the application and view my file every thing is fine.........now what i need is to view the file manually at runtime when the application is still running,when i try to view the file manually when the application is still running,i find that there are no entries or less entries in my file,that is the file gets disturb.....is it possible to read the file manually in background with no issues...
Reply With Quote

#15 Old Re: Background processes doubts - 2009-03-14, 05:51

Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Online
Forum Nokia Champion
Quote:
Originally Posted by TechThirsty View Post
HI.....please help me with a problem in windows mobile(platform j2me)....
i have an application which writes a file locally in the mobile every 30 seconds with new entries in append mode,now when i exit the application and view my file every thing is fine.........now what i need is to view the file manually at runtime when the application is still running,when i try to view the file manually when the application is still running,i find that there are no entries or less entries in my file,that is the file gets disturb.....is it possible to read the file manually in background with no issues...
hello TechThirsty

Welcome to forum nokia dibo.

I guess you are in wrong place to ask the question this is discussion boards for nokia S60,S40 devices.

Regards
Gaba88


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Graphics in background Python processes? canopus961 Python 8 2008-07-21 22:31
Background processes njbuch General Symbian C++ 2 2006-03-09 08:45
Background processes njbuch Mobile Java General 1 2006-03-09 04:06
Background Processes ask@nokia Mobile Java General 1 2004-06-23 08:36
BackGround Processes & Push Registry isseyp Mobile Java General 0 2004-05-09 07:36

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d81449X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZpythonQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZuserE5ftagQSxpythonX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ