×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    63

    Alarm like notification in N9

    Hi,

    When i set an alarm in N9, a notification is seen on the top of the screen "Time Left until alarm". I have seen few third party apps (Screen capture) do the same thing when settings are saved. I wanted to add this functionality into my app.

    What kind of notification is it ? An example code would be of great use.

    Regards,
    Vinoth

  2. #2
    Nokia Developer Champion
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: Alarm like notification in N9

    Check MNotification.

  3. #3
    Registered User
    Join Date
    Sep 2011
    Posts
    449

    Re: Alarm like notification in N9

    http://forum.meego.com/showthread.php?t=3986

    That notification you see in screen capture and clock application is an Information Banner. Please see above link for QML information banner.

    http://harmattan-dev.nokia.com/docs/...JtZWVnb3RvdWNo

    The above link points to the documentation of the MBanner class

    Here's how to launch an information banner from code:

    MBanner *infoBanner = new MBanner();
    infoBanner->setStyleName(MBannerType::InformationBanner);
    infoBanner->setTitle("Info banner with so much information that the text wraps in portrait");
    infoBanner->appear(scene(), MSceneWindow:estroyWhenDone);

    Hope this helps!

  4. #4
    Nokia Developer Champion
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: Alarm like notification in N9

    Oops.. Sorry for misunderstanding your question.

    Those application specific notifications are banners and (as suggested below) you can create it in Qt -MeeGo application using "MBanner" and in QML using QML InfoBanner Element.

  5. #5
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    63

    Re: Alarm like notification in N9

    Thanks. I was looking exactly for this. What is scene() ? It says scene() is not declared in this scope. I saw the API declaration and it expects QGraphicsScene. I instantiated an object of type QGraphicsScene but at run time it says "scene has no scene manager".

    This is my first Meego project so i still don't understand many things.

  6. #6
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    63

    Re: Alarm like notification in N9

    I tried to do it using QML but it failed at run time with message "X Error: BadDamage (invalid Damage parameter) 153"

    I just wanted to show a simple message like "File saved successfully". Is there any other way to do it. I am looking for a Toast like functionality from Android.

    QML:

    import QtQuick 1.1
    import com.nokia.meego 1.0
    import com.nokia.extras 1.1

    PageStackWindow {
    id: appWindow
    InfoBanner {
    id: banner
    text: "Fyuck Meego"
    timerShowTime: 3000
    }
    }

  7. #7
    Nokia Developer Moderator
    Join Date
    Mar 2009
    Posts
    1,024

    Re: Alarm like notification in N9

    The X Error message is not related to usage of Info banners.
    Your code is okay, but if you don't call banner.show() your banner won't ever be shown!

  8. #8
    Registered User
    Join Date
    Sep 2011
    Posts
    2

    Re: Alarm like notification in N9

    Hi,

    I need to use MBanner, but for using it I need to get QGraphicsScene for MBanner->appear() method. And it's not clear how to get scene if my application has no own window. Any hint?

  9. #9
    Registered User
    Join Date
    Sep 2011
    Posts
    449

    Re: Alarm like notification in N9

    Are u using QT or QML ? Incase of QML you can check the below posts to display a banner.

  10. #10
    Registered User
    Join Date
    Sep 2011
    Posts
    2

    Re: Alarm like notification in N9

    No. My application doesn't have own window. Anyway, if you meen InfoBanner: this banner works only inside application window.

  11. #11
    Nokia Developer Moderator
    Join Date
    Mar 2009
    Posts
    1,024

    Re: Alarm like notification in N9

    Hi,
    MBanner is the MeeGoTouch class used by QML InfoBanner.
    Both are displayed in a graphics view, so both require a graphics scene.
    A declarative view is basically a graphics view, so you can get the scene using scene() method.

    Since your app doesn' have any GUI you CANNOT use any of those banners, but you should be able to use MNotification class.
    MNotification dispalys a banner without requiring a window.
    This is possible because the MNotification banner belongs to System UI (which is a process different from your app).
    Communication between your app and System UI makes use of DBus messages.

    You can reaad more about MNotification in this forum, it's covered by several threads and you can browse the reference manual at http://harmattan-dev.nokia.com/docs/...JtZWVnb3RvdWNo

  12. #12
    Registered User
    Join Date
    Nov 2011
    Posts
    48

    Re: Alarm like notification in N9

    Wanted to share my experience with MNotification beside described in MNotification reference.

    To use MNotification you must instanciate MComponentData in your main.cpp:
    #include <MComponentData>
    ...
    MComponentData::createInstance(argc, argv);

    To show a banner, not a notification in the Notification Feed view, you will have to use MNotification::DeviceEvent event type.

    If you apparently want for something to happen when a user taps your banner, you will have to create a D-Bus adaptor to use it with setAction() method because the MNotification banner will be shown outside of your application process.

  13. #13
    Nokia Developer Moderator
    Join Date
    Mar 2009
    Posts
    1,024

    Re: Alarm like notification in N9

    Hi conxt,
    If you have some spare time it would be nice to see a minimal app which make use of DBus adaptors with MNotification in our wiki pages.

  14. #14
    Registered User
    Join Date
    Nov 2011
    Posts
    48

    Re: Alarm like notification in N9


  15. #15
    Registered User
    Join Date
    Dec 2008
    Posts
    1

    Re: Alarm like notification in N9

    Hi, thank you for your good tips. Could I use system-wide notification to status bar, such as new email arrival notification? I'd like to use it from QML easily such as InfoBanner.

Similar Threads

  1. Replies: 3
    Last Post: 2008-12-23, 12:44
  2. Alarm notification
    By rami75lu in forum Symbian
    Replies: 1
    Last Post: 2007-02-28, 21:13
  3. How to get Alarm Notification?
    By paulsanbu in forum Symbian
    Replies: 1
    Last Post: 2002-05-09, 17:01
  4. Alarm notification (Urgent.......)
    By prbhat in forum Symbian
    Replies: 0
    Last Post: 1970-01-01, 02:00
  5. alarm notification
    By prbhat in forum Symbian
    Replies: 1
    Last Post: 1970-01-01, 02:00

Posting Permissions

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