UiApplication and MIDP

Hi all, there

I'm just pondering smething for the moment. Is a BlackBerry application that extends UiApplication considered an MIDP or CLDC application? Is there something else outside the extension of UiAppliation or not determined this? I get a strange error and I wonder if it's releated specifying me the app as a moped, when in fact it is not.

Thank you

Schalk

If it's UiApplication it will be CLDC application, if you extend MIDlet then go for MIDlet.

If you are new to development, through the thread of belo.

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

Tags: BlackBerry Developers

Similar Questions

  • How can I put a uiapplication and application in a project

    I'm a green hand and not good in English.

    I want that my blackberry project contains a uiapplication and an application which is a background thread, AutoStart, do not display the icon on the home screen.

    How to set my BlackBerry_App_Descriptor.xml?

    Please help me!

    Thank you!

    First and most important of all... Welcome to the BlackBerry forums

    Start reading this article.

    http://goo.GL/vmTJ

  • Confusion on UiApplication and Application in a

    Dear all,

    My concepts on UiApplication and Application are clear, but I'm getting confused by looking at applications such as CallBlocker etc. as

    Here are the requirements of my application

    (1) have a background application that starts automatically at the startup of the phone upward and done something.

    (2) when a particular event occurs then, open the UiApplication where we allow the user to enter something

    If the above tasks are to be done, I am able to do it by two different applications and installing it. But what I want is to have a single packaged application do two things.

    CallBlocker applications are unique packaged applications that have associated UI work and not work on user interface.

    My questions are so

    (1) are two distributed applications together somehow? (this seems a very stupid question if I understand that an application can be Ui or without AC)

    (2) ins Anternate concept being used entry point is these cases?

    Indications in this sense?

    THX

    What are the documents you find missing?

    -l'API is documented so ok, if you know what you are doing you can work with it fine.

    -the developer guides are very detailed, it takes days to read them all. you have videos on top.

    -you get dozens of examples of applications that cover almost everything you want to do in the first half - just avoid copy & paste and try to include some path.

    -knowledge base is large enough. some articles are old, but you will find something for many topics, like the two I linked.

    -the forums contain an overview on problems, just use the search

    (click on the link on resources)

    There are weak points on the development of bb, but I don't think they are related to the documentation.

  • Passing an object of the UiApplication class reference

    Hi all

    I am very new to the development of BB and have struggled for hours on something that I think should be very simple. What I have, this is the main class that extends UiApplication and a second class that implements Runnable. From a method in the UiApplication class, I create an instance of the Runnable class. After that, I call a method to start from this class and pass an object originally from the UiApplication class reference - so that I can call a method, once completed the processing of the Runnable class.

    The problem I have, is that once past the object through a call to method reference, the reference instantly cancels and causes a NullPointer exception when trying to call a method in the original class. The structure is as below, but with all the surrounding code subscribed:

    public class MainApp extends UiApplication {
    
        MainApp _MainApp;
        OtherClass _OtherClass;
    
        public static void main(String[] args) {
        MainApp _MainApp = new MainApp();
        _MainApp.enterEventDispatcher();
        }
    
        private void createOtherClass() {
            _OtherClass = new OtherClass();
            _OtherClass.someMethod(_MainApp);
        }
    
        public void response() {
            // code here
        }
    }
    
    public class OtherClass implements Runnable {
    
        MainApp _MainApp;
    
        public void someMethod(MainApp MainAppRef) {
            _MainApp = MainAppRef;
            // _MainApp object reference is null here
    
            new Thread(this).run();
        }
    
        public void run() {
            // stuff here
            // once done, call a different method
            sendDetailsBack();
        }
    
        public void sendDetailsBack() {
            _MainApp.response(); // causes a NullPointerException
        }
    }
    

    I rewrote this to only show the code at the source of the problem. I don't quite understand why the object reference is not passed correctly - I have tried many other ways to call back to the UiApplication function, including static calls.

    Any help on how I do it is very appreciated!

    Will be

    I suspect that your problem is here:

    MainApp _MainApp = new MainApp();

    I think you meant just

    _MainApp = new MainApp();

  • Push the message overall form of a substantive uiapplication

    I have a uiapplication, which has a user interface with the main menu, mainscreens and other things, but it works also on startup, in order to keep listening for updates. I made a point of entry for it, so I can push the GUI when I want to.

    And I want to inform the user, with a simple dialog screen, when theres updates day and asks if he wants to start the application (gui).

    The problem is: I want the dialogue on the home screen, like a simple notice, but I couldn't, because I try pushGlobal the uiapplication on background, and even if I had the Ui.getUiEngine (), it returns the uiengine uiapplication and then it only shows if I enterEventDispatcher(), with a white background.

    I can't extend ask just to show the dialog boxes, because my application's gui.

    I think I may have need to create two applications, an Application that extend, to manage the listener in the background and to be able to pushglobal dialogues on the home screen and an another UiApplication which extend, can be described as the first.

    Is there another approach? Is it possible to dialog boxes of pushGlobal on the home screen of a uiapplication?

    I searched a lot but I have not found someone who wanted to do what I need. In fact I think I'm on the wrong track, so I hope someone will have the answer to my problem.

    So, as I thought, the solution is quite simple.

    I created another class that extends the Application and when I want to start the listener in the background, instead of instantiating my UiApplication I just instantiate this class, which looks like this:

    SerializableAttribute public class BackgroundListener extends Application {}

    Public Sub startBackgroundThread()
    {
    New Thread() {}
    public void run() {}
    While (true) {}
    try {}
    Thread.Sleep (180000);
    } catch (InterruptedException e) {}
    e.printStackTrace ();
    }

    do my logic

    synchronized (getEventLock()) {}

    with this UiEngine, I am able to pushGlobal dialog boxes

    When I want to with the application in the background

    UI UiEngine is Ui.getUiEngine ();.
    Screen = new dialog box (Dialog.D_OK, "You have updates!",
    Dialog.OK, Bitmap
    .getPredefinedBitmap (Bitmap.EXCLAMATION),
    Manager.VERTICAL_SCROLL);
    ui.pushGlobalScreen (screen, 1, UiEngine.GLOBAL_QUEUE);
    }
    }
    }
    }. start();
    }
    }

    And my main method ends like this:

    Public Shared Sub main (String [] args) {}

    {If (args.length > 0 & {args [0] .equals ("gui")})}
    MyUiApp app = new MyUiApp();
    app.showGui ();
    app.enterEventDispatcher ();
    } else {}
    BackgroundListener app = new BackgroundListener();
    app.startBackgroundThread ();
    app.enterEventDispatcher ();
                
    }
    }

    Thanks for listening! Laughing out loud

  • UiApplication - implementation RuntimeStore vs make Singleton object / Instance

    Hi all

    I ran into a lot of trouble with putting the UiApplication instance in the RuntimeStore for later retrieval of etc. other entry points.  I used the code of this resource (http://supportforums.blackberry.com/t5/Java-Development/Make-a-running-UI-application-go-to-the-back...)

    //register the alternate on first run
    RuntimeStore appReg = RuntimeStore.getRuntimeStore();
    synchronized(appReg){
       if (appReg.get(ID) == null) {
           appReg.put(ID, new Application(...));
       }
       Application MyApp = (Application)appReg.waitFor(ID);
       //then you have the app MyApp... return it or whatever
    }
    
    //check to see if the app exists, if it does, bring it to the foreground ...RuntimeStore appReg = RuntimeStore.getRuntimeStore();synchronized(appReg){   if (appReg.get(ID) != null){       Application MyApp = (Application)appReg.waitFor(ID);       MyApp.requestForground();   }}
    

    but UiApplication.getUiApplicationInstance (); Returns IllegalStateException.

    I have posted this before and have read that I might be better to create a Singleton instance of my UiApplication - can I get some advice about how to achieve?  The code I think I should reference is:

    import net.rim.device.api.system.*;
    
    class MySingleton {
       private static MySingleton _instance;
       private static final long GUID = 0xab4dd61c5d004c18L;
    
       // constructor
       MySingleton() {}
    
       public static MySingleton getInstance() {
          if (_instance == null) {
             _instance = (MySingleton)RuntimeStore.getRuntimeStore().get(GUID);
          if (_instance == null) {
    
             MySingleton singleton = new MySingleton();
    
             RuntimeStore.getRuntimeStore().put(GUID, singleton);
             _instance = singleton;
             }
          }
    
          return _instance;
    
       }
    }
    

    Thanks in advance for any help.

    Sorry, I have not looked at your code in detail.  Simon and I wanted to understand what your application was trying to do, rather than how he did.

    What you have described so far, there is no need to put your UiApplication in RuntimeStore.  Or do you need an AlternateEntry.

    So let us try to see if we can get your app working the way you want without steps.  I'm not saying that we will succeed, but trying, we and you will understand better opportunities.

    But note that this is only my opinion and here's how I would implement what you're trying to do, with a single application. I could be missing something.

    Let's start with the listeners.

    Some listeners require a current request - for example SystemListener.  Some are not, for example telephone headsets.  Treatment is kept on a warm reboot - for example, most of the non networking Threads will be suspended and restarted.  Some are not, for example, the ApplicationMenuItems are deleted.

    Assume that at least one of your listeners requires an Application.  In general, I do not use an Application, because I use SystemListener so that I can terminate my treatment in extinction and restart under power.  Which means that you must have an Application that is started automatically.

    Now, you also want to have an icon.  Since an icon is supposed to start a UiApplication, then let us do your started automatically asks a UiApplication.  To do this, you really push a screen, but it can also "requestBackground()", so that it does not actually appear in the autostart.

    The complication here is that some of this treatment actually impossible in the early stages of implementation service, so you need to check for

    ApplicationManager... inStartUp)

    and treat them accordingly.  There is an article that describes what I think.

    So now we have one started automatically UiApplication, who listens to the system start and stop and everything stops at the stop and everything begins to start.

    Now, when you click the icon, you will not actually start your application, you're just before an existing UiApplication.

    I think that so far we have matching your needs with one exception.  What happens if you want to restart your Application?

    We have already described code that stops the processing of your request - we will work this in extinction.  You just need to run that and then do a system.exit().  Now, when your hand is called, the next time that the user clicks on the icon, it will be started just as if it was during the auto-start and will go through the same initialization.  The trick is this time, you don't want to do the requestBackground.

    Here is the key.

    (1) an initialization routine that adds the headphones and starts the other treatment.  This will also push the initial screen.

    (2) an interrupt routine that stops the treatment started in the initialization routine

    (3) main routine creates the UiApplication and adds it as a SystemListener and enterTheDisplatcher.  It checks to see if the treatment is inStartUp.

    (a) if so it horizons application - initialization will be done by the power of SystemListener.

    (b) otherwise, it executes the initialization routine

    (4) SystemListener powerUp routine that performs the initialization routine

    (5) powerOff routine SystemListener which runs the completion routine

    (6) output in your application that runs the completion routine and then call system.exit().

    I think that if you implement these parts, you will have a DBMS which deals with the way you want, with no RuntimeStorage and no AlternateEntry.

  • RecordStore opening to outside the UiApplication

    Hay,

    What is the right way to open the store from outside the UiApplication?

    I can't open the store like that? :

                   try {
                        recordStore = RecordStore.openRecordStore("data98989", true);
                   }catch (RecordStoreException rse) {
                       //exception handling
                   }
    

    I have already given on the RecordStore the UiApplication and want to read the data in the callDisconnected of the AbstractPhoneListener method. Can I do this? How do I do that?

    I've already implemented the AbstractPhoneListener and it works and listening to calls, but it just does not load data from the RecordStore. Can someone help me on this?

    Thanks in advance.

    A RecordStore can be opened only by the MIDlet Suite/Application that created it.  Note that the listeners on a BlackBerry can run in a different process to your application.  This may prevent access to a RecordStore leave in a listener.  As a work around you can use a BlackBerry persistent object.

  • uiapp starting from Ribbon and bb app menu

    Hi I'm new here - apologies if it's a clear message

    I have a developed gui application and work - typical boot sequence - MyApp extends UIApplication and the MyApp main() method creates a new instance of the app and call app.enterEventDisplatcher ();

    in the constructor of MyApp, I create an instance of MyScreen which extends screen and implements FocusChangeListener.  so far so normal if I understand correctly.

    What I want is to be able to launch my application of the Ribbon and a menu screen in the standard BB calendar app.

    It is - how?

    I'm confused by several different messages/samples on the question to know if I need another point of entry or a new application to create the menu items in the standards BB calendar app.

    Examples of popular code - necessary guidance.

    Thanks in advance

    Ken

    OK - the 'Ribbon' is the menu system app that appears when you select "switch application" in the menu system, or -press ESC on trackball devices, or press and hold the MENU button in 5.0 and later versions.

    What you are looking for is achieved by creating an ApplicationMenuItem and adding the ApplicationMenuItem to the ApplicationMenuItemRepository (for the application of the target).

    You can add a menu to the app Messages, calendar, tasks, maps, etc. (most BB apps). When your menu item is selected, the menu item "run" method is called, passing a context object. The specific object type varies from application to application.

    Of course, you'll want to sign up to the device to start menu items, so that's where the other entry point comes into play. Configure you your application for "autorun" and specify the parameter that is passed on Autostart, so that your application can make the difference between a boot system and an entry in the icon. Main() you will be SO called twice - once to start, and once again when the user clicks on the icon.

    Another thing to know - when your menu item run() is called, it's calle in the context of the application of BB. Because of the sorting thread, this app context will see a different "static" context in your application. You can read about Singletons and other entry Point before starting this project. It is complex and is an area that generates a number of horizons of discussions on this forum.

    Check out these articles and also please you to bookmark the KB for later reference:

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800639/How_to _...

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800783/How_To _...

  • Detect the moment you press menu key BlackBerry using the Midlet and GameCanvas

    Hi all

    I develop only a game and I need to detect when you press the BlackBerry menu button, so I can to pause the game. I don't want add that any new options in the menu, just pause the game when clicked. I found a lot of references using UIApplication and other things. But I use MIDLet and GameCanvas, I use a library of the rim.

    Anyone knows how I can detect when this button is pressed? Because this key is not evoke the keyPressed GameCanvas method.

    How can I do! Is there a library of RIM specific one that I can import and spread something so I can detect this key?

    Kind regards

    Vitor

    Check this thread.

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

  • How to make a popup of General Conditions and start the application later

    Hello

    Make a popup terms without white background my static main (String [] args) branches off to an instance of the Application to display the context menu.

    The user then hits accepts the T and C, and then my GUI application should start.

    What I did to start the GUI is to plan the same application and then exit. The next time static hand (String [] args) starts I then branch to the UIApplication and launch my main application.

    It works, but the time for the app restart must be at least 5 seconds.

    Is there a better way to display a popup T and C without white background, and when the user accepts the popup, the GUI starts?

    I can't believe that I fell for it, but...

    I want to dedicated this to all non-believers out there:

    package mypackage;
    
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.component.Dialog;
    
    /**
     * This class extends the UiApplication class, providing a
     * graphical user interface.
     */
    public class MyApp extends UiApplication implements Runnable
    {
        /**
         * Entry point for application
         * @param args Command line arguments (not used)
         */
        public static void main(String[] args)
        {
            MyApp theApp = new MyApp();
            theApp.invokeLater(theApp);         
    
            theApp.enterEventDispatcher();
        }
    
        /**
         * Creates a new MyApp object
         */
        public MyApp()
        {
    //        // Push a screen onto the UI stack for rendering.
    //        pushScreen(new MyScreen());
        }
    
        public void run() {
    
            pushGlobalScreen(new Dialog(Dialog.D_YES_NO, "T & C", 0, null, Dialog.GLOBAL_STATUS), 1, MyApp.GLOBAL_QUEUE | MyApp.GLOBAL_MODAL);
            System.out.println("This line should be printed only after the dialog is closed");
        }
    }
    

    Remember that you should check the user input and respond accordingly.

    E.

  • I need to extend the GameCanvas but also UiApplication

    Hello. I'm working on a game for the BB and I have a problem. The game is designed to work on other mobile devices, while it extends the common classes of MIDlet and GameCanvas. Now I'm trying to transfer my application on BlackBerry, and I'll try to find a way to extend the UiApplication and screen, classes because I need to register for keyListeners, trackBallListeners, override the navigationMovement (...) method, etc. I'm sorry if I ask too much or what I want can't happen, but I am new to J2ME and RIM. Thank you!

    game of public class extends GameCanvas implements Runnable {...}
    public class MIDlet extends MIDlet {...}

    you need to switch to the UI of the rim infrastructure, then. one or the other.

  • Creation of a library project in Eclipse using a 3rd party library

    Hello

    I am new to BB development so I hope someone can help me please. I develop my BB application using the plug-in for Eclipse 1.1.2 BB and Eclipse 3.5. I have a master project of UiApplication and some other type lilbrary projects that my main application is dependent on. However, I now need to use a third-party library. I added an external jar file to the main application and if he compiled I get an error when I tried to run in a simulator that the module is not found.

    So my main question is how to do, you use a third-party jar file? I searched the forums and found tips using Ant tools but I prefer to do it in the breast of eclipse or a tutorial, but this implies to use BB IDE but I would perfer to use Eclipse. I thought about it and found a suggestion to create a library project using the 3rd party jar file, but how does that happen? I added a lib folder to a project and the jar file, but I still had to add the jar file to my main application's java build path. To remedy this, I added the jar file in a src folder and made my main application dependent on the library project. However, when he tries to build it said the auditor does not, but I don't know where it is called for.

    I have a jar, cod and alx and jad for a third file. Please help, I am sure that this should be much easier that it turns!

    Since you already have the cod file, you can manually load the file of cod for your library of third party on the simulator by clicking the file menu in the upper corner of the Simulator window.

    Afterwards, when the deployment you need to regroup cod library third party distribution with your application folder AND add the additional appropriate lines in the making .jad file.

    (You need permission to do with third-party library).

    If you need to compile the .jar file in a .cod file so you can find instructions to do it here: http://developers.sun.com/mobility/midp/articles/blackberrydev/#4

    I hope this helps.

  • Registration for guests

    Dear Sir

    I wonder if a push application registration can be done via the server pushes lance or only via the BlackBerry smartphone running the application that receives the push or both?

    So also (or only) via the server, what is the url to register for a pin of the device if the base url is https://pushapi.eval.blackberry.com ?

    Thanks in advance,

    Best regards

    Bullety

    I got it now...

    The PushLib50 too extended UiApplication and my main application.

    So, I think they stole each other the dispatch event thread.

    So I did now my main application not UiApplication and it works now.

    Thank you all for your help!

  • BrowserField fails to open a local resource within the PIMListListener

    Hello

    I have a problem with the opening of the resources of regional settings through BrowserField inside the PIMListListener implementation.

    My local resources is an html element placed on ROOT_PROJECT/res/test.html

    I opened it to principal in UIApplication and it works fine. Howevwe, I instantiated my PIMListListener which manages caledar event, when my PIMListListener is awake performed copy the following code:

    UiApplication.getUiApplication () .pushScreen (new TestView());

    Here he code of the manufacturer of the display:

    _Config BrowserFieldConfig = new BrowserFieldConfig ();
    BrowserField _bf2 = new BrowserField (_config);
    Add (_bf2);
    _bf2.requestContent("local:///test.html");

    After the insertion of the PIMListListener calendar events call display class (screen), but the result is an empty view with this error message:

    ...

    Applicant content of error for:

    local:///test.html

    Error: resource does not exist

    ....

    the same operation done very well in the principal works of the application!

    Any ideas?

    Thank you

    You must requestForeground in your app - that's what I meant by putting you in the foreground:

    requestForeground();

    I think need you immediately after the pushScreen (_screen);

    I see no reason why you need a Thread.sleep and I urge you to remove it.  At this point in your application that you run on the thread of events, so a sleep blocks.

  • Really good GUI? help please

    Hi guys (and girls, if any).

    I develop a UIApplication and want to know if you know guys any good packets of GUI that can be used. I don't want to use the same classic look and feel that is provided in the

    net.RIM.BlackBerry.UI.Component.whatever. packages I want something different and fancy and snazzy if possible. Any ideas? all the tools? all the packages? anything @ all. Or is it possible to customizingthe default appearance to look very different from what the standard labels, buttons, etc. Fielsd look like?

    Thank you

    Dan

    I have this version that I just compiled in 4.2.1.  I suspect things will work not (like NegativeMarginScreen), but more work okay, shape memory.  Sorry I have no idea what I changed or why, and I probably did something quick and dirty so he can work.  Good luck.

Maybe you are looking for

  • Transpose lines / columns entered for Matrix

    Hi all Read a few pages on the forums of the community about me little challenge, but come to the conclusion that using the OFFSET would be the way to go, but I'm struggling with the syntax. Maybe, I'm thinking of it (Note: similar to copy paste n +

  • Pavilion g7: HP market/Admin password

    I haven't used my computer for awhile, and I forgot the password of Admin/Power-on Password. The disabled system error number is 64152385. It is a g7 Pavalion. Help, please!

  • Re: Satellite L30 (PSL33) - need of ATI display driver

    Hello If someone has display driver for Toshiba Satellite L30 (PSL33) please download on rapidshare or something.Site Web of Toshiba not working

  • Processor problem

    I had my 2 Atrix in less than a month ago and there after I did the update OTA ICS. I noticed that after the updated ICS up-to-date CPU is back to his own clock speed is to say 1, 2 GHz and not speed underclocked then usual IE 1 GHz. But this had tak

  • Where to download Safari for OSX Yosemite?

    I had trouble with Safari on my desktop Mac (OSX Yosemite) so I uninstalled. Anyone know where I can download a new installation of Safari 9.0.2 without having to upgrade to El Capitan? Thank you