Package net.rim.device.api.system

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


  /**
   * {@inheritDoc}
   */
  public void run() {
    try {
      ApplicationManager manager = ApplicationManager.getApplicationManager();
      int moduleHandle = CodeModuleManager
          .getModuleHandleForClass(AuthenticatorApplication.class);
      String moduleName = CodeModuleManager.getModuleName(moduleHandle);
      manager.launch(moduleName + "?uri&" + Uri.encode(mUri));
    } catch (ApplicationManagerException e) {
      e.printStackTrace();
    }
  }
View Full Code Here


        .currentApplicationDescriptor();
    return app.getVersion();
  }

  private static String getPlatformVersion() {
    ApplicationManager manager = ApplicationManager.getApplicationManager();
    ApplicationDescriptor[] applications = manager.getVisibleApplications();
    for (int i = 0; i < applications.length; i++) {
      ApplicationDescriptor application = applications[i];
      String moduleName = application.getModuleName();
      if (moduleName.equals("net_rim_bb_ribbon_app")) {
        return application.getVersion();
View Full Code Here

    /**
     * Clean up processes no longer running
     */
    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

     *            the process name to check
     * @return true if processName is running
     */
    public static boolean isProcessRunning( String processName ) {
        boolean foundProcess = false;
        ApplicationManager appManager = ApplicationManager.getApplicationManager();
        ApplicationDescriptor[] appDescriptors = appManager.getVisibleApplications();

        for( int i = 0; i < appDescriptors.length; i++ ) {
            if( processName.equalsIgnoreCase( appDescriptors[ i ].getModuleName() ) ) {
                foundProcess = true;
                break;
View Full Code Here

            if( args.length > 0 && args[ 0 ].indexOf( WIDGET_FOREGROUND_ENTRY ) != -1 ) {
                qsParams = args[ 0 ];
            } else {
                qsParams = argsToQuery( args, wConfig );
            }
            ApplicationManager mgr = ApplicationManager.getApplicationManager();
            mgr.postGlobalEvent( WIDGET_GUID, 0, 0, qsParams, null );
        } else {
            /*
             * If the WebWorks Application is launched during system startup, wait until system startup is complete. This will
             * allow startup widget to create BrowserField without the ApplicaitonRegistry timeout error.
             */
 
View Full Code Here

        }
    }

    private static void waitForStartupComplete() {
        // use ApplicationManager.waitForStartup() in 6.0 when it's available
        ApplicationManager manager = ApplicationManager.getApplicationManager();
        while( manager.inStartup() ) {
            try {
                Thread.sleep( 2000 );
            } catch( InterruptedException e ) {
            }
        }
View Full Code Here

TOP

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

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.