SystemDialog in long running headless app

Hello

10.3.1 I have a use case where I need to display a popup when a condition is met. The app may not run at the time when the condition could be filled.

I looked at the following statement of the documentation

«Apps headless supports dialog boxes at a later version of the SDK or API 10.3 level native BlackBerry 10.» Single system dialogs, such as SystemDialog, are supported. »

on the page

https://developer.BlackBerry.com/native/documentation/Cascades/device_platform/headless_apps/index.h...

In this case, I modified the existing sample to take advantage of the SystemDialog but I don't see the dialog box when I installed the app (part of the user interface) since the outbreak in the part of the user interface for the headless is as follows. Any ideas?


application.headless
Reminder service
ReminderService

bb.action.system.STARTED
application/vnd.blackberry.system.event.STARTED



com.example.ReminderService.RESET
*


Here's the part without the project: service.hpp

#ifndef SERVICE_H_
#define SERVICE_H_

#include
#include
#include

bb {} namespace
Application class;
namespace System {}
class InvokeManager;
class InvokeRequest;
}
}

Class service: public QObject
{
Q_OBJECT
public:
Service();
Virtual ~ Service() {}

public slots:
void onDialogFinished (bb::system:ystemUiResult::Type type);

private slots:
void handleInvoke (const bb::system:InvokeRequest &);)
void onTimeout().

private:
void triggerNotification();

BB::System:InvokeManager * m_invokeManager;
BB::System:ystemDialog * m_dialog;
};

#endif / * SERVICE_H_ * /.

Here is the service.cpp

#include "service.hpp".

#include

#include

#include

#include

#include

#include

using namespace bb::system;

Service:ervice():

QObject(),

m_invokeManager (new InvokeManager (this))

{

m_invokeManager-> connect (m_invokeManager, SIGNAL (called (const bb::system:InvokeRequest &)),)

This, SLOT (handleInvoke (const bb::system:InvokeRequest &)));))

m_dialog = new SystemDialog ("Save as", "Discard changes", "Cancel");

m_dialog-> setTitle ("save changes");

m_dialog-> setBody ("save your changes and close the document?");

m_dialog-> setEmoticonsEnabled (true);

m_dialog-> setModality (SystemUiModality::Global);

Connect the finished() signal to the onDialogFinished() location.

The slot will check the SystemUiResult to see which

button has been operated.

Boolean success = connect (m_dialog,

SIGNAL (finished (bb::system:ystemUiResult::Type)).

This,

SLOT (onDialogFinished (bb::system:ystemUiResult::Type)));))

If (success) {}

Signal has been connected successfully.

Now, display the dialog box in your user interface.

onTimeout();

} else {}

Unable to connect to report.

This is not normal in most cases and can be a critic

situation for your application! Make sure you know exactly why

What happened. Add code to retrieve from the

interruption of the connection under this line.

m_dialog-> deleteLater();

}

}

cancel the Service:nDialogFinished (bb::system:ystemUiResult::Type type)

{

If (type is SystemUiResult::ConfirmButtonSelection)

{

qDebug()< "dialog="">

The user accepts the dialogue.

}

else {}

qDebug()< "dialog="">

The user rejected the dialog box.

m_dialog-> deleteLater();

}

}

void Service::handleInvoke (const bb::system:InvokeRequest & request)

{

If (request.action () .compare ("com.example.ReminderService.RESET") == 0) {}

triggerNotification();

}

}

Sub Service: triggerNotification()

