setAcceptableDirections on MIDlets

Hello

Someone could do setAcceptableDirections() to work on a moped to lock the screen in portrait mode on the storm? Is this possible?

DirectionControl dirControl = (DirectionControl) javax.microedition.lcdui.Display.getDisplay(myMidlet);
dirControl.setAcceptableScreenDirections(DirectionControl.DIRECTION_LANDSCAPE);

Found the solution.

Tags: BlackBerry Developers

Similar Questions

  • MIDP screen orientation setAcceptableDirections

    I get on a compilation error when you try to use setAcceptableDirections

    I take it, the view classes are face... so I ask the question:

    How to use setAcceptableDirections(); while I can lock the screen in portrait mode?

    and even more, what is the integer value by default I can put in their portrait do?

    any help regaurding this issue would be great!

    I am porting my Midlet above for the storm, and so far I have had no problem to implement the rest of the API

    For example Keylistener etc...

    So let me know how I can block just as the mode screen portrait, and really, I can't share just on the Web

    like when I do this, he throws a lot of mistakes, I'm not in the mood to watch.

    The following link has the code example on the restriction of the orientation.

    How - to control the orientation of the screen
    Article number: DB-00706

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

    Note that these APIs have been added in version 4.7.0 API of BlackBerry set.  Therefore, you will need to use the version 4.7.0 + of the BlackBerry JDE or BlackBerry JDE component Pack.

  • Push and Midlets

    I am trying to add push, via the Service of Blackberry Push notifications to my application already developed and productive with the midlets. As I can not instantiate a UIApplication on a moped, I thought to leave my "wake app" app on every push, using PushRegistry AMS software.

    Its posible to register to use the Blackberry Push Notification Service, at a very low level, using PushRegistry on a MIDlet application?

    Thank you

    Nico.

    Solved by some here at work, by adding this code. Post here if anyone can help.

    package test.javax.microedition.midlet;

    Javax.microedition.lcdui import. *;
    Javax.microedition.io import. *;
    Javax.microedition.midlet import. *;
    Import Java.util;
    import java. IO;
    Import net.rim.device.api.applicationcontrol.ApplicationPermissions;
    Import net.rim.device.api.applicationcontrol.ApplicationPermissionsManager;

    / public final class DynamicPushRegistry extends MIDlet
    {
    Data, we expect to receive.
    private static final String TEST_DATA = "this is just a test."
    private final static ApplicationPermissionsManager apm is ApplicationPermissionsManager.getInstance ();.

    public DynamicPushRegistry()
    {
    setPermission (ApplicationPermissions.PERMISSION_CROSS_APPLICATION_COMMUNICATION);
    setPermission (ApplicationPermissions.PERMISSION_BROWSER_FILTER);
    setPermission (ApplicationPermissions.PERMISSION_INTERNET);
    setPermission (ApplicationPermissions.PERMISSION_SERVER_NETWORK);
    setPermission (ApplicationPermissions.PERMISSION_APPLICATION_MANAGEMENT);
    }

    Signals of the MIDlet that he is entered in the active state.
    public void startApp()
    {
    Get the display for this MIDlet object.
    Display d = Display.getDisplay (this);

    Create and start a new WorkerThread.
    Thread t = new WorkerThread();
    t.Start ();

    Create a new alert.
    Alert alert = new alert ("start DynamicPushRegisry");

    Display the alert for 2 seconds.
    alert.setTimeout (2000);

    d.setCurrent (alert);
    }

    private class WorkerThread extends thread
    {
    public void run()
    {

    Get all the connections that have been registered with the PushRegistry
    for the current MIDlet suite.
    String [] connections = PushRegistry.listConnections (true);

    If (connections.length == 0)
    {
    Nothing is recorded, sign up for a connection.
    Try
    {
    Dynamically register a socket connection
    on port 50000.
    PushRegistry.registerConnection ("' socket: / /: 50000", ")
    "test.javax.microedition.midlet.DynamicPushRegistry,"
    "*");
    } catch (ConnectionNotFoundException e)
    {
    message (try ());
    } catch (ClassNotFoundException e)
    {
    message (try ());
    } catch (IOException e)
    {
    message (try ());
    }
    }
    on the other
    {
    A connection is already registered and data arrives.
    Extract the incoming data.
    fetchData (connections [0]);

    Stop to wait for data.
    message ("Done");
    }
    notifyDestroyed();
    }
    }

    Retrieves incoming data.
    Private Sub fetchData (connection String)
    {
    Try
    {
    Open the connection.
    Connection c = Connector.open (connection);

    If (ch. instanceof StreamConnectionNotifier)
    {
    Open an InputStream.
    StreamConnectionNotifier (StreamConnectionNotifier) SNA = c;
    StreamConnection sc = scn.acceptAndOpen ();
    InputStream input = sc.openInputStream ();

    Extract the data from the InputStream.
    StringBuffer sb = new StringBuffer();
    data from Byte [] = new ubyte [256];
    piece of int = 0;
    While (-1! = (chunk = input.read (data)))
    {
    SB. Append (new String (data, 0, chunk));
    }

    Close the InputStream and StreamConnection.
    Input.Close ();
    TCI Close();

    String s = sb.toString ();

    Test the data for validity.
    If not valid, an exception is thrown.
    Assert.assertTrue (TEST_DATA.equals (s),
    "Do not have an appropriate string:"+ s); ".

    Display the received data.
    message ("Received:" + sb.toString ());
    }
    } catch (IOException e)
    {
    message (try ());
    }

    }

    Display a message string to the user.
    Private Sub message (String msg)
    {
    Create a new alert with the message.
    Alert alert = new Alert (msg);

    Display the alert for 5 seconds.
    alert.setTimeout (5000);

    Display.getDisplay (this) .setCurrent (alert);
    }

    Reports the MIDlet to stop and go to the Pause State.
    public void pauseApp()
    {
    }

    Reports the MIDlet to terminate and move to the State of destruction.
    Unconditional, when set to true. The MIDlet must cleaning and release
    all of the resources. Otherwise, the MIDlet can raise a
    MIDletStateChangeException to indicate that he does not want to be
    destroyed at this time.
    public void destroyApp (boolean unconditional)
    {
    }

    private Boolean setPermission (int permission) {}

    Boolean updatedPermissions = false;
    ApplicationPermissions ap = apm.getApplicationPermissions ();
    If (ap.containsPermissionKey (permission)) {}
    int eventInjectorPermission = ap.getPermission (permission);

    If (eventInjectorPermission! = ApplicationPermissions.VALUE_ALLOW) {}

    ap.addPermission (permission);
    updatedPermissions = apm.invokePermissionsRequest (ap);
    }
    } else {}
    ap.addPermission (permission);
    updatedPermissions = apm.invokePermissionsRequest (ap);
    }

    Return updatedPermissions;
    }
    }

    Throws IllegalStateException with the provided error message.
    last class Assert
    {
    Assert() private
    {
    }

    public static public Sub assertTrue (Boolean exp, String failmsg)
    {
    If (! exp)
    throw new IllegalStateException (failmsg);
    }
    }

  • Update Midlet

    Hello

    I am updating mi automatly midlet.

    So, if a new version if found I use platformRequest (urlMidlet);

    Mi problem is:

    -If I put the url of the jad file I get this error:

    incompatibility of double attribute attribute 905 incompatibility descriptor: "MIDlet-Version" when trying to install I watch in the file jad and MIDlet-Version appear only once. "

    -If I put the url of the jar file I get this error:

    907 invalid JAR illegal host string: starts with ' / '.

    I compile my midlet with Wireless ToolKit.

    Thank you

    Hello

    Problem solved just remove the MIME for pot and work very well.

    Cali

  • Moving Eclipse 3.4-> 3.5, two strange issues - lack of generator for java, Midlet-name is missing

    I moved to Eclipse 3.5, installed the plugin version 1.1 BB and copied a Blackberry project from the workspce Eclipse 3.4 to 3.5 workspace.

    I've added a new project of Blackberry and pointed to the existing project. He seemed to find everything, from the jdp or .project file and installed. But he has been unable to build.  In the process of building I noticed several manufacturers reported as "missing". I created a TEST project and said that she had a 'Builder of Java' the real project does not have.  I add the following xml to the builders section of the .project file code:

    org. Eclipse.JDT.Core.javabuilder

    He then built.

    The packaging problem. Now I'm stuck on this packaging error:

    Error! 907: descriptor required attribute missing: MIDlet-name

    In the Application descriptor page, I chose 'Blackberry Application' so "main Midlet name" is not editable...

    Any ideas on why I can't move my project smoothly.

    Why the Application descriptor page would not create an appropriate description of MIDlet?

    Solutions!

    Problem 1, the missing Java constructor can either be handled by adding the text above in the file .projects, or having somehow incremental builders reference the ".externalToolBuilders" folder that I found them in.

    Problem 2 is unique.  To avoid applications with systems operating older running in compatibility mode (the small screen of blue border) on the storms, a file "compatibity.jad" was the project, containing the lines:

    RIM-TouchCompatibilityMode: false
    RIM-TouchCompatibilityMode-UserChangeable: false

    The jad file is added to the real Jad through Update.Jad.  However, during the project/file/new blackberry existing project using Eclipse 3.5 upgrade, program CAP locked on the compatibility.jad file and he was looking for the MIDlet-name. I renamed the file compatibility.kad and it solved problem.

    I think Rim should resolve the first issue, the question of Java Builder. The second question is kind of unique, but it can drive someone to another crazy one day...

    -If you upgrade and if you do not import heritage projects (which points to the.) BlackBerry folder BlackBerry.jdw) Note that the old NET_RIM_BLACKBERRY library is now named "JRE System Library [Blackberry JRE 4.7.0]" for example. So after the upgrade, you will need to remove the NET_RIM_BLACKBERRY and the "Add Library" the correct system library.

  • the MIDlet application icon does not appear

    Hi all

    I have a midlet application on my BlackBerry project.

    (I use the BB project because some improvements only works on BB).

    I use Eclipse 3.4 and BB JDE 4.5.

    My icon is the res folder (source folder) on the project.

    Why does not display the icon of the application?

    I use all of this step, but the icon still does not display:

    1. project-> properties-> BlackBerry Project Properties-> tab "resources"-> Add (icon files textbox)

    2 MIDlet-1: MidletName, / appicon.jpg, MidletJava

    are all the work of setting just for UIApplication?

    Thanks in advance.

    =)

    ----------------------------------------------------------------

    my progress:

    I created a simple project, I filled all the settings on the Blackberry project properties.

    and it works:

    -icon show as correctly on the tab "resources"-> icons files

    -application name as well as in the general tab-> title

    but when add third (Java Build Path-> Add library), those setting do not take effect:

    -l' icon by default BB.

    -the class name = application name

    so, I guess, the icon don't display correctly due to the third pary.

    can someone help me?

    There is a problem in version 1.0 of the BlackBerry Java plug-in for Eclipse that prevents MIDlets icon changes to take effect.  Work around this is to recreate the project in a new workspace.

    Alternatively, you can upgrade to Eclipse 3.5 release and use the 1.1.2 version of the BlackBerry Java plug-in for Eclipse, which has the fix for this issue.

  • Please help: missing required attribute of error descriptor jar: MIDlet-1

    Hello, I am trying to install a simple HelloWorld application on a real device, but I get this invalid 907 JAR error
    Missing required attribute descriptor: MIDlet-1. Here is my jad file:

    Manifest-Version: 1.0

    RIM-COD-Module-name: HelloWorld

    RIM-COD-Module-dependencies: net_rim_cldc

    MIDlet-Jar-Size: 2929

    MIDlet-1:.

    RIM-COD-creation-Time: 1254980714

    MIDlet-Jar-URL: HelloWorld.jar

    RIM-COD-URL: HelloWorld.cod

    RIM-COD-SHA1: 5 b 9 c 70 91 79 0f ed 92 d3 f5 e0 81 4f 92 d3 8 d 66 67 a9 b4

    RIM-COD-size: 1356

    Microedition-Configuration: CLDC-1. 1

    MIDlet-Version: 0.0

    MIDlet-name: HelloWorld

    MIDlet-vendor:

    Microedition-profile: MIDP-2. 0

    RIM-MIDlet-flags-1: 0

    What the solution please

    I found the solution, I had to change the manifest file in the jar file and add the missing attributes in the MIDlet-1

    but now I have this error

    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&thread.ID=65289

  • MIDlet CustomItem vs Scroling

    I am creating a custom element to display values in a table like format.

    First question would be: does anyone know a library that already do (or BB only compatible J2ME)? I found http://sourceforge.net/projects/mewt/ but it is licensed GPL :-(

    Second question, is that I try a simple custom item that will go far beyond the size of the physical screen and I'm supprised to see that BB scrolls the content for both vertically than horizontally. I test as the same MIDlet on a Nokia 5300 and it scrolls vertically (but not horizontally).

    I test my code on a BB 8700 v4.2.1.101 (Platform 2.3.0.81) and an 8130 (platform) v4.3.0.66 3.1.0.35 with exactly the same result.

    No idea why the vertical scrolling does not? We need to code something special?

    File: Foo.java --------------------------------------------------------------------

    import javax.microedition.lcdui.Display;import javax.microedition.lcdui.Form;import javax.microedition.midlet.MIDlet;import javax.microedition.midlet.MIDletStateChangeException;
    
    public class Foo extends MIDlet {
    
        public Foo() {    }
    
        protected void startApp() throws MIDletStateChangeException {        Form form = new Form("My Form");        TableItem table = new TableItem("My Table");        table.setPreferredSize(500, 600);        form.append(table);        Display.getDisplay(this).setCurrent(form);    }
    
        protected void destroyApp(boolean arg0) throws MIDletStateChangeException {    }
    
        protected void pauseApp() {    }}
    

    File: TableItem.Java-

    import java.util.Date;
    
    import javax.microedition.lcdui.CustomItem;import javax.microedition.lcdui.Font;import javax.microedition.lcdui.Graphics;
    
    public class TableItem extends CustomItem {
    
        public TableItem(String label) {        super(label);    }
    
        protected int getMinContentWidth() {        return 200;    }
    
        protected int getMinContentHeight() {        return 300;    }
    
        protected int getPrefContentWidth(int height) {        return 400;    }
    
        protected int getPrefContentHeight(int width) {        return 600;    }
    
        protected void paint(Graphics g, int w, int h) {        g.drawRoundRect(0, 0, w-1, h-1, 20, 20);        Font font = g.getFont();        int lineHeight = font.getHeight();
    
            String line1 = new Date().toString();        g.drawString(line1, 0, 0, Graphics.TOP|Graphics.LEFT);
    
            for (int i=1; i<60; i++) {            g.drawString(" 1234567890 1234567890 abcdefghijklmnop this is my line " + i, 0, i*lineHeight+2 , Graphics.TOP|Graphics.LEFT);        }    }}
    

    There are two or three specific examples of BlackBerry here:

    How - to create a screen with fixed lines
    Article number: DB-00510

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

    How - to use the UI API to create an editable table
    Article number: DB-00130

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

  • Cannot find resource files in the MIDlet

    My Mission:

    Take my existing j2me application and compile and run it into the RIM JDE so that he qualified for the BlackBerry App World.

    What I've done so far:

    I took my j2me MIDlet application and copied in Eclipse (with RIM JDE plugin). I finally got to the point where he found my class main MIDlet, compiles and runs. Yes!

    Problem:

    Unfortunately, all references to image files are lost. Therefore, any references to these files throws an exception.

    More information:

    All my image files are in the 'res' folder (a little less 'src' in the hierarchy tree). I tried to move the images to different folders, but without success. And I also tried to reference the same image in different ways files: "/ res / image.png", "res / image.png", "/ image.png", "image.png".

    Has anyone out there successfully developed a MIDlet using the RIM JDE? Any help is appreciated! -Jason

    Thanks for the suggestion! It lead me to a solution...

    Although I tried to add the res folder to the path of the front structure, it seems that he was in the wrong place. Or, at least, that's what it seems, because everything I did to make it work was to create a new "res" folder from a level to the high (just below the project and at the same level as the 'src' folder) and move my picture files in this folder. I added this file to the project build path, then my reference to "/ res / image.png" worked!

    And, Yes, I have the MIDlet leaves the Netbeans environment.

  • problem using the FileConnection API (JSR 75) in an application for Blackberry "BOLD" MIDLET

    Hello

    I developed a MIDLET which is to read files and store the contents of files in arrays. I could make using the FileConnection API in J2ME (Java ME) and it works very well in mobile emulators provided by Sun, Sun Kit tool 2.5.1 wireless and Sprint Wireless tool 3.3.2 Kit. I have been using netbeans IDE 6.8 for this.

    Now, here's the deal. Playback of the files does not work when in one of the Blackberry mobile emulators. I tried to install all versions of Blackberry JDE 4.2.1 to 5.0 and test the same thing, but none of them worked.  After reading that the Blackberry plugin for Eclipse is good, I used it to find that I am always faced with the problem.

    I desperately need help. Can someone help me do the reading work file in a Blackberry emulator? I insert the code that makes the file reading. It reads a file containing a single column of 60 entries, and stores it in an array of double type.

    Vector time = new Vector();
    
    try{
    
     FileConnection filecon = (FileConnection) Connector.open("file:///" +"SDCard/BlackBerry/documents/"+"timescale.dat");
    
     if(!filecon.exists()) {    Dialog.show("Note ! ", "File doesn't exists !", "okay","cancel"); }
    
         StringBuffer sb = new StringBuffer();      try      {       InputStream in = filecon.openInputStream();       int chars;
    
           while ((chars = in.read()) != -1)// read until EOF is reached       {          if(chars == '\n') // read all characters until the end of line is reached          {              time.addElement(sb.toString().trim()); // stores all the characters as a vector element when the end of line is reached
    
                  sb.delete(0,sb.length());// clear the stringbuffer for storing the next line of the file
    
              }
    
              else          {              sb.append((char)chars); // appends each character read          }
    
          }// end of while
    
        }    catch(IOException e)    {               }
    
        filecon.close();
    
    }// end of outer try
    
       int i =0;   Enumeration etime = time.elements();
    
       while(etime.hasMoreElements() && i < 60) // timescale.dat has 60 entries in one column   {       time_1d[i]=Double.parseDouble(etime.nextElement().toString());// convert to double       i++;   }
    

    Can you elaborate on what does not work?  Is an error or exception thrown?  If Yes, what is it and what line of code triggers it?

    You have configured the BlackBerry smartphone Simulator to simulate a micro SD card?

    Use a computer filesystem in the form of microSD card

    http://supportforums.BlackBerry.com/T5/testing-and-deployment/use-a-computer-file-system-as-a-microS...

  • Error: The 'MIDlet-Version' attribute is not a valid version number

    I'm having a hard time setting up my file .jad for OTA downloads.  I get the following error when I try to access the file jad from the BlackBerry browser.

    "Error: Invalid manifest or application descriptor."   The 'MIDlet-Version' attribute is not a valid version number. »

    The content of my jad file is as follows:

    Manifest-Version: 1.0
    MIDlet-Version: 1.0.0
    MIDlet-Jar-Size: 379217
    RIM-COD-URL-2: EveryTrail - 2.cod
    Microedition-Configuration: CLDC-1. 1
    MIDlet-Jar-URL: EveryTrailBBerry.jar
    RIM-COD-Module-dependencies: net_rim_cldc, net_rim_os, net_rim_bbapi_invoke, net_rim_locationapi, net_rim_xml, net_rim_xml_org
    RIM-COD-SHA1-2: 91 64 64 84 7 b 51 06 and 43 e6 f6 da 73 e3 fc 43 b4 ed 4th 9 a 1 c
    RIM-COD-URL-1: EveryTrail - 1.cod
    RIM-COD-SHA1-1: da d9 42 24 bd a5 3f f6 a6 a4 6F 91 2f 3 a 1 fe fd has 62 e7 d7
    RIM-COD-size-2: 47788
    RIM-MIDlet-flags-1: 0
    RIM-COD-size-1: 62672
    RIM-COD-Module-name: EveryTrail
    MIDlet-name: EveryTrailBBerry
    RIM-COD-size: 67732
    RIM-COD-creation-Time: 1233537686
    MIDlet-1: EveryTrail... /... /.. / BlackBerry/EveryTrail/src/everytrail-logo-small.png,.
    RIM-COD-URL: EveryTrail.cod
    RIM-COD-SHA1: 64 b7 3B 1e 71 97 28 42 4 d 36 0 b 7th f6 94 72 83 77 99 cb 2f
    Microedition-profile: MIDP-2. 0
    MIDlet-vendor: GlobalMotion

    I have had prior success with OTA but the version number showed as 0.0 and the seller "".  I think that this problem was when I clicked on "title available resources" in the tab "resources" of the project properties.  So far, no other version number value that I have tried has been proven.  Anyone have any ideas?  Thank you!

    I had the same problem. The .jad for a project file does not get automatically regenerated during a build, so I have no pre-build defined in all my projects that removes the .jad file, causing again regenerated each time. You can set a pre-build tab step build of the project properties window. You'll want something in the sense of:

    cmd.exe /C del com\company\product\AppName.jad

    Note that the command runs with his working directory set to the location of the file to workspace rather than the project file, for example, you must specify the path to the .jad compared file.

  • setAcceptableDirections does not always work

    Hi, forcing the orientation on the blackberry Storm only works about once out of 5 on the device. On the emulator, it still works. Anyone know how we can solve this problem?

    Only 80% of working time:

    Ui.getUiEngineInstance () .setAcceptableDirections (Display.DIRECTION_PORTRAIT)

    Hi, since we have updated the firmware, we are not able to reproduce this bug.

    New Version: V4.7.0.65 (Platform 4.0.0.76)

    Thank you.

  • The application icon to convert MIDLet

    Hello

    looks like simple delivers, but might well not the answer.

    Here's the deal.

    1. building J2ME app (on NetBeans) - JAR/JAD files.

    2. create JDE project based on these files.

    3. Add the PNG (48 x 48) file to the project in the Application icon.

    4 start application on the Simulator, but the icon by default one.

    No reason why?

    BTW, app works OK, just the wrong icon.

    Thank you.

    OK, the question is closed, the solution has already been spoken on this forum.

    Just fill most important:

    1 icon file must be in the same folder with the file of the Cod .

    2. Add manually the name of the icon to the JAD file as:

    MIDlet-1: myApp, myIcon.png, myApp

  • BlackBerry App MIDlet - HttpConnection

    Hello

    I am writing my first app for Blackberry (or any other mobile device) and I'm having a problem making a Blackberry Simulator http request to a WCF service that is running locally. I use the Blackberry Eclipse plug-in, so when I run the application it launches all the MDS - CS Simulator and then starts the Blackberry Simulator. In the Blackberry Simulator, I can open the Blackberry browser and send a request to the WCF service running on my computer with no problems. The service receives the request and inserts a record in the database. However, when the MIDlet application tries to send the same http request to the WCF service, I get a http response code 400 with a response of "Bad Request" message. Here is the code I am using to send the request:

    // Make call to WCF service
    System.out.println("Making call to WCF service.");
    connection = (HttpConnection) Connector.open("http:///MyService/MyService.svc/ajax/ServiceMethod?Parameter1=1&Parameter2=2&Parameter3=3&Parameter4=4;deviceside=false");
    connection.setRequestMethod(HttpConnection.GET);
    rc = connection.getResponseCode();
    System.out.println("rc="+rc+";response message="+connection.getResponseMessage());
    connection.close();
    

    Notice that, at the end of my URL, I have '; deviceside = false. I read somewhere that you include if you use MDS; not sure if that's just fine. I have tried with and without which at the end, but I get the same answer. I've been doing a little research on Google and poking around on the Blackberry Web site, but I haven't had a bit of luck.

    Any ideas on what could be the problem? Are there changes in the rimpublic.property file that I have to do? Or other properties of the application, I need to set on the HttpConnection object?

    Thanks in advance.

    EDIT: I changed the url in the application MIDlet http://www.google.com and I got a response of 200/OK.

    I ended up creating a WCF RESTful zero service using this tutorial and it worked. I can call from the browser and the MIDlet app successfully. I guess that the original WCF service I called is not fully restorative. The way it is set up is very different from what's in the tutorial, I'll have to take a closer look.

  • MIDlet app download kick at the first screen to the receipt of the appeal

    I'm trying to understand why a MIDlet get kick to the first screen when a user accepts an incoming call. I have I would expect the OS to stay on the current screen.

    Based on the code below if you browse to the second screen (and even a third if there is one) then call/answer the phone and then hang up, you will get the kick for the first screen of the application.

    BlackBerry 8330 v4.3.0.124 (Platform 3.1.0.71)

    package pascal;
    
    import javax.microedition.lcdui.Display;
    import javax.microedition.midlet.MIDlet;
    import javax.microedition.midlet.MIDletStateChangeException;
    
    public class BBCallHandle extends MIDlet {
        private static BBCallHandle instance;
        private Display display;
    
        public BBCallHandle() {
        }
    
        public static void exit() {
            instance.notifyDestroyed();
        }
    
        protected void startApp() throws MIDletStateChangeException {
            instance = this;
            display = Display.getDisplay(this);
            Form1.getInstance(display).go(null);
        }
    
        protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
        }
    
        protected void pauseApp() {
        }
    }
    
    package pascal;
    
    import javax.microedition.lcdui.Command;
    import javax.microedition.lcdui.CommandListener;
    import javax.microedition.lcdui.Display;
    import javax.microedition.lcdui.Displayable;
    import javax.microedition.lcdui.Form;
    
    public class Form1 extends Form implements CommandListener {
        private Display display;
        private Command backCommand;
        private Command nextFormCommand;
        private Displayable previous;
    
        public Form1(String title) {
            super(title);
        }
    
        public static Form1 getInstance(Display display) {
            Form1 instance = new Form1("Form1");
            instance.display = display;
            instance.initUI();
            return instance;
        }
    
        public void go(Displayable previous) {
            this.previous = previous;
            display.setCurrent(this);
        }
    
        public void commandAction(Command command, Displayable item) {
            if (command == backCommand)
                doBackCommand();
            else if (command == nextFormCommand)
                doNextFormCommand();
        }
    
        private void doBackCommand() {
            if (previous != null)
                display.setCurrent(previous);
            BBCallHandle.exit();
        }
    
        private void doNextFormCommand() {
            Form2.getInstance(display).go(this);
        }
    
        private void initUI() {
            append("You are in form 1");
            addCommand(getBackCommand());
            addCommand(getNextFormCommand());
            setCommandListener(this);
        }
    
        private Command getBackCommand() {
            if (backCommand == null)
                backCommand = new Command("Back", Command.BACK, 0);
            return backCommand;
        }
    
        private Command getNextFormCommand() {
            if (nextFormCommand == null)
                nextFormCommand = new Command("Next", Command.SCREEN, 0);
            return nextFormCommand;
        }
    }
    
    package pascal;
    
    import javax.microedition.lcdui.Command;
    import javax.microedition.lcdui.CommandListener;
    import javax.microedition.lcdui.Display;
    import javax.microedition.lcdui.Displayable;
    import javax.microedition.lcdui.Form;
    
    public class Form2 extends Form implements CommandListener {
        private Display display;
        private Displayable previous;
        private Command backCommand;
    
        public Form2(String title) {
            super(title);
        }
    
        public static Form2 getInstance(Display display) {
            Form2 instance = new Form2("Form2");
            instance.display = display;
            instance.initUI();
            return instance;
        }
    
        public void go(Displayable previous) {
            this.previous = previous;
            display.setCurrent(this);
        }
    
        public void commandAction(Command command, Displayable item) {
            if (command == backCommand)
                doBackCommand();
        }
    
        private void doBackCommand() {
            display.setCurrent(previous);
        }
    
        private void initUI() {
            append("Hello form2");
            addCommand(getBackCommand());
            setCommandListener(this);
        }
    
        private Command getBackCommand() {
            if (backCommand == null)
                backCommand = new Command("Back", Command.BACK, 0);
            return backCommand;
        }
    }
    

    Form1.getInstance () is called from startApp() * and * whenever this happens, a new instance of Form1 is created and set as the current i.e. display.setCurrent (new Form1()). Iwould think calling incoming call pauseApp() and when call ends, startApp() is called again.

    I suggest you use System.out.println see entities (Form1@1234abcd and Thread.currentThread ()) in lanceApp and other "reminders".

Maybe you are looking for

  • How can I remove the old plugins?

    Just recently decided to go back using Firefox. Are using Chrome. Firefox has one thing that is not Chrome. So when I see a number of old plugs Ins back. How can I remove them. I set myself to never activate. After that each plug-in poster SEARCH. Bu

  • Satellite A200 - AH1 Wont Boot up

    I have a Satellite A200-AH1 (PSAE0C-AH106C), the desire for portable power on but the screen remains empty. I tried to take out the battery and let it sit. I also tried reinstalling the RAM and HARD drive.I tried to boot with no RAM at all and didn't

  • Why build on average has side effects on the parallel loop

    It is a simple parallel loop to process the average value of each waveform. When you use tools-> profile-> find parallelizable loops, it is said: This loop For may or may not be safe to parallelize. Warning (s):-One or more nodes in the loop For can

  • Win98SE compliance check win95 worn disc help

    I tried to install the upgrade from win98se, enforcement cling, my win95 drive is worn and I'm stuck, is there a way to solve or work around this problem, I'd appreciate any help.

  • Pro and Photoshop Elements 12 printing Studio

    Hello I'm having trouble installing the plugin Print Studio Pro for Photoshop Elements.  I just installed 12 items and downloaded Print Studio Pro 1.3.0.  When I try to install the plug-in, I get a message telling me that I don't have a supported Pho