×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Dec 2010
    Location
    Montevideo, Uruguay
    Posts
    5

    Question Supress SMS notification

    Hi there, this is my first post

    I'm writing a Python script and have this problem: I'm binding a callback function to the inbox. When a new SMS arrives, the function gets called, gets an instance of the Inbox and get the new message's content. After this, the message is deleted (to avoid sound notification). The problem is that i had to add an e32.ao_sleep() before accessing the new message's content because otherwise Python raised a KerrAccessDenied error. I read in other thread here that was the solution to the problem and indeed it "was", except for the new problem i'm having now.

    Here is a simplified version of the script:

    HTML Code:
    <pre>
    import inbox, e32, appuifw
    
    def cb(id):
    	e32.ao_sleep(0.1)
    	b = inbox.Inbox()
    	content = b.content(id)
    	b.delete(id)
    	print "New message:", content
    	
    box = inbox.Inbox()
    box.bind(cb)
    
    l = e32.Ao_lock()
    appuifw.app.exit_key_handler = l.signal
    l.wait()
    </pre>
    I tested it in a Nokia N95-8g and Nokia N97. I'm using Python 2.0.0 and PythonScriptShell 2.0.0 high capas.
    Any ideas?

    Thanks from Uruguay

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: Supress SMS notification

    Hi and welcome to the Forum Nokia Discussion Boards,

    What's the new problem you're having?

    Also, you might be interested in this: http://discussion.forum.nokia.com/fo...l=1#post819670

  3. #3
    Registered User
    Join Date
    Dec 2010
    Location
    Montevideo, Uruguay
    Posts
    5

    Re: Supress SMS notification

    The problem is that I can't find out why the notification is still sounding. I've done similar programs before (withou the e32.ao_sleep()) and if I deleted the message before the callback function returned there was no sound. But if I comment the e32.ao_sleep() an error ir raised (KErrAccessDenied) when I try to fetch the content.
    I read the discussion you suggested but I have no idea how to install a .pyc. I tried copying it to E:\\data\\python\\libs but didn't work.

  4. #4
    Registered User
    Join Date
    Jun 2010
    Posts
    7

    Re: Supress SMS notification

    The problem is the following: there is a race condition between your app and messaging app when you do Inbox.delete. If you don't put ao_sleep then you should win this race but for some reason Symbian denies the access. If you put ao_sleep then you lose the race and that's why the sound is emitted. Native extensions (the .pyd ones) must reside in /sys/bin and you could only put them there by installing .sis package with .pyd inside. Learn how to use Ensymble tool for packing .pyd, in other case http://smswatch.googlecode.com/files/smswatch.sisx this could work for your but only in pys60 shell and it depends on your environment.

  5. #5
    Registered User
    Join Date
    Dec 2010
    Location
    Montevideo, Uruguay
    Posts
    5

    Re: Supress SMS notification

    Thanks both for the reply.
    Smswatch didn't work, not compatible with my Nokia N97 (Symbian S60v5).

    I've came accross another problem.. Is it possible to bind 2 different callbacks to 2 different Inbox?? I want to detect incoming and outgoing messages.

    Thanks!

  6. #6
    Registered User
    Join Date
    Jun 2010
    Posts
    7

    Re: Supress SMS notification

    elmen35: does it fail on installation or on import? version shouldn't matter much as long as it's pys60 2.0

  7. #7
    Registered User
    Join Date
    Dec 2010
    Location
    Montevideo, Uruguay
    Posts
    5

    Re: Supress SMS notification

    At installation it says that it's not compatible (I'm using a Nokia N97 with S60v5). If y select "continue", it gets installes but fails on import. I tried installing it at both drives (C: and E: [I have python installed at E:]). I used the .sisx file and .sis signed with sign4ever. None of them worked... :S

Similar Threads

  1. Replies: 2
    Last Post: 2010-01-31, 16:39
  2. Supress Dialer in 5800
    By nshenoy in forum Symbian User Interface
    Replies: 2
    Last Post: 2009-09-12, 09:23
  3. Replies: 3
    Last Post: 2009-01-08, 04:41
  4. Supress XML Script
    By devdattac in forum Symbian
    Replies: 2
    Last Post: 2008-11-27, 08:15
  5. Replies: 0
    Last Post: 2003-10-02, 18:49

Posting Permissions

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