{

Time-out is to give time for the user interface to minimize

QTimer::singleShot (2000, this, SLOT (onTimeout (()));

}

cancel the Service:nTimeout()

{

m_dialog-> show();

}

Join the discussion at
http://supportforums.BlackBerry.com/T5/native-development/SystemDialog-in-headless-part-in-10-3/TD-p...

Tags: BlackBerry Developers

Similar Questions

  • HTTP access from a long running headless app

    Hello

    I have a requirement for an application that runs without head 24/7 and must sometimes make remote HTTP connections without user interaction.

    Could you please tell me if this is possible thanks to an application without head and point me to the api correct?

    Thank you

    Ray

    you don't know.
    the api is the same as always, usually QNetworkAccessmanager etc.

  • Long-term headless app work: QTcpSocket receive do not

    We have an app without long-term head that uses sockets for IPC.

    Headless part contains a QTcpServer, the user interface of the QTcpSocket.

    the code without a head:

    server = new QTcpServer(this);
    bool ok = connect(server, SIGNAL(newConnection()), this, SLOT(onNewConnection()));server->listen(QHostAddress::LocalHost, m_port);
    

    user interface code:

    bool stateOk = connect(clientSocket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(onStateChanged(QAbstractSocket::SocketState)));
    if (!clientSocket->isOpen()) {
        clientSocket->connectToHost(QHostAddress::LocalHost, m_port);
        bool conOk = connect(clientSocket, SIGNAL(connected()), this, SLOT(connected()));
        bool disconOk = connect(clientSocket, SIGNAL(disconnected()), this, SLOT(disconnected()));
        bool readReadOk = connect(clientSocket, SIGNAL(readyRead()), this, SLOT(commandReceived()));
        bool errorOk = connect(clientSocket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(error(QAbstractSocket::SocketError)));
        Q_ASSERT(errorOk);
        qDebug() << "connected to server socket";
    }
    

    output debug shows headless headless app is running constantly, the signal is properly connected, the socket for the server returns isListening() to true.

    debug output of the user interface shows that all signals are correctly connected, and onStateChanged goes from HostLookupState to ConnectingState and finally to ConnectedState

    At this point, I'd wait the server socket to pull the signal of newConnection, but alas, it isn't.

    I generate and run the xandos example and it works correctly, but it does not long-term use and has the server in the user interface, while the part without head connects.

    I suspect that the app without head doesn't have an event loopand QTcpServer documentation states:

    Although QTcpServer is mostly designed for use with an event loop,it's possible to use it without one.In that case, you must use waitForNewConnection(),which blocks until either a connection is available or a timeout expires.
    

    Now I wonder:

    The long March without head app has an event loop?

    If this is not the case, how best to use the blocking call without disabling the rest of its features? A thread?

    Write that post little got me on the right track already, a problem merging caused the socket to the server must be started before you call the constructor of the Application (which provides the event loop).

    Now the server is running, receive a few orders, then she stops unexpectedly, the fires of the user interface
    QAbstractSocket::RemoteHostClosedError changes the State of ClosingState and UnconnectedState

  • Reinstal Cloud but not uninstal not possible as long as the app running, but not other applications in the Task Manager

    Hello

    I need to reinstall the Cloud but uninstal is not possible as long as the app running, but not other applications in the Task Manager.

    Windows 7

    Uninstaller: "another version of office of creative cloud or an installer Adobe is running...". »

    TaskManager: browser runs only.

    Windows Installer / change: "unable to désinstaller creative cloud to desktop. You still have creative Cloud computer applications that need it.

    So, how I re install this, thank you

    Safe mode using the application of Creative Cloud Uninstaller has worked.

  • CS5 apps must be uninstalled to run CC app? Seriously! ??

    OK, I'm furious. I tried to sync some fonts and realized that I had to run CC app. I find that it is no longer loads and Adobe solution is to 'uninstall' CS5 apps. Seriously! I trust AI CS5 because it works better than any of the Illustrator programs later, IMHO.

    Now I am at a crossroads, and I drop the best AI ever made Adobe app or sacrifice for "compatibility" with the losers? I'm more than a little ticked right now.

    You need not uninstall CS5 to launch the CC app.

    That's what I have now:

    But in case you should make a serious cleaning, you must uninstall all Adobe applications on your system. Has always been the case (I remember that I had to do this 2 or 3 times with all my Creative Suites at the time of CS4 and CS5 and I always wanted to have all installed versions that would go even on my system).

  • How to stop a script of long-run, or leave in the first place?

    How to stop a longrunning script to stop or start in the first place. It does in itself. I don't know what it is. The only reason for which we know that it is running is because from time to time, we get a box popping up to say something like "this can't start/work due to a long-running script. Is this something that is important for our computor or is she something harmful, or simply unnecessary?

    Hi Anna-KarinEdvardsson,

    1 did you change on your computer before the show?

    2 are. what scripts you referring?

    3. when exactly the script starts?

    I suggest you to set the computer to clean boot and check how it works.

    To configure the computer clean boot, follow the steps in the below link:

    How to perform a clean boot

    Note: After the installation of updates to the clean boot follow step: 7 article to reset your computer to normal startup.

  • Error: BT Yahoo is not available due to a long-running script. How can I remove it?

    Original title: a long-running script

    Why constantly to make the message-' BT Yahoo is not available due to a long-running script.

    How can I remove it?

    Why constantly to make the message-' BT Yahoo is not available due to a long-running script.

    How can I remove it?

    a. on the Tools menu, click Internet Options.

    b. on the Advanced tab, click to select the checkbox disable the script debugger .

    c. click OK

    Error message: "a script on this page slows down Internet Explorer runs slowly.
    http://support.Microsoft.com/kb/175500/en-us

    How to resolve script errors in Internet Explorer on Windows computers

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

  • I frequently get a pop up that says "' web page addresses do not cause of long-running script." "

    * Original title: pop ups

    I frequently get a pop up that says "' web page addresses do not cause of long-running script." "  It's maddening.

    It's all web sites that do, or just a specific or both? If its just one or two sites, try them as 'compatibility mode' - http://windows.microsoft.com/en-US/internet-explorer/use-compatibility-view#ie=ie-11

    If this does not help, it occurs to these sites if you run IE (assuming you're using IE) "mode without modules? ( [Internet Explore (No. Add ons)])

    If still no joy, then see if anything in this article allows --- https://support.microsoft.com/en-us/kb/308260#cause it is a long read but has a few things to try for script errors in Internet Explorer.

    The default base heal - use another browser like Mozilla Firefox - https://www.mozilla.org/en-US/firefox/new/

  • I wore a work Application TV live Android-based BlackBerry App. When I run the app on simulator.iam BB10 see the following error

    When I run the app it shows first of all my wallpaper or the Welcome screen

    as shown in 1st.jpg

    Then after a few seconds, second page will display the page connection as 2 .jpg

    After loggin with my facebook account it will show the list of channels like 3rd.jpg

    as below

    When I click on the above content as stated in the 3rd.jpg

    IAM, seeing the error as below: correct my problems and guide me how to run my application perfectly.

    You must test with the Simulator 10.2 as well, absolutely.

    Yes, you need to download Android 2.3.3. Since the SDK Manager.

    Then, choosing it as a target in the properties for your project you can expect to get compilation errors. It will indicate the parts in the source code that must be changed or adapted to be compatible with the level of the API 10, respectively to allow your application Android runs correctly on the 10.1 BB Android Runtime (and probably on PlayBook as well).

    Here you have an article about it on the ActionBar compatibility in Android:

    http://blog.imaginea.com/Android-handling-ActionBar-compatibility-issues/

  • BB10 - graphics issues running several app

    Hello

    I have seen this in the past on older versions and even with the latest OS version 10.0.9.2320 I got graphic problem running multiple app at the same time. Is this a general bug in the graphics driver from the OS or something like that, or a problem in the framework? Here is a picture of how it looks like a test application:

    We have a Twitter on that as well.  Alpha Dev devices have limited memory relative to gold OS running on production BB10 cameras.

    It is a known current limitation of DevAlpha devices and I can assure you that this does not happen on production equipment.

  • IM related to Adobe Creative Cloud, but I can't connect. When I run the apps, said that I did not. License does not work

    IM related to Adobe Creative Cloud, but I can't connect. When I run the apps, says that I don't have license, license does not work.

    Your subscription to cloud shows correctly on your account page?

    If you have more than one email, you will be sure that you use the right Adobe ID?

    https://www.adobe.com/account.html for subscriptions on your page from Adobe

    .

    If Yes

    Sign out of your account of cloud... Restart your computer... Connect to your paid account of cloud

    -Connect using http://helpx.adobe.com/x-productkb/policy-pricing/account-password-sign-faq.html

    -http://helpx.adobe.com/creative-cloud/kb/sign-in-out-creative-cloud-desktop-app.html

    -http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html

    -http://helpx.adobe.com/creative-suite/kb/trial--1-launch.html

    -ID help https://helpx.adobe.com/contact.html?step=ZNA_id-signing_stillNeedHelp

    -http://helpx.adobe.com/creative-cloud/kb/license-this-software.html

    .

    If no

    This is an open forum, Adobe support... you need Adobe personnel to help

    Adobe contact information - http://helpx.adobe.com/contact.html

    Chat/phone: Mon - Fri 05:00-19:00 (US Pacific Time)<=== note="" days="" and="">

    -Select your product and what you need help with

    -Click on the blue box "still need help? Contact us. "

  • I have adobe CS3 installed on macbook pro, but he said that the license has stopped working... I then went to your website and he advised me to download the license recovery application, which I did, but then when I tried to run this app, it then came wi

    I have adobe CS3 installed on macbook pro, but he said that the license has stopped working... I then went to your website and he advised me to download the recovery of license application, I did, but then when I tried to run this app, it then came with the recovery of the license was not based... How can I get my CS3 works again?  Thank you, Glenn

    Hello

    Please check the help below documents depending on your operating system:

    Error: "License has stopped working". Windows

    Error "Licensing has stopped working". Mac OS

    Hope that helps!

    Kind regards

    Sheena

  • I want to uninstall my new imac CS4, because CS4 is no longer running.

    Hello, I want to uninstall my new imac CS4, because CS4 is no longer running.

    The problem is: before I sold my old mac, I put all programs in the trash, without no deinstalltion.

    The new mac is installed with a backup and so, if I want to run photoshop, par example, I get this:

    Bildschirmfoto 2015-02-13 um 15.42.57.png

    ... and so its impossible for me, uninstall CS4.

    Can someone help me?

    Excuase my bad English:)

    Error "Licensing has stopped working". Mac OS

  • Disable the input from the user during the long running process

    Hello

    I use JDev 11.1.1.4.0.

    When the user clicks on the 'save' button, I have to call a procedure stored prior to validation. This procedure takes about a minute to complete the race. My problem is, while the process is running, the user can click or change the values in the page. Is there a way to lock the page until the process is complete and ok to return control over the user?

    Thank you

    Bones Jones

    Another example:
    http://www.gebs.ro/blog/Oracle/Oracle-ADF-glass-pane-for-blocking-user-input-in-case-of-long-running-tasks/

    Thank you
    Nini

  • Porting background running Android app with BB 10

    I developed an Android application that is compatible with Android API 9 and later. I'm back running the process as a service to Android. When I try to wear this Android app, I found that this background serveice has some problems. Is that BB 10 development Android Runtime supports no backgroung services again?

    imre_m wrote:

    Hello

    There is no support to run background services. Applications can be run services too long that the user is running, full-screen or in thumbnail mode.

    They are little supported (they are just services as much as android is concerned, and if they run in the background is a property of the system).  This player says Android can and will termininate in scenarios you can not see them terminated on stock Android (i.e. If you close the shell of your application window).

Maybe you are looking for

  • security update 2016-001 safari and mozilla, not loading pages

    After updating my Macbook with security update 2016-001 and Safari 9.0.3 update the two Mozilla and Safari browsers are extremely slow. Some pages won't load at all. I tried to boot from a boot on an external hard disk drive before the updates and th

  • my wood recognizes my drive hard ide but my dosent XP windows

    my wood recognizes my drive hard ide but my dosent XP windows

  • (Redirected) Out of stock

    I ordered an Xbox on 12/02/2014, I am fully aware that it is a hot vacation spot. Initially, the confirmation e-mail informed that I would get my order delivered the or before 12 08, 2014. I got 2 emails telling me that there is a delay from the orig

  • Decimal QString

    Hi, I have a qstring to a temperature of a Json online data, but sometimes he send me decimal two or tree and I want just the exact number, how I format hide or round off the number

  • Files between Windows XP and Windows 7 compatibility

    To top form, I think Windows XP 32-bit Windows 7 64-bit. I have Adobe InDesign and Photoshop for a desktop publishing. All the work is stored on a separate hard drive E:. My question is after I have to do a clean install of Windows 7 on drive C: and