Package net.rim.device.api.system

Examples of net.rim.device.api.system.ApplicationDescriptor


     */
    private void trim() {
        ApplicationManager mgr = ApplicationManager.getApplicationManager();
        synchronized( _applications ) {
            for( int i = _applications.size() - 1; i >= 0; i-- ) {
                ApplicationDescriptor application = (ApplicationDescriptor) _applications.elementAt( i );
                if( mgr.getProcessId( application ) == -1 ) {
                    _applications.removeElementAt( i );
                }
            }
        }
View Full Code Here


     * Check if current widget is running (excluding daemon processes)
     * @return true if running, otherwise false
     */
    public static boolean isAppRunning() {
        ApplicationManager mgr = ApplicationManager.getApplicationManager();
        ApplicationDescriptor current = ApplicationDescriptor.currentApplicationDescriptor();
        int processId = mgr.getProcessId( current );
        ApplicationDescriptor[] descriptors = ApplicationRegistry.getInstance().getApplications();
   
        // Check active descriptors against current descriptor
        for( int i = 0; i < descriptors.length; i++ ) {
            ApplicationDescriptor descriptor = descriptors[ i ];
            int descriptorProcessId = mgr.getProcessId( descriptor );
            if( !isDaemon( descriptor.getArgs() ) && descriptorProcessId != -1 && descriptorProcessId != processId ) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

            throw new IllegalArgumentException( "A different port (" + currentPort
                    + ") is already opened, only one port can be opened at a time." );
        }

        EventLogger.logEvent( WidgetProperties.getInstance().getGuid(), "open BIS push listener".getBytes() );
        ApplicationDescriptor ad = new ApplicationDescriptor( ApplicationDescriptor.currentApplicationDescriptor(), new String[] {
                "PushDaemon", entryPage, "" + maxQueueCap } );
        PushApplicationDescriptor pad = new PushApplicationDescriptor( appId, port, serverUrl,
                PushApplicationDescriptor.SERVER_TYPE_BPAS, ad );
        int status = PushApplicationRegistry.getStatus( pad ).getStatus();
        if( status != PushApplicationStatus.STATUS_ACTIVE ) {
View Full Code Here

        if( currentPort != -1 && port != currentPort ) {
            throw new IllegalArgumentException( "A different port (" + currentPort
                    + ") is already opened, only one port can be opened at a time." );
        }

        ApplicationDescriptor ad = new ApplicationDescriptor( ApplicationDescriptor.currentApplicationDescriptor(), new String[] {
                "PushDaemon", entryPage, "" + maxQueueCap } );
        PushApplicationDescriptor pad = new PushApplicationDescriptor( port, ad );
        int status = PushApplicationRegistry.getStatus( pad ).getStatus();
        if( status != PushApplicationStatus.STATUS_ACTIVE ) {
            PushApplicationRegistry.registerApplication( pad );
View Full Code Here

        if (args != null && args.length > 0) {
            if (args[0].equals("startup")) {
                // Register an ApplicationMenuItem on device startup.
                final ApplicationMenuItemRepository amir =
                        ApplicationMenuItemRepository.getInstance();
                final ApplicationDescriptor ad_startup =
                        ApplicationDescriptor.currentApplicationDescriptor();
                final ApplicationDescriptor ad_gui =
                        new ApplicationDescriptor(ad_startup, "gui",
                                new String[] { "gui" });
                amir.addMenuItem(ApplicationMenuItemRepository.MENUITEM_MAPS,
                        new MapsMenuItem(), ad_gui);
            } else if (args[0].equals("gui")) {
                // App was invoked by our ApplicationMenuItem. Call default
View Full Code Here

        final ApplicationMessageFolderRegistry reg =
                ApplicationMessageFolderRegistry.getInstance();

        // Some context menu items don't need a GUI (e.g. an item for deleting a
        // message) and will be run in the current daemon application.
        final ApplicationDescriptor daemonDescr =
                ApplicationDescriptor.currentApplicationDescriptor();

        // Main application descriptor - causes application to be launched with
        // default welcome screen if a user clicks on the "Message List Demo"
        // header in the home screen notifications view.
        final ApplicationDescriptor mainDescr =
                new ApplicationDescriptor(daemonDescr, APPLICATION_NAME,
                        new String[] {});

        // This application descriptor launches this application with a GUI to
        // execute listener callbacks, e.g. to display a message.
        final ApplicationDescriptor uiCallbackDescr =
                new ApplicationDescriptor(daemonDescr, APPLICATION_NAME,
                        new String[] { "gui" });

        // Get existing messages from storage and register them in folders
        final ApplicationFolderIntegrationConfig inboxIntegration =
                new ApplicationFolderIntegrationConfig(true, true, mainDescr);
View Full Code Here

                        EncodedImage
                                .getEncodedImageResource("img/logo_blue.jpg");
                final Image image = ImageFactory.createImage(encodedImage);

                // Create an application descriptor for this application
                final ApplicationDescriptor applicationDescriptor =
                        new ApplicationDescriptor(ApplicationDescriptor
                                .currentApplicationDescriptor(),
                                "Contact Linking Demo",
                                new String[] { "menu-invoked" });
                final ApplicationMenuItem[] items = new ApplicationMenuItem[2];
                items[0] = new SampleMenuItem(APPLICATION_ID, image);
View Full Code Here

                 * items. When a nine digit number is typed in an active text
                 * field the matched pattern will be highlighted and the
                 * additional menu items will be available. The menu items will
                 * launch an instance of this appplication when invoked.
                 */
                final ApplicationDescriptor appDesc =
                        new ApplicationDescriptor(ApplicationDescriptor
                                .currentApplicationDescriptor(),
                                "Active Text Fields",
                                new String[] { "pattern-recognized" });
                PatternRepository.addPattern(appDesc, "[0-9]{9}",
                        PatternRepository.PATTERN_TYPE_REGULAR_EXPRESSION,
View Full Code Here

        // Set the name of the content handler by updating the
        // ApplicationDescriptor
        final DefaultContentHandlerRegistry defaultRegistry =
                DefaultContentHandlerRegistry
                        .getDefaultContentHandlerRegistry(registry);
        final ApplicationDescriptor currentDescriptor =
                ApplicationDescriptor.currentApplicationDescriptor();
        handlerName =
                handlerName != null ? handlerName : currentDescriptor.getName();

        final ApplicationDescriptor descriptor =
                new ApplicationDescriptor(currentDescriptor, handlerName, null);
        defaultRegistry.setApplicationDescriptor(descriptor, id);
    }
View Full Code Here

            final Registry registry =
                    Registry.getRegistry(getClass().getName());
            final DefaultContentHandlerRegistry defaultRegistry =
                    DefaultContentHandlerRegistry
                            .getDefaultContentHandlerRegistry(registry);
            final ApplicationDescriptor descriptor =
                    defaultRegistry.getApplicationDescriptor(server.getID());

            Dialog.alert(descriptor.getName() + " invoked for: "
                    + invoc.getURL());

            // ...
            // Other processing could be done here
            // ...
View Full Code Here

TOP

Related Classes of net.rim.device.api.system.ApplicationDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.