Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Regular Contributor vinothg's Avatar
    Join Date
    Sep 2008
    Posts
    63
    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 savaj's Avatar
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034
    Check MNotification.

  3. #3
    Registered User kusumk's Avatar
    Join Date
    Sep 2011
    Posts
    449
    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 savaj's Avatar
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034
    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 vinothg's Avatar
    Join Date
    Sep 2008
    Posts
    63
    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 vinothg's Avatar
    Join Date
    Sep 2008
    Posts
    63
    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 gnuton's Avatar
    Join Date
    Mar 2009
    Posts
    1,024
    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 AlxKara's Avatar
    Join Date
    Sep 2011
    Posts
    2
    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 kusumk's Avatar
    Join Date
    Sep 2011
    Posts
    449
    Are u using QT or QML ? Incase of QML you can check the below posts to display a banner.

  10. #10
    Registered User AlxKara's Avatar
    Join Date
    Sep 2011
    Posts
    2
    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 gnuton's Avatar
    Join Date
    Mar 2009
    Posts
    1,024
    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 conxt's Avatar
    Join Date
    Nov 2011
    Posts
    48
    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 gnuton's Avatar
    Join Date
    Mar 2009
    Posts
    1,024
    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

  15. #15
    Registered User kenya888's Avatar
    Join Date
    Dec 2008
    Posts
    1
    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.

Page 1 of 2 12 LastLast

Similar Threads

  1. Can we set the alarm with no notification?
    By NRK in forum Symbian C++
    Replies: 3
    Last Post: 2008-12-23, 12:44
  2. Alarm notification
    By rami75lu in forum Symbian C++
    Replies: 1
    Last Post: 2007-02-28, 21:13
  3. How to get Alarm Notification?
    By paulsanbu in forum Symbian C++
    Replies: 1
    Last Post: 2002-05-09, 17:01
  4. Alarm notification (Urgent.......)
    By prbhat in forum Symbian C++
    Replies: 0
    Last Post: 1970-01-01, 02:00
  5. alarm notification
    By prbhat in forum Symbian C++
    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
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved