Is it possible for a Cascade application change the Notification Mode to vibrate at normal

I am interested in creating a timer application that returns my phone in 'Vibrate only' notification 'Normal' after a period of time defined.  I knshow you need to set permissions, but I didn't know anything like that to give permission to do so.  I have a Z10 with 10.2.1 on it.

Is this possible or not BB 10.2.1 avoid this?   It would be nice to be able to do.

A snippet of code showing how to set up permissions for this would be useful.

You can change the Notification Mode since 10.2, here's what you need to do.

Add this line to the bottom of the file bar - descriptor.xml, under the tab "source":

access_notify_settings_control

Add this line to your .pro file:

LIBS += -lbbplatform

Add this to your file:

#include 

public: Q_INVOKABLE void switchMode();private:
    bb::platform::NotificationGlobalSettings* notificationGlobalSettings;

Add this to your .cpp file:

void YourClass::switchMode()
{
    if (notificationGlobalSettings->mode() == bb::platform::NotificationMode::Normal) {
        notificationGlobalSettings->setMode(bb::platform::NotificationMode::Vibrate);
        break;
    } else if (notificationGlobalSettings->mode() == bb::platform::NotificationMode::Vibrate) {
        notificationGlobalSettings->setMode(bb::platform::NotificationMode::Normal);
        break;
    }
}

Simply call switchMode() function in c ++ or QML to switch between the Normal and the vibrator. Note that this code will do nothing if the mode is set to anything else than Normal or vibrate. If you prefer to scroll through all the available Notification mode, use this function:

void YourClass::switchMode()
{
    switch (notificationGlobalSettings->mode()) {
        case bb::platform::NotificationMode::Normal : {
            notificationGlobalSettings->setMode(bb::platform::NotificationMode::PhoneOnly);
            break;
        }
        case bb::platform::NotificationMode::PhoneOnly : {
            notificationGlobalSettings->setMode(bb::platform::NotificationMode::Vibrate);
            break;
        }
        case bb::platform::NotificationMode::Vibrate : {
            notificationGlobalSettings->setMode(bb::platform::NotificationMode::Silent);
            break;
        }
        case bb::platform::NotificationMode::Silent : {
            notificationGlobalSettings->setMode(bb::platform::NotificationMode::AlertsOff);
            break;
        }
        case bb::platform::NotificationMode::AlertsOff : {
            notificationGlobalSettings->setMode(bb::platform::NotificationMode::Normal);
            break;
        }
        default : {
            notificationGlobalSettings->setMode(bb::platform::NotificationMode::Normal);
            break;
        }
    }
}

Tags: BlackBerry Developers

Similar Questions

  • looking for a way to change the font color in the hotmail to chat Messenger?

    I am running windows internet explore 9 and you are looking for a way to change the color of the font in hotmail to chat Messenger, can anyone help with this. You can email me at * address email is removed from the privacy * where I am away from my computer.

    Hello
    The question you have posted is related to Windows Live and would be better suited to the Discussion Windows Live groups. Please visit the link below to find a community that will provide the support you want.
    Hotmail Portal
  • Smartphones blackBerry how to change the connection mode for a BlackBerry Internet Service account on my 9700

    Got my first BB is the 9700 and I believe that my company doesn't have not BES, I must connect on my BIS via a computer to set up my work email (Microsoft Exchange Server). After having read about it and try, I get an error message on the Web site of my provider which basically means that I need to change the connection mode for a BlackBerry Internet Service account. I checked the site Web of Blackberry and the instructions do not work for my 9700. Can someone help me please?

    Thank you very much

    Buskroth

    the link provided should have addressed your question, if you "can't get there from here" - I would suggest that you contact your carrier because they need to move your account password enabled allowing connect you via a non - BB browser to set up your BIS email setting...

  • Is it possible for an index that includes the condition 'GOLD '?

    Hello, I have a few questions.

    The test was conducted in the following procedure.

    ################################
    create table test
    (
    VARCHAR2 (10) C1.
    C2 varchar2 (10),
    key (c1) elementary school

    );

    create index test_idx1 on test (c2);

    Command > explain select * test where c1 = 'JOHN' or c2 = "JOHN";

    Query optimizer plan:

    STEP: 1
    LEVEL: 1
    OPERATION: RowLkRangeScan
    TABLENAME: TEST
    IXNAME: TEST
    CONDITION INDEX: < NULL >
    NOT INDEXED: TEST. C2 = 'JOHN' OR TEST. C1 = 'LUCY '.

    Command >


    Command > explain select * test where c1 = 'LUCY' and c2 = "ABDELLAH.

    Query optimizer plan:

    STEP: 1
    LEVEL: 1
    OPERATION: RowLkRangeScan
    TABLENAME: TEST
    IXNAME: TEST
    INDEXED CONDITION: TEST. C1 = 'ABDELLAH.
    NOT INDEXED: TEST. C2 = "ABDELLAH.

    Command >
    ################################

    By adding the status of "GOLD" in this test does not use the index.

    Is it possible for an index that includes the condition 'GOLD '?

    Thank you.

    GooGyum.

    A database can generally use indexes in this way for one 'or' with two different columns. However, for this example specific can easily rewrite the query using 'UNION' to use the relevant hints while still giving the same result (correct):

    Command > explain select * from t1 test where t1.c1 = 'LUCY' union select * test t2 where t2.c2 = "JOHN";

    Query optimizer plan:

    STEP: 1

    LEVEL: 1

    OPERATION: RowLkRangeScan

    TABLENAME: TEST

    IXNAME: TEST

    INDEXED CONDITION: T1. C1 = 'ABDELLAH.

    NOT INDEXED:

    STEP: 2

    LEVEL: 2

    OPERATION: RowLkRangeScan

    TABLENAME: TEST

    IXNAME: TEST_IDX2

    INDEXED CONDITION: T2. C2 = "ABDELLAH.

    NOT INDEXED:

    STEP: 3

    LEVEL: 1

    OPERATION: OrderBy

    TABLE_NAME:

    IXNAME:

    INDEXED CONDITION:

    NOT INDEXED:

    STEP: 4

    LEVEL: 2

    OPERATION: UnionMergeSort

    TABLE_NAME:

    IXNAME:

    INDEXED CONDITION:

    NOT INDEXED:

    Maybe you can apply something similar? If you know that there is no possibility of duplicate lines then you can optimize it (in terms of performance) by using UNION all.

    Chris

  • Is it possible for first Pro CC hide the automatic backup window

    Is it possible for first Pro CC hide the automatic backup window, without turning off autosave function?

    When such a device is save you wonder why you wouldn't be able to do everything that is the case in the car.

    I'm guessing you want automatic backup in the background?

  • Where is the options bar for what I can change the size of the Eraser tool?

    Where is the options bar for what I can change the size of the Eraser tool?

    Double-click on the eraser in the tool palette.

  • Where can I find the settings in acrobat reader for iPad can I change the title of my review I put by mistake on first use?

    When can I find settings in acrobat reader for iPad can I change the title of my review I put by mistake on first use?

    Hello

    "my comment title" - you hear a "name of the author?

    To change a name of author

    1. Go to the home screen of your iPad.
    2. Tap the settings icon/button.
    3. Scroll down to find "Adobe Acrobat" in the left pane.
    4. Tap on "Author's name" in the right pane.
    5. Enter a new name.

    Please let us know if you have any additional questions.

  • I have a Standard Adobe Creative Suite 6 Design and Teacher Edition download for Windows, can I change the Mac platform?

    I have a Standard Adobe Creative Suite 6 Design and Teacher Edition download for Windows, can I change the Mac platform?

    You can ask to Exchange languages/platforms for a newer version product if you follow the instructions on the following link:

    l http://helpx.adobe.com/x-productkb/Policy-Pricing/Order-Product-Platform-Language-swap.htm

  • How to dynamically change the selection mode of the listbox control?

    Hello everyone

    Is it possible to change the selection mode of the ListBox dynamically?

    Both cases to the attached vi works the same way. I want the listbox to change the mode of selection by 1 point when the channel selected in the drop-down list box is SET.

    Can anyone help please?

    Thank you

    Simo

    There is a property for Listboxes node called selection Mode.

    Do not use the control Terminal in one case and a local variable of it in the other.  Moving the Terminal outside the structure of matter and son in the structure of the case.

  • Cannot change the Compatibility Mode

    I'm trying to run an application on a new Windows 7 PC.  It works fine with no special settings on a Windows 7 PC identical (same model number, same OS, same OS updates).  But on the second machine Windows does not allow me to change the compatibility mode to Windows 7.  He insists on locking myself in other compatibility modes and greys and then the selection to return to Windows 7.  Worse, whenever I run the program I have to answer the nattering question "do you want the next request to make changes to this computer?  -Yes!  No matter what!  just, let me alone and run the application!

    (1) how do stop this Moguls and force Windows 7 leaves me alone and run the application?

    (2) how set the compatibility mode to Windows 7 (or eliminate the comaptibility altogther mode) for this application?

    I've uninstalled and reinstalled the app several times with no luck.

    Yes, lowering the UAC slider leaves your pc more reports unprotected, which was why I mentioned only use it as an experienced user (.. .knowing your way around your pc...)

    This problem only occurs with the .exe in question btw?

    You can still work around a problem in the registry. I found this (below) on several sites. Before you begin, I STRONGLY suggest that you make a backup of the registry . How? Type regedit in the search bar in the startmenu, then press on enter, confirm the UAC, click file-> export, choose a file name and choose where you want to save the exported .reg file, select (dot) all under Export range option, type a name for the .reg file and click on the Save button.
    ! The registry is not a place for fun if you know exactly what you are doing. You will have to pay dearly if something goes wrong!
    You can access the registry by typing regedit in the search bar in Startmenu, but you probably already know.
    ___________________________________________________________________________________________________________________________________

    All settings in the Compatibility tab can be set through the registry

    -Open REGEDIT
    -goto "HKEY_CURRENT_USER\Software\Microsoft\WindowsNT\CurrentVersion\AppCompatFlags\Layers".
    -create a new string value
    -name or rename the full path asked for example "C:\Program Explorer\iexplore.exe may.
    -Right click on the new channel and select Edit
    -type RUNASADMIN in line with value data; This will rank the program to run as administrator.
    This allows you to bypass the graphical mode of editing the parameters. Instead, you change the registry settings. And of course, you can ignore the advances
    The shortcut properties. Better start the program by default
    Administrator mode! : o ;)

    I used it for Internet Explorer (iexplore.exe) which is part of the
    System.

    A shortcut on the desktop can be configured to run as administrative mode.
    But, if I run the IE7 browser, leave a link URL or Favorite, that this doesn't
    work and Windows Vista it will run in User Mode... UNLESS I CHANGED
    THESE OPTIONS WITH REGEDIT. To start regedit click on Start Menu, then
    "Run...". "type REGEDIT. EXE or REGEDIT.

    Other Options and examples .
    Always in the key called a HKEY_CURRENT_USER\Software\Microsoft\Windows
    NT\CurrentVersion\AppCompatFlags\Layers you can add more variables:

    RUNASADMIN: I just said, run as administrator of the program
    : rolleyes:;
    256COLOR: run the program in 256 colors;
    640 x 480: Add this value to run a game or another application in a lower
    RES;
    DISABLETHEMES: to disable visual themes Windows 4 adds that the app;
    DISABLEDWM: Disabled Desktop Composition;

    HIGHDPIAWARE: Disable the display timing of ppp settings high;

    ELEVATECREATEPROCESS: I don't know, unknown function. : confused:

    VALUES of COMPATIBILITY (not use'em together, only by app!):
    Win95: Add the Windows 95 compatibility mode;
    Win98: Add Windows Me or 98 compatibility mode;
    NT4SP5: Mode NT 4.0 Service Pack 5 Com;
    Win2000: Tap to add compatibility mode Windows 2 K;
    WINXPSP2: Windows XP Service Pack 2 Compatibility Mode;
    WINSRV03SP1: Windows Server 2003 SP 1 com mode

    Windows also creates these chains of the option when you change the compatibility
    Settings in the properties of the selected executable (graphics mode is not
    Regedit mode).

    Found on: Forums.techarena
    ____________________________________________________________________________

    REGEDIT IS AWESOME, BUT USE IT AT YOUR OWN RISK! Start with a registrybackup!

    Good luck and we keep informed please!
    Error. Not found on keyboard. Press F1 to continue...

  • Change the Notification sounds

    I would like to change the notification sound for messages on my MacBook Air? I can't understand it.

    Launch Messages.

    Messages > Preferences > General > "his Message received:

    Click the box next to 'Sound Message received' and choose the sound you prefer.

  • I used my iMac as a hard drive backup to my macbook once. Now when I update to El Capitan he says that it cannot be updated due to being of a backup. How do I change the drive mode so I can update?

    I used my iMac as a hard drive backup to my macbook once. Now when I update to El Capitan he says that it cannot be updated due to being of a backup. How do I change the drive mode so I can update?

    If you use your iMac as a backup to disk using Time Machine look for a folder called Backups.backupdb.

    It's what keeps you upgraded your operating system, you must remove it.

    Copy everything first if you are on a different drive. It would be wise to create a backup of the iMac on another drive also.

    Check system preferences > Time Machine and make sure that the iMac is not selected as the Time Machine drive.

  • Problem with the files not showing (after changing the USB mode)

    I have a sansa fuze 4 GB. version V02.01.09A. OS: Vista Service Pack 1. My rocket was working fine until about a week ago, when it stopped charging. but after installing the new norton 360 sansa is more appeared in my computer or Windows media player at all. I tried updating the driver but it says that the pilot was already up to date. I tried other USB ports again (front and rear), did not work. I decided to change the USB mode and it has finally started to load again in MSC mode.

    now, for the problem I currently have and, when I click on sansa via my computer and go to the music folder, it says "this folder is empty". I unplugged and watched in my music list, and all the music is there. I tried to put a new song on the player, disconnected, and when looking through the songs of the player the new song is here. I reconnected it, the new song is in the music folder, but the other songs are not listed. In addition, I have a microSD card that is listed as "o" in the car, all the songs I had on this appear, but not those on memory internal to the sansa.

    How can I get again list all music files in the folder?

    Note: I do not sync as it has only some of the songs I want on my sansa. the way I add songs is to copy and paste to the folder of the sansa player

    Okay, I don't know why or how, but it works now in MTP mode. I saw you are solutions, but I decided I'll just change the mode before trying to have ideas. until I reconnected it I also removed the microSD card, and it worked perfectly (make a backup of my songs). the problem could have the sd card in all this time?

  • Call method or the third part of the application in the Notification bar.

    Hi all!

    I wonder if it's possible to start a third-party application, or call a method in an application in the notification bar if it has an icon shown here?

    My app puts an icon there, without a message and I need to click on it to launch a different application or to call a certain function in my application (which runs in the background).

    I did a lot of research and seem to get that he cannot be but no evidence tangible that it cannot be done. I must add an Inbox and the listener and start an application of third party like this, when a user clicks on a message?

    Thank you.

    You can use
    http://www.BlackBerry.com/developers/docs/7.1.0api/NET/rim/device/API/system/ApplicationManager.html
    to launch other applications.
    to call your own application, I would suggest sending a global event (using the same class)

  • Change the SATA mode in Windows 8

    I'm moving to sata IDE to RAID mode in Windows 8 in order to avoid the re-formatting my hard drive. The solution in Win7 (update registry KEY in regedit does not work). Any advice?

    With all due respect, Srivinvasa Sharath, your answer is very useful.  The question is not ' how can I change the SATA mode in my BIOS?  But, on the contrary, assuming I already know how to change the SATA in my BIOS mode, how Win8 to accept this change and actually start correctly.  There is a guide on how to proceed for Win7, but it doesn't work for Win8.  So we would know what to do differently with Win8 to make it work.

    Here is a link to the article corresponding Win7 so you will see what is asked:

    http://support.Microsoft.com/kb/922976

Maybe you are looking for