View dialog box on powerUp()

Hello

I am building an app that does not have a graphical user interface and runs in the background. The application uses PhoneListener to interrupt a call and create a new one in its place. Since I have no GUI I cannot send the keystrokes required to phone until after a dialog box is displayed (either a dialog box, asking permissions of the Application, or by changing the OptionsProvider). What I want to do, it's just pop up a dialog on startup so I can then inject my shots to end the call.

Here is my code:

public class GVIntercepter extends UiApplication implements SystemListener
{
    public static void main(String[] args)
    {
        // register an options provider
        GVIntercepterOptionsProvider provider = new GVIntercepterOptionsProvider();
        OptionsManager.registerOptionsProvider(provider);

        // register a phone handler
        PhoneHandler phone_handler = new PhoneHandler();
        Phone.addPhoneListener(phone_handler);

        GVIntercepter instance = new GVIntercepter();
        // instance.enterEventDispatcher();

        if( ApplicationManager.getApplicationManager().inStartup() ) {
          // Add a system listener to detect when system is ready and available.
          instance.addSystemListener(instance);
        } else {
          // System is already ready and available so perform your start up work now.
          // Note that this work must be completed using invokeLater because the
          // application has not yet entered the event dispatcher.
          instance.doStartupWorkLater();
        }
        // Enter the event dispatcher.
        instance.enterEventDispatcher();
    }

    //Invoked when the user is putting the device into a power off state.
    public void powerOff()
    { }

    //Invoked when the device has left the power off state.
    public void powerUp()
    {
      Application.getApplication().removeSystemListener(this);
      doStartupWork();
    }

    //Invoked when the internal battery voltage falls below a critical level.
    public void batteryLow()
    { }

    //Invoked when the internal battery voltage has returned to normal.
    public void batteryGood()
    { }

    //Invoked when the internal battery state has changed.
    public void batteryStatusChange(int status)
    { }

    private void doStartupWork()
    {
      // Perform your start up activities here!
      Application.getApplication().invokeLater( new Runnable() {
        public void run() {
          Dialog.ask(Dialog.D_YES_NO, "Display?");
        }
      } );
    }

    private void doStartupWorkLater()
    {
      Application.getApplication().invokeLater( new Runnable() {
        public void run() {
          doStartupWork();
        }
      } );
    }

    public GVIntercepter()
    {    }
}

I tried almost everything to get the dialog box to display and I am at a loss here. Any ideas?

Also, I'd be open to suggestions on power sending keystrokes to a background application in the phone app and use PhoneArguments to call without displaying any prompt at all.

I never thought seriously about doing something like what you're trying to do, so I'm sorry this isn't a complete answer to your questions.  You may use these details to get a little further though.

You say that your app is a bottom up, however you have extended UiApplication.  If your application is treated as it displays a screen of the user, but you never insert a screen, if your application never gets thrust in the foreground.  You will find that, once you started with your current code, your icon is available in the Task Switcher (ALT + ESC) and if you swap to your application, your dialog box is there to be seen (on a white background, as any UiApplication).  Try it and see.

You can replace your code in doStartupWork() with something like the following, so that you can see actually started.  Try this and then see what happens when you select your application by using the Task Switcher after you answer your dialog box (note I use UiApplication rather than on request, simply because the code you call later should a UiApplication to run.  Your code works really because you have found your own application, which is currently spreading UiApplication.  If you change it to extend the Application instead, then you will get a UiApplication.

      UiApplication.getUiApplication().invokeLater( new Runnable() {
        public void run() {
            UiApplication.getUiApplication().requestForeground();
            Dialog.ask(Dialog.D_YES_NO, "Display?");
            UiApplication.getUiApplication().requestBackground();
        }
      } );

I suspect that you really want to be a background application.  In this case, you extend Application rather than UiApplication.  Then, to bring something to the attention of the user, you can use UIEngine, as shown here:

How - to alert a user to a background application
Article number: DB-00407

http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800608/...

Alternatively, you can do what you do, stick your phone earpiece in place, then the UiApplication, the output is not in the Task Switcher.   Even if you have left your UiApplication, your hook is still in place and can still do something.

I have a point more than related.

You are actually setting up an earpiece of phone.  When this listener is controlled, it will run the app phone, not your Application.  This application has a GUI, then maybe you need not to use this dialog box "to access a graphical interface.

Sorry, as stated, I never really looked seriously to do something like what you do, then I do not understand everything and maybe you have this covered.  Bit I hope this helps.

Tags: BlackBerry Developers

Similar Questions

  • View dialog box in greek

    Hello

    How to display the dialog box in Greek, as well as Dialog.No of Dialog.YES & appears as in Greek and not in English?

    RET = Dialog.ask (Dialog.D_YES_NO, "Are you sure?", Dialog.YES)

    Thank you

    If you mean the button labels. You must use this kind of code:

    Dialog d = new Dialog(messages.getString(MY_QUESTION), new Object[]{messages.getString(YES), messages.getString(NO)}, new int[]{Dialog.YES, Dialog.NO}, Dialog.YES, Bitmap.getPredefinedBitmap(Bitmap.QUESTION));
    

    It requires small changes to compile.

  • Adobe Reader XI print obscured by the task bar in IE dialog box

    When using Internet Explore 11 with Adobe Reader XI and try to show the causes of dialog box print dialog windows to be positioned in the lower left corner of the screen every time.  Positioning of the print in a neighborhood view dialog box is not known.  Whenever the print to Adobe within Internet Explorer dialog box is used, the dialog window is displayed again in the lower left corner of the screen.

    I tested this problem on Windows 7 32/64-bit and 64-bit Windows 10.  Adobe Reader 9 running on Windows 10 machine under the same senerio does not trigger this action, but is rather the print dialog box squarely in the middle of the screen where it belongs.

    !cid_ii_154769406b2d1676.png

    I found a few other reports of this behavior mentioned elsewhere, but no one has an answer on how to fix this problem.

    Hi Tariq,

    Thanks for your effort / suggestion.

    I tried this on three machines to test with any changes noted.

    The print dialogue box displayed in Firefox and Google Chrome are displayed normally.  Well well, the less usable.  The problem is related to Internet Explorer 11 in combination with XI Adobe and Google Calendar.

    During this phase of testing, however, I open PDF files in Internet Explorer and launched the Adobe printing functionality without worries, it is shown in this first assignment.

    So now, I'm leaning more that it's a matter of Google Calendar.

    D

  • How to use the view 'cover flow' in an open file dialog box?

    I often post pictures, such as screenshots, Web - like the one I included here!

    I always use "cover flow" as an aid to make sure that I'm the one that I want to load the download.

    In El Capitan, I see "cover flow" in the Finder, but not in a file open dialog box. How do I access view 'cover flow' in the open file dialog boxes? I have to use a preference somewhere to add it to the toolbar, or what?

    In the Finder, go to view, and then customize the toolbar and made drag the point of view of the toolbar window you Finder.

  • TDMS files viewer used in a dialog box

    I would use the viewer of TDMS files within a VI dialog box. The problem occurs if I change the properties of the VI - appearance of window - window modal behavior (it should be modal).

    When I click the button and run the viewer of TDMS files become two modal windows (my Viewer file VI and PDM) and 'lock' to the other: I can't control any of them.

    Is it possible to use the viewer of TDMS files as a dialog box?

    Thanks in advance,

    Ljubo.

    We remember, made you changes to a copy of the TDMS files viewer and not on that of VI.lib. With a upgrade/reinstall of LabVIEW, you will forget this small change, and you're back to square one.

    Tone

  • How can I get a "Détails" view - as the default - when you download a file, in the dialog box "enter the name of the file to save on...» » ?

    When I get an attachment to an email (using Zimbra Imail, Firefox, Windows XP Pro) and I click on it and select 'Download', I get the dialog box "enter the name of the file to save on...» "(because I already have the option"always ask me where to save files. "But the view of default file always in a 'list '. At least recently. I don't remember it always does this. In any case, I want the value default to a 'Détails' view, in ascending order, I can find then things so much faster that way. (I often use the 'Update' tab to bring up, the latest version of a file.) I know that I can go to the Menu 'view' icon and select 'Détails', but whenever I go in a sub-folder in this dialog box, I have to do this all over again and it wastes a lot of time and attention.

    I did some research on the internet but have not found a way to solve this problem.

    Try this:

    a. open my documents, press the alt key.

    b. click on Tools. Click on folder options.

    c. click on the view tab and select Reset and check records.

  • Harassed by "save changes" dialog box in PHP file Live View on DW CC 2014?

    Hello

    I am being constantly harassed by the dialog "save changes to < document name >' when I'm working in Live view on DW CC 2014. Every time I have changes to the code, especially if I use the properties toolbar, I was immediately prompted to save the changes. I realize the rendering system account must have a recorded document to view from, but this happens after every single little change. If I look at watching the live view and decide to make some changes to the code I can get invited several times while I make these changes and it is not until the changes are finished I want to check live view again (when I save the document), but I have to keep stopping to reject dialogue! This means that I must keep turn off live view to make relatively small changes, and then turn it back on.

    I've always been able to work OK in this way on all previous versions using the 'Preview using temporary file' parameter, but this version works the same way. I'm not bothered if I save the file when changes are made in order to update the live view, so just remove the dialog box would be a decent solution.

    Thanks for any help

    Hello

    Turn it off in "View > Live View Options"... automatically uncheck "synchronize remote files.

  • View of the AppleScript dialog box not turn

    Hello

    I have the following Applescript, defined as the first step of a folder automator action.  When the two files in the folder, a display dialog box is supposed to pop up.  It works, but for some reason that the dialog box is not selected, so I have to click on it first, before I can enter data.  It's tedious because I use a scanner barcoder and want him to be able to enter information in the dialog box without clicking each time.  Any ideas as to what is wrong?

    Thank you!

    value of ' Macintosh HD:Users:christian:Pictures:Photo Booth library: photos:

    Tell application "Finder".

    Define filenumber as of (files in the folder appear)

    tell the end

    If filenumber is equal to 2, then

    display the default dialog response «Serial number "«»

    SerialNumber Set text returned of the result

    Returns the number of series

    on the other

    tell me to stop smoking

    end if

    When I run your AppleScript under workflow action unique in a file Automator action, the dialog box will prompt you for a serial number, and as text entry already has the focus, all I have to do is type the serial number, then press return. Tested: OS X El Capitan 10.11.2.

  • Unable to select the file in the dialog box in the Sierra

    I'm unable to select an image file in the "save for Web" in the finder window "save under" in Photoshop CC running on the Sierra.

    There are times where I need to save a new image using a similar name by selecting the existing file, which matches the name in the dialog box "save under".

    The use of Photoshop CC in Sierra I am unable to do so due to the inability to select the existing files in the Save-as the finder window.

    I thought at first that was Adobe, but later, I noticed that I can not save for web browsers and other programs. I installed the beta updates on Sierra, but also which did not set. I hope be fixed so I can move on to Sierra. It was not such a problem in previous versions.

    Unfortunately, your discovery is correct. I just met for the first time. I was shocked, but apparently it will work in list view. View miniature not a reason any.

  • How can I replace the mime types of server, always get the mp3, rar, sid, bin files directly in the dialog box "where do you want to save this file?"

    I used to be able to click on MP3 files, the way back when, and Firefox asks where I wanted to save. Nowadays, it opens a new tab with a flash drive.
    By clicking on the "unknown" files, like .sid, .prg, .zip, .rar is ' this is a BIN file. [Cancel] [Save] ». It does not give me a check box for "always do this".
    I would like that option to edit so that certain types of files, such as PDF, regardless of mimetype, always get opened in a new tab if you click. Also some types of files, based on the extension, always go directly to the dialog box "Where you want to save the file?", without worrying if there is a viewer or a builtin player or not. In my Firefox (41.0.1 14.04LTS 32-bit Ubuntu) I have never the choice "do this for these files always" more.
    Googling led me to delete my file mimeTypes.rdf and since file extensions can even "well known", such as .zip, are treated as BIN files and I get the box Cancel-or-Save for those too - again without the choice of "always save the BIN files.

    These files are send as Content-Type: application/octet-stream and Content-Disposition: attachment;
    To send files in this way, you cannot save an automatic action.
    You can see that in network monitor.

    Content-Disposition: attachment; filename="TURRICAN_AMIGA_PORT.sid";
    Content-Type: application/octet-stream
    
  • Dialog box "Bookmark all" is HUGE!

    I have the version 40.0.3 of FireFox running on a Dell XPS under Windows 7 Home Premium laptop.

    When I right click on a tab for "bookmark all tabs" in a window, the dialog box that opens is really long and thin... I want to say, "scroll across the width of the page a couple of times" for a long time. (I think that the box is 150px high and almost long 4000px.)

    What's more interesting? This box goes more often I bookmark stuff.

    Whassup?

    Jason A Schulz

    Wow, that should not happen.

    Sometimes, the file that contains the sizes of window and the dialog box becomes corrupted with dimensions of nonsense. As it is difficult to change, we recommend usually rename this file and have Firefox rebuild. Here's how:

    Open the settings folder (AKA Firefox profile) current Firefox help

    • button "3-bar" menu > "?" button > troubleshooting information
    • (menu bar) Help > troubleshooting information
    • type or paste everything: in the address bar and press Enter

    In the first table of the page, click on the view file"" button. This should launch a new window that lists the various files and folders in Windows Explorer.

    Leave this window open, switch back to Firefox and output, either:

    • "3-bar" menu button > button "power".
    • (menu bar) File > Exit

    Pause while Firefox finishing its cleanup, then rename xulstore.json to something like xulstore.old. If you see a file named localstore.rdf, rename this to localstore.old.

    Launch Firefox back up again. Normally, the dialog box appears again.

    Oh, I should mention that this can turn off the menu bar and the bookmarks toolbar. To activate the different bars on and outside, you can use one of the following methods to view the list of the toolbar, and then select the desired bars it:

  • Why Firefox doesn't open the printer dialog box whenever it starts

    When Firefox opens the printer dialog box opens automatically - why and how can I make sure that he does this.
    This never used to happen on previous versions of firefox

    Some web pages automatically shows the print dialog box. In particular, the pages Web sites have specially formatted for printing can do.

    Restore you tabs that you have opened previously, or commissioning with your home page (s)? I suspect that one of them generates the dialog box. You can view by clicking on each of them and reload the page to see if it's on this page.

  • Weird shared Variable dialog box message

    I came across a strange in the dialog box behavior, while I created a new shared variable.

    That I was typing in the name, I kept see a warning will appear in the dialog box.  It would come and go as typed.  I realized that whenever I typed a space, and it is thus temporarily the last letter in the name SV, the warning popped up.  Type the next letter, the warning would leave.  You can see the space ending the name right before the cursor in the top image and name that ends with a normal character in the background image.

    Now, it is logical to me that ends a name shared with a space variable would be a bad practice and should be warned against.  But the warning never actually says that you cannot end with a space.  To be more precise, it says that you can not the slash code \s in the name of the variable.  Now I'm not really in the slash codes, but I'm in the spaces.  And they seem to work in variable name, just not if it is the last character very well.

    It just seems to be a disconnect between what says the warning, and what you can and can't do.

    Can you have spaces in the name SV?  From my experience, you can.

    In addition, in its LV 8.6 on a machine XP SP3.

    Thank you.  Please post the CAR ID # to the thread once you have it, then I'll put a link on the bug thread.

    Just to clarify, I see basically three questions.

    1. the error message is incorrect because spaces are allowed in the shared name of the variable, but the unclearly error that says they aren't.

    2. the spaces at the beginning or at the end of the shared variable, in my view, should not be allowed, but Ben could have an instance where he "backdoored" one in there.

    3. nuisance of user interface.  If spaces are not allowed at the end of the OAS, there is no need of an error message flashing on the screen that appears whenever you finish a word followed by a space before the next word begins.  The error message should really popup only once you click OK to save the variable.

  • Input in dialog boxes

    Hello

    I try to display an error message if the value that the user entered is outside the permitted range.

    I use a box of 'Interrogate the user entry' to then allow the user to enter an appropriate value.

    The problem I am facing now, is that I need the box 'Interrogate the user entry' to view the limits.

    for example. "Entry unacceptable please enter a value between 4.12 and 26.78 ', but these values are not predefined and depend on other variables.

    Is there a way for dialog boxes accept variables to display?

    Any help will be appreciated,

    Thank you

    Adnan

    Shuddering at the idea of using an Express VI, but we are going to disable the Expressify a bit.

    1. place your prompt the user for the VI entry on the comic and configure the types of entries you want.

    2. right click and select "Display as icon", without real reason, I just can't stand the look of the expanded view.

    3. right click and select "open the front panel.  Yes, you want to convert.

    4. now you have a new sub - VI with most of the things you need in place.  On the front panel, there are an indicator of string that displays the message to the user.  This change to a control and it wire to the connector pane.  Now you can wire in your own message of solicitation.

    5. save the new Subvi.

    Personally, I'd start from scratch, but maybe this will do it for you.  I change the behavior of the poll to an architecture based on events and selectively active / disable the ok button based on the validity of the seizure, but that's just me.  See if it's to help you get started.

  • Display thumbnails in the open dialog box?

    When you refer to a "Open file" dialog box, the window is automatically in the list.  Once it is open, I can manually select the thumbnail view, but next time you mention it it goes back to the list view.  I want this dialog box to open with the selected thumbnail view.  Anyone know of a way to do this?

    Ben wrote:

    Andrey Dmitriev wrote:

    Ben wrote:

    Not me!

    When I saw the work involved, I let my customer choose, photos or substance. They have not chosen the substance if no ready-made solution.

    Ben

    Ah, all LabVIEW programmers are commonly so lazy... (me too)

    Andrey.

    He looks the other way...

    LV developers are smart (they chose LV) so that they use their intelligence to work smarter, not more difficult.

    Ben

    Totally agree! But LabVIEW developers are not only smart, they also able to make a difference...

    Quick and dirty something liike that:

    LabVIEW 8.6 / WindowsXP. Not sure about Vista / 7. Too lazy to check it out.

    Enjoy!

    Andrey.

Maybe you are looking for

  • Equium L40 - 17 M - how to reset the user password

    This is probably a really basic question, so I hope you can help! I forgot my password for my Equium L40 - 17 M.When I click on "reset password" under my user icon it says: "this feature requires removable media such as a floppy disk or USB flash dri

  • M300-101: can I install Win Xp Prof?

    Hello can I install on Win Xp Prof M300 (but not the tablet version)? I must not have English version... If I now Toshiba does not sell M300 with multi language pack... If I install standard XP Prof. it'll be some problems with drivers or something?

  • List of Type of device to change or review &amp; pictures

    Hi, I looked around, but couldn't find that everything about this, so apologies if it has been asked and answered before. Is it possible to change or revise the device Type list in the application of engineering and associated images? For example, I

  • Driver required for HP Pavilion p6710in than 32-bit PC Desktop

    I have searched a hp HP Pavilion p6710in Desktop PC windows 7 32 bit drivers site but could not find them. Can you help me if thi?

  • Time interval step loop

    Hi guys,. I want to run a loop on a stage (using the loop configuration), but, in addition, to set a waiting time betweed each iteration... I have not found a wait in the expressions Explorer function, or another way to do it. Does anyone have an ide