Autostart - foreground application

Hi all

I use RIM-MIDlet-flags-1:1 for autostart my request but I want it shows a screen at startup - I'm pushing the screen and asking the foreground but although the application automatically starts the screen don't be pushed to the forefront - can I do something to achieve?

Regads

Alex

did you check the boot process? the boot process is already over?

see this example:

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

find this comment:

Check if the BlackBerry has completed its startup process.

Once the boot process is completed,

Push your screen using pushGlobalScreen().

hope that helps.

Tags: BlackBerry Developers

Similar Questions

  • Cannot in the foreground a running application

    I have an application of UI configured to Autorun at startup, resulting in a son, do work in the background. It has a screen that displays information about the work that are background threads.

    class AppName extends UiApplication implements SystemListener2 {
        private static AppName app;
    
        public static void main(String[] args) {
            app = new AppName();
    
            if (ApplicationManager.getApplicationManager().inStartup()) {
                app.addSystemListener(app);
            } else {
                app.initializeLater();
            }
            app.enterEventDispatcher();
        }
    
        public AppName() {
            pushScreen(new InfoScreen());
            requestBackground();
        }
    
        private void initialize() {
            // Spawns some threads doing work in the background
        }
    
        private void initializeLater() {
            invokeLater(new Runnable() {
                public void run() {
                    initialize();
                }
            });
        }
    
        public void powerUp() {
            removeSystemListener(this);
            initialize();
        }
    }
    

    When I run the app in the Simulator, it works fine. At startup everything works and then when I click on the screen icon is highlighted and displayed. It is the output of the Simulator:

    3:20:26.612: AM: Starting AppName
    3:20:26.612: AM: AppName already running
    3:20:26.612: AM: Foreground is requested: AppName(304)
    3:20:26.628: AM: Foreground is set: AppName(304)
    

    However, on the device is displayed. It's the device debugger output:

    [0.0] Starting AppName
    [0.0] AppName already running
    

    As you can see that the foreground application is never made. I confirmed this by overriding the UiApplication.activate () method and by putting in a message to System.out to see if it was called, but it is not called.

    Does anyone have an idea why this is happening?

    "Is there any point having the call requestBackground()?

    Good question, I don't know, I did it just for "security".

    "pushScreen() in the constructor of the app or in the initialize() method."

    I could do this in the initialization.

  • Starts an application at startup of the BONE

    I need to know how to start an application when the operating system starts and makes it running in the background and listen to events assigned to the application.

    In properties, set the system App and Autostart.  Application of system, it have no icon.  If you want to have a UI and the bottom part of the application, create 2 projects.  The 1st has no flag set (this is the app icon) and the 2nd is defined as "another point of entry" to the main application.  The alternate entry point app has system and auto-start flags.  Add a parameter to the background app, i.e. "BG".

    In your main function, check the arguments.  If there are 0 arguments, the icon was clicked.  If there is 1 argument and it's 'BG', the background process started when the phone starts.  According to the arguments, instantiate a class of UiApplication (from the application icon) or an Application class (for the app in the background).

    Improve the substantive application a GlobalEventListener.  Then, he can listen to signals from the main application.  In addition, you can have listen for events from the call to run periodically on a timer, etc.

    Foreground and background applications can communicate using a RuntimeStore object or world events.

  • AppleScriptObjC get a foreground app icon

    All my scripts are launched from FastScripts.

    When you use the basic command to display alert since the additions dosed, the alert is delivered with the application icon of foreground (as expected).

    But when you use the AppleScriptObjC method to create an alert, the icon displayed is the FastScripts one.

    Is there a way to get the icon of a foreground application and forward it to the alert?

    I saw there is an applicationIconImage method but don't know how to use it.

    Any clue?

    I don't know what you (or FastScripts) are made for the foreground application, but you can use NSWorkspace to get the application for any file, for example:

    set sharedWorkspace to current application's NSWorkspace's sharedWorkspace
    set theIcon to sharedWorkspace's iconForFile:(POSIX path of (choose file))
    
  • Can not pass probably for my application when the call is answered

    BlackBerry Bold 9700, v5.0.0.862

    I develop a BlackBerry application and I want the phone to launch my application when an incoming call is * responding *. The code I must do this works intermittently, but it fails as often to succeed. Sometimes you will see my app temporarily for the current call (the screen with the duration of the call, etc.) to appear above it, or sometimes the current call is displayed without my app appearing at all.

    Here is the code I use:

    Welcome on the support forums.

    My guess would be that your application is reliable began, but the phone application is given to the foreground drops.

    You can avoid this by replacing the deactivate method in your application to the foreground application (but don't forget to add the control code, or you can never leave your app without leaving it).

    Notice that the code inside the earpiece of the phone is executed in the phone app. do not sleep or similar here!

    You should also check if your application is already running, and then inform via a global event.

  • Bridge remains in the foreground after opening the Photo in Photoshop

    Recently, I found that the bridge remains the foreground application when I used it to open an image in Photoshop (by default).

    By clicking on the Photoshop window does not change things, the bridge remains the active foreground application.

    I only can remedy this situation by sending the bridge toward the dock, then clicking in photoshop.

    Does anyone have any ideas why this could happen?

    Thank you

    How to find help!

    Except that are Photoshop and OS fully updated and that of the usual routines of troubleshooting (trashing prefs in keeping control-alt-shift/ctrl-alt-shift during the application startup, deactivation of 3rd-party plug-ins, system maintenance, validation of fonts, etc.) that you have made so far?

  • Firefox for android reload tabs after reduction.

    I use firefox for a month now on my motorcycle g... There kitkat 4.4.2. Whenever I minimize firefox it reloads tabs after optimization. Help, please.

    When you switch between Android apps may other applications in order to give the foreground application more CPU or RAM. There's not much that Firefox can do to avoid this behavior.

  • The Magic Trackpad 2 first plan window Focus problem

    I had the strangest question with my Magic Trackpad 2 on El Capitan (10.11.3.) When I am in the window of one application and tap/click to another application window, application of the new window comes to the foreground, but the old app is still under discussion. So if I try a keypad at this stage or type text, is what actually performing in the old app and not the new foreground application.

    For example, suppose that I open Safari and TextEdit and I am browsing a page in Safari. 50% of the time if I use my Magic Trackpad 2 to tap or click on in the document window empty TextEdit of Safari, TextEdit window will come in the home of prominent and Safari will be the background window, but if I start typing the text or press CMD - N to a new document, it will operate on Safari instead of TextEdit. This is just one example - literally, it happens with any application.

    I messed with all: accessibility for the Trackpad, trackpad settings, settings etc. No background apps or mouse extension installed applications. Tried both wireless and connected via cable to the lightning. Magic Mouse does not appear to have this problem, Trackpad 2 only.

    Anyone else having this problem? It drives me crazy and makes use of the Magic Trackpad 2 on OS X pretty useless.

    Hey it re-registers,

    I understand that you experience some problems with your selection of Magic Trackpad 2 and window to El Capitan. I would like to as allows you to test this behavior in Mode safe mode to see if the problem is still present:

    Try safe mode if your Mac does not end commissioning - Apple Support

    https://support.Apple.com/en-us/HT201262

    You can also consider testing this behavior in a new user account:

    How to test a question in another account on your Mac - Apple Support

    https://support.Apple.com/en-us/HT204443

    Thanks for being a part of the communities of Apple Support!

  • isForeground () does not properly in the firmware 4.6 and bellows

    Hello

    I'm developing a game for blackberry using MIDP.

    I want to suspend my game when Application Switch menu appears when menu button OEM wedge. I put code in hand following a loop to check is in the foreground application or not.

    If (!.) Application.getApplication () .isForeground ())
    {
    hideNotify ();
    }
    on the other
    {
    If (! hasNotified)
    {
    hasNotified = true;
    showNotify ();
    }
    }

    It works for the Firmware above 4.6 but not for 4.6 and below.

    I'm trying to track the use of the JDE 4.6 and found the value of

    Application.getApplication (.isForeground))

    has always been true except after App Virginia.

    Someone at - he never faced this problem?

    Thank you

    Houilliez

    Ah, sorry, I don't have that it's a MIDP app no idea about that, sorry.

    as most of the devices are above 4.6 today maybe it's not that big of a problem however.

  • TabTip32 Windows 7 64 bit grabs focus

    I have two laptop Fujitsu Lifebook running 64-bit Windows, and both have recently developed a strange problem with TabTip32. Once connected, the system almost immediately becomes unusable because the foreground application loses focus. You can open an application or a command window, but it becomes impossible to type because the emphasis is more less than a second.

    I have followed the problem until tabtip32.exe, located in c:\program files (x 86) \Common Files\microsoft shared\ink\tabtip32. Tabtip32 is called every few milliseconds. When tabtip32 is called, the task of leading loses focus. You can see called every few milliseconds by opening the Task Manager.

    It is a bit about this "microsoft shared" and 'ink' both appear to be entirely lowercase names. This is incompatible with Microsoft's policy to take advantage of the first letter of the names of folders. Each directory in common files other than "microsoft shared" has the first letter uppercase. Similarly, each directory in "shared microsoft" has a first letter capitalized with the exception of the "ink". Weird...

    The problem is easy to fix: 1) appropriating tabtip32.exe (the default owner is the TrustedInstaller and 2) changing the name to something. The moment where only the name is changed, the problem goes away (other than the event log, which reflects errors because Windows cannot find TabTip32). Unfortunately, the Windows Update reinstalls sometimes tabtip32.exe. When this happens, both of my computers unusable until I repeat the process described above.

    The behavior is compatible with the malware. However, I do have Sophos and Malwarebytes installed on each computer in the active process. I also installed Adaware as a digitization program backup. I run Adaware every week or two. Both computers comes in own name with all these programs. It seems unlikely that tabtip32.exe has been replaced by a malware survived three respected virus detection programs. Also, malware is supposed to work invisibly. Malware that makes your computer unusable does not spread easily.

    I am quite puzzled that this problem has not been communicated. I have two computers Fujitsu almost identical (T731 and T734), both running Windows 7 64-bit and both with exactly the same problem. On this basis, I expect this would be widely. It is not.

    This could be caused by registry problems on both machines. I used the Lavasoft cleaner registry (a seller I trust), but which had no influence on the bizarre behavior of tabtip32.

    I'd like suggestions on what is the cause, and how it can be addressed permanently.

    Thank you

    Steve Shafer

    Hi Steve

    More information that could help track down the problem.

    In Windows 7, the file Tabtip32.exe is the component of the Tablet Input Panel and Touch Keyboard .

    This component can be disabled.

    Open Control Panel / programs and features.

    In the left menu, click the option Windows turn features on or off .

    After that fills the window, scroll down to the Tablet PC components and remove the check mark from that option.

    Click OK and the feature will be removed the next time you restart the computer.

    Let us know if that fixes the problem.

    Concerning

  • Problem when using pushGlobalScreen

    Hello everyone,

    In my application, I screen using the pushGlobalScreen () method.

    on this screen, I try to call the default mailClient using the following code snippet.

    Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES,
                                    new MessageArguments(MessageArguments.ARG_NEW));
    

    I'm able to invoke the mailClient, but this called screen goes below my screen
    (Because my screen is global).

    so my question is how to screen (new post) screen above this overall screen?

    Is there a work around that?

    Thanks in advance.

    If your application is in the background and you want to show your application screen above browser multimedia, so you can ask your foreground application using requestforeground() and then you can push your screen.

    Press the button Bravo thank the user who has helped you.

    If your problem has been resolved then please mark the thread as "accepted Solution".

  • Problem with Manager.createPlayer)

    Hello

    I want to play a little mp3 noise when I turn on my BB with a background application. So first, I tried this code in a foreground application:

        public void play()      {        //first we need to find the supported content types        String types[] = Manager.getSupportedContentTypes(null);        for (int cnt = types.length - 1; cnt >= 0; --cnt) {            if (types[cnt].equals("audio/mpeg")) {            //this sample demonstrates playing an MP3 file that has been             //added as a resource to the project            try {                //retrieve the MP3 file                Class clazz = getClass();                InputStream is = clazz.getResourceAsStream("/test.mp3");                //create an instance of the player from the InputStream                Player player = Manager.createPlayer(is, "audio/mpeg");                player.realize();                player.prefetch();                //start the player                player.start();                } catch (Exception ex) { System.out.println("ERROR -> "+ex); }             }         }    }
    

    But it does not work! It returns the exception "java.lang.IllegalArgumentException: flow: null". I think that it does not find test.mp3. I put the mp3 file in the same directory the files .java and .jdp.

    So, could you tell me what I have to add or delete of this code, listen to this sound (first in a foreground application) test please!

    And is it possible to play an mp3 sound with an application at the beginning of the unit?

    Thank you in advance!

    It is perhaps the issue:

    «I put the mp3 file in the same directory files .java and .jdp.»

    The MP3 resource must also be added to the project.

  • Definition of an icon of overview

    I set up a test application to try to define a rollover icon and followed the advice in the following articles in the Knowledge Base

    and also, in this thread http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&thread.id=3623

    I put the index according to the thread above in the following API calls:

    HomeScreen.updateIcon( regIcon, 1 );
    HomeScreen.setRolloverIcon( icon, 1 );
    

    I installed the same sample application on a 8100 device and a 8310 device.  8100 system works perfectly, but the 8310 device sends a message error "Module with handle [handleID] and [index] has no application entry point.

    Does anyone know why it would work on a single device, but not another?  Is there a way to fix this?

    public RolloverTest(boolean autoStart)
    {
        if (autoStart)
        {
            //The application started using the auto start entry point.
            //Setup the rollover icons.
            final Bitmap regIcon = Bitmap.getBitmapResource("mobicon_36x36.png");
            final Bitmap icon = Bitmap.getBitmapResource("mobicon_36x36_highlight.png");
    
            invokeLater(new Runnable()
            {
                public void run()
                {
                    ApplicationManager myApp = ApplicationManager.getApplicationManager();
                    boolean keepGoing = true;
    
                    while (keepGoing)
                    {
                        //Check if the BlackBerry has completed its startup process.
                        if (myApp.inStartup())
                        {
                            //The BlackBerry is still starting up, sleep for 1 second.
                            try
                            {
                                Thread.sleep(1000);
                            }
                            catch (Exception ex)
                            {
                                //Couldn't sleep, handle exception.
                            }
                        }
                        else
                        {
                            try
                            {
                                //The BlackBerry has finished its startup process.
                                //Set the rollover icons.
                                HomeScreen.updateIcon(regIcon, 1);
                                HomeScreen.setRolloverIcon(icon, 1);
                                keepGoing = false;
                            }
                            catch (Exception ex)
                            {
                                // Couldn't set the rollover icon, handle exception
                            }
                        }
                    }
    
                    //Exit the application.
                    System.exit(0);
                }
            });
        }
        else
        {
            //The application was started by the user.
            //Start the application and display a GUI.
            pushScreen(new ScrTest());
        }
    }
    

    I've been playing in this code example, a little bit more and added a try/catch statement (highlighted in red in the example above) around the code to set the icon of overview.  Overview icon now works every time and I no longer see the error message.  Hurrah!

  • Issue of thread and KeyListener

    Hello

    My problem is that I don't seem to get all events of all types of users what number I thread that implements KeyListener to capture key events when the user types a phone number. Any ideas on what is wrong? Is there anything else I need to listen to?

    Thank you.

    only the foreground application gets the key events. with the exception of green, red, menu and I think that convinience key that are broadcast.

  • Pack component 4.7 - Overview icon does not change

    Hello

    I use Eclipse.  Compilation with BB component pack 4.7.

    I have a master project (CLDC) and a second project (CDLC replacement Entry Point). The second project is checked system and startup.

    Note: the second entry point was to record a personalized for the app, not on the icon menu item.

    I right click on the "main" project-> properties-> Blackberry Project Properties-> resources.

    I select an icon file (1.png) in the dialog box "files of icons".

    I select a second (2.png) icon file in the "Icons of focus files" dialog box.

    I clean, compile, run under a 'new' "BOLD" Simulator (9000) and my app has the icon "no-focus".

    When I reversal, it does not change.

    What I've read, 4.7 is supposed to make this easy.  It seems to be advantageous, so I don't know I'm missing something that is obvious (to everyone except me).  I am new to Java and Eclipse, but really get the hang of it... so far, it's...

    Does anyone have any ideas why this might not work?

    Thank you!

    You project must have an entry point with parameter. This additional entry point must be defined as "Autostart". Add the parameter's main entry: gui

    And check the code below. This works.

    import net.rim.device.api.ui.UiApplication;import net.rim.device.api.ui.component.LabelField;import net.rim.device.api.ui.container.MainScreen;import net.rim.device.api.system.Bitmap;import net.rim.device.api.system.ApplicationManager;import net.rim.blackberry.api.homescreen.HomeScreen;
    
    public class HomeScreenIcon extends UiApplication{    public static void main(String[] args)    {        //Check for the argument defined in the project properties.        if (args != null && args.length > 0 && args[0].equals("gui"))        {           HomeScreenIcon theApp = new HomeScreenIcon(false);            theApp.enterEventDispatcher();        }        else        {            HomeScreenIcon theApp = new HomeScreenIcon(true);            theApp.enterEventDispatcher();        }    }    public HomeScreenIcon(boolean autoStart)    {        if (autoStart)        {        //The application started using the auto start entry point.        //Setup the rollover icons.        final Bitmap regIcon = Bitmap.getBitmapResource("1.png");        final Bitmap icon = Bitmap.getBitmapResource("2.png");
    
            invokeLater(new Runnable()        {            public void run()            {                ApplicationManager myApp =                  ApplicationManager.getApplicationManager();                boolean keepGoing = true;
    
                    while (keepGoing)                {                    //Check if the BlackBerry has completed its startup process.                    if (myApp.inStartup())                    {                        //The BlackBerry is still starting up, sleep for 1 second.                        try                        {                            Thread.sleep(1000);                        }                        catch (Exception ex)                        {                          //Couldn't sleep, handle exception.                        }                    }                    else                    {                        //The BlackBerry has finished its startup process.                        //Set the rollover icons.                        HomeScreen.updateIcon(regIcon, 0);                        HomeScreen.setRolloverIcon(icon, 0);                        keepGoing = false;                    }                 }                 //Exit the application.                 System.exit(0);            }        });
    
        }    else    {         //The application was started by the user.         //Start the application and display a GUI.         MainScreen ms = new MainScreen();         ms.setTitle(new LabelField("Hello there."));         pushScreen(ms);    }  }}
    

Maybe you are looking for