×

Discussion Board

Results 1 to 10 of 10

Thread: Problem

  1. #1
    Regular Contributor
    Join Date
    May 2008
    Posts
    88

    Problem

    Hey all,
    I have implemented the following program in Python s60 that waits for incoming messages and checks whether they are some kind of alert message from a predefined number.If so,it displays a message "Danger!!!" and waits for the user to press either Ok or Cancel.(also it starts playing an audio file infinitely).Depending on what the user presses,its either stops playing the file or starts again.
    Code:
    import appuifw
    import inbox
    import e32
    import logs
    import audio
    
    
    nbr="+00000"
    nbr_rec=0
    
    app_lock = e32.Ao_lock()
    
    def message_recieved(msg_id):
    	global app_lock,nbr
    	box = inbox.Inbox()
    	sms_text = box.content(msg_id)
    	l=logs.sms(mode='in')
    	nbr_rec = l[0]["number"]
    	print (u"Number Recieved is "+str(nbr_rec))
    	if((nbr_rec==nbr) and (sms_text=="Test")):
    		e32.ao_sleep(3)
    		A = audio.Sound.open("C:\smsalertpolices03.mid")
    		j=None
    		A.play(audio.KMdaRepeatForever)
    		while j is None:
    			j=appuifw.query(u"Danger!!!","query")
    		A.stop()
    		A.close()
    	app_lock.signal()
    
    box = inbox.Inbox()
    box.bind(message_recieved)
    
    print (u"Waiting for new SMS messages.....")
    app_lock.wait()
    print(u"Message handled!")
    Alls fine till this.But,I want the application to run in background so that the user can do other stuffs too like attending calls and other things.Only when the specific message comes it display the alert message and start playing the audio file.It works with this too.But the problem is that the message is displayed only when I open the Python shell and I can only stop the audio file by opening the python shell.

    Is there any way to display the message/query globally and close the audio file from outside.

    Plz Help me
    Rishabh

  2. #2
    Regular Contributor
    Join Date
    Dec 2007
    Location
    Tempe, AZ
    Posts
    411

    Re: Problem

    Rishabh don't know the solution buddy, but still you can have look at link maybe it can help you,

    http://snippets.dzone.com/posts/show/814


    and ya things can be done like this beacuse just saw another application named TTSMS reader

    http://phonesoftware.blogsome.com/20.../ttsms-reader/
    IDEAS is all they need but still they think only Genius can give them that.

  3. #3
    Regular Contributor
    Join Date
    May 2008
    Posts
    88

    Thumbs up Re: Problem

    Hey,
    Nice one yaar.Gr8 Help.
    Cheers,
    Rishabh

  4. #4
    Regular Contributor
    Join Date
    May 2008
    Posts
    88

    Re: Problem

    One thing,this module only lists the predifined apps in the list or also includes the one we create like standalone applications.
    Rishabh

  5. #5
    Regular Contributor
    Join Date
    Dec 2007
    Location
    Tempe, AZ
    Posts
    411

    Re: Problem

    And Rishabh the message display i have already told, still

    note(text[, type[, global ] ])
    Displays a note dialog of the chosen type with text (Unicode). The default value for type is 'info',
    which is automatically used if type is not set. type can be one of the following strings: 'error',
    'info', or 'conf'.
    If global (integer) is any other value than zero a global note is displayed. A global note is displayed
    even if the Python application calling this function is in background. The same set of types is
    supported as in standard note.
    IDEAS is all they need but still they think only Genius can give them that.

  6. #6
    Regular Contributor
    Join Date
    May 2008
    Posts
    88

    Re: Problem

    Thnx Shubendra for your help.Now I m able to run python to the foreground with this module.One thing I wanna make a standalone application out of the program that i implemented.So in that also i need to bring it to the foreground.Does this appswitch module will also display the standalone application that i created in the apps list.Can i call the current application to be in the foreground with the appswitch.I hope u r getting what I am saying.
    Rishabh

  7. #7
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,796

    Re: Problem

    Quote Originally Posted by rishabhgupta View Post
    Thnx Shubendra for your help.Now I m able to run python to the foreground with this module.One thing I wanna make a standalone application out of the program that i implemented.So in that also i need to bring it to the foreground.Does this appswitch module will also display the standalone application that i created in the apps list.Can i call the current application to be in the foreground with the appswitch.I hope u r getting what I am saying.
    Rishabh
    Yes, if you make a standalone application out of your script, and it is running in the background, appswitch will list it too.

    And you can use it to trigger it to foreground.

    Best Regards,
    Croozeus
    Pankaj Nathani
    www.croozeus.com

  8. #8
    Regular Contributor
    Join Date
    May 2008
    Posts
    88

    Re: Problem

    Hey Pankaj,
    Ya I tried and it works .
    But I am encoutering some problem in making a standalone application.I am getting this error.
    Error 'uidcrc' utility not found.Please make sure that u have the Symbian SDK correctly installed and configured.
    Please help me.
    Rishabh

  9. #9
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,796

    Re: Problem

    Quote Originally Posted by rishabhgupta View Post
    Hey Pankaj,
    Ya I tried and it works .
    But I am encoutering some problem in making a standalone application.I am getting this error.
    Error 'uidcrc' utility not found.Please make sure that u have the Symbian SDK correctly installed and configured.
    Please help me.
    Rishabh
    I have replied to your other thread related to this here

    Best Regards,
    Croozeus
    Pankaj Nathani
    www.croozeus.com

  10. #10
    Registered User
    Join Date
    Dec 2007
    Posts
    42

    Re: Problem

    if u r still having any problem refer to this thread.

    http://discussion.forum.nokia.com/fo...197#post426197

Similar Threads

  1. Problem with eglSwapBuffers and heap corruption
    By greatape in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2007-05-24, 03:35
  2. netcards - Problem with opening adapter
    By kernj in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2007-01-10, 08:56
  3. WAP service problem on Apache
    By bigg_o in forum Browsing and Mark-ups
    Replies: 3
    Last Post: 2005-04-17, 16:05
  4. Problem: S60 SDK for CW in PC with .NET
    By anttij in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2005-02-28, 11:36

Posting Permissions

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