Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
aliajones
Posts: 81
Registered: ‎12-04-2012
My Device: BlackBerry@8520 smartphone(Edge,Wi-fi)
My Carrier: vodafone
Accepted Solution

getapplicationmanager()

heyy, could someone tell me what am i supposed to put in place the parameters in this method

manager.scheduleApplication(descriptor, time, absolute);

Plz help

 

Please use plain text.
Developer
peter_strange
Posts: 19,599
Registered: ‎07-14-2008
My Device: Not Specified

Re: getapplicationmanager()

That depends.  Look for the documentation for that application and this method for more. 

Please use plain text.
Developer
aliajones
Posts: 81
Registered: ‎12-04-2012
My Device: BlackBerry@8520 smartphone(Edge,Wi-fi)
My Carrier: vodafone

Re: getapplicationmanager()

thnxs :-)
Please use plain text.
Developer
aliajones
Posts: 81
Registered: ‎12-04-2012
My Device: BlackBerry@8520 smartphone(Edge,Wi-fi)
My Carrier: vodafone

Re: getapplicationmanager()

i am putting my descriptor, but it is giving an error. What am i supposed to put in the descriptor
Please use plain text.
Developer
aliajones
Posts: 81
Registered: ‎12-04-2012
My Device: BlackBerry@8520 smartphone(Edge,Wi-fi)
My Carrier: vodafone

Re: getapplicationmanager()

[ Edited ]
package mypackage;

import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.system.ApplicationDescriptor;
import net.rim.device.api.system.ApplicationManager;
import net.rim.device.api.system.ApplicationManagerException;
/**
 * This class extends the UiApplication class, providing a
 * graphical user interface.
 */
public class MyApp extends UiApplication
{
    /**
     * Entry point for application
     * @param args Command line arguments (not used)
     * @param newDescriptor 
     */ 
    public static void main(String[] args, ApplicationDescriptor newDescriptor)
    { 
    	
	   try 
        {  ApplicationManager appmanager = ApplicationManager.getApplicationManager();
		    appmanager.lockSystem(false);
            appmanager.scheduleApplication(newdescriptor, 1728000, false);
        } 
        catch(ApplicationManagerException e) 
        {
            //handle situation when application cannot run
        }
        MyApp theApp = new MyApp();       
        theApp.enterEventDispatcher();
    }
    

    /**
     * Creates a new MyApp object
     */
    public MyApp()
    {        
        // Push a screen onto the UI stack for rendering.
        pushScreen(new MyScreen());
    }    
}
The error is in the highlighted text. I have no clue what to put in the descriptor.I tried puting the name of my xml,but nothing seems to work
I hope i m clear and not disturbing the flow of threads.
Hope i am answered now :-)

 

Please use plain text.
Developer
peter_strange
Posts: 19,599
Registered: ‎07-14-2008
My Device: Not Specified

Re: getapplicationmanager()

What are you trying to achieve?

Please use plain text.
Developer
aliajones
Posts: 81
Registered: ‎12-04-2012
My Device: BlackBerry@8520 smartphone(Edge,Wi-fi)
My Carrier: vodafone

Re: getapplicationmanager()

i am trying to make an application which launches itself after a certain allotted time
Please use plain text.
Developer
peter_strange
Posts: 19,599
Registered: ‎07-14-2008
My Device: Not Specified

Re: getapplicationmanager()

How is this app going to be started the first time?  auto-start, or will the user start it?

 

Have you looked at this method?

ApplicationDescriptor.currentApplicationDescriptor()

Please use plain text.
Developer
aliajones
Posts: 81
Registered: ‎12-04-2012
My Device: BlackBerry@8520 smartphone(Edge,Wi-fi)
My Carrier: vodafone

Re: getapplicationmanager()

I have included this method that u told i want my app to launch lets say after 45seconds after i have clicked on it..I dont want the user to be involved at any level.Could u help ...my code is just an error-free snippet but is not doing anything.

public class MyApp extends UiApplication
{
    /**
     * Entry point for application
     * @param args Command line arguments (not used)
     * @param newDescriptor 
     */ 
    public static void main(String[] args)
    { ApplicationDescriptor template = ApplicationDescriptor.currentApplicationDescriptor();
      String[] args1 = { "admin","secure" };
      ApplicationDescriptor newdescriptor = new ApplicationDescriptor(template, args1);
      ApplicationDescriptor.currentApplicationDescriptor();
      ApplicationManager appmanager = ApplicationManager.getApplicationManager();
	  appmanager.lockSystem(false);
      appmanager.scheduleApplication(newdescriptor, 3728000, false);
      MyApp theApp = new MyApp();       
      theApp.enterEventDispatcher();
    }
    

    /**
     * Creates a new MyApp object
     */
    public MyApp()
    {        
        // Push a screen onto the UI stack for rendering.
        pushScreen(new MyScreen());
    }    
}

 

Please use plain text.