How to lock access to the application user interface?

Hello

Our user interface application is configured to start automatically in the background when the BlackBerry is turned on.

We have a configuration property (ShowUserInterface) in the application that will allow users to access the user interface by clicking on the application icon.

Application continues to run in the background regardless of whether or not the ShowUserInterface configuration setting is 1 or 0.

If the device is configured with ShowUserInterface = 1, the user interface does not appear to the user until the user clicks on the icon of the application. If the user closes or closes the application then it will continue to run in the background and maintain its condition.

By clicking on the application icon again will open the application in its state of the screen.

If the device is configured with ShowUserInterface = 0, then the user interface does not appear even when the driver click on the application icon.

Please help how to achieve this?

A code snippet

public class MyApplication extends UiApplication
{
    private Configuration config;

    private BackGroundThread _thread;

    public static boolean fromService = true;

    // Boot
    public static void main(String[] args) {
        if (args != null && args.length > 0 && args[0].equals("gui")) {
            // code to initialize the app by icon click
            fromService = false;
            MyApplication app = new MyApplication();
            app.enterEventDispatcher();
        } else {
            MyApplication app = new MyApplication();
            app.enterEventDispatcher();
        }
    }

    public MyApplication() {
        if (fromService) {
            _thread = new BackGroundThread(); // create a new separate thread
            _thread.start(); // start the thread

        } else {
            if (config.isShowUserInterface()) {
                pushScreen(new LoginScreen());
            } else {
                // what to do here?
            }
        }
    }
}

When the user clicks on the icon of the application and config.isShowUserInterface () = false in this case I'm not pushing any screen of the application. It is for me only IU lost Focus error.

Any help will be appreciated.

Thank you

Look at acceptsForeground().  I think that you can simply return config.isShowUserInterface ().

Tags: BlackBerry Developers

Similar Questions

  • Shared "Top N" gets access denied - the custom user interface

    I shared some dashboards for a standard user to vCops the custom user interface, and the "Top N" widgets do not work.

    So far, everything has been fine.

    I shared a dashboard home, as well as a vCops of the box and a pak of SAP management dashboard.

    All widgets 'Top N' display 'access denied to the requested page.

    Other parts of the same work of dashboard (home).

    Any thoughts?

    There is a permission that you add to the group to which you share the dashboard. There are permissions to a 'Top - N analysis' you must give to this group. In the contrary case, the refusal of access will appear when users in this group are attempting to access the dashboard in question.

  • How to restrict access to the service web application deployed on weblogic for user group only

    I built the web service application in jdevelopler 11.1.1.7. Their security policy applied in the web service of the default Oracle policy which is (policy: Wssp1.2 - 2007-Https-UsernameToken - Plain.xml)

    Now all want to access the web service application must provide the name of user and password in the header section of the SOAP request to meet the requirement of the policy.

    the following steps I'm trying to restrict access to the application of web service with a specific group of users among users of weblogic:

    Connect to the weblogic administration console

    Create user or group of users

    Click on the links of deployments

    Select your web service

    Click the Security tab

    Click the sub-tab political

    Choose your authorization provider in the menu drop-down (looks like by default)

    Choose Add Conditions-> Group-> Type in the name of the Group

    Finishing

    But access is always available for all weblogic users (IE users not in the group specified in the above security configuration). How can I restrict access to only authorized group? Any thing lacking in my approach?

    There is nothing wrong with the steps mentioned in the question. In addition, you must do the following

    At the time of the application deployment with regard to the security part, there is a list in the title of the question (which security template you want to use with this application?)

    You must select (Advanced: use a custom template that you have configured on the page of configuration of the Kingdom) a configuration mentioned in the question will be work

  • I am running xp sp3 and cannot find the movie maker software in the all programs list, how can I access this software application

    original title: access to Movie Maker

    I am running xp sp3 and cannot find the movie maker software in the all programs list, how can I access this software application?

    You are welcome and thank you for the comments.

  • How to unlock the c: drive. I have only access to the folder users and subfolders.

    I have only access to the folder users and subfolders.  Everything I tried was "access denied."  I can't get to the root of c:.

    Hi, Scrivmark

    The default C: drive system is not intended to access directly by users and therefore users have restricted access to its root in the premeditated or premeditated damage prevention vital system files. If you are an administrator you can allow full access to your account to all or specific files on drive c (including a root folder) by editing its ' authorization of the lists by right-clicking on a file and choosing "Security."
    If you are not an administrator, you should ask another user whose account is Administrator (or equivalent) privileges to access the interesting files to your account.
    In both cases, you must understand damage system files, you can do.

    This suggestion is the intention that your computer is virus-free.

  • How can I check my battery life in Windows 8 in the modern user interface?

    I recently bought a RT of Surface. While I check the battery via the icon (no numbers) displayed in the modern user interface (by lock screen or the menu of charm), I can't seem to find the life of battery exact (in numbers) in the modern user interface. Any help?

    OK, you want the straight hours? Go to your desktop (not your departure). If you do not know the difference at the beginning is with tiles. Stand on the right side which is your battery icon. If it does not show an icon, follow other users have said. When you scroll over it, it will tell you how many hours and minutes you still have a percentage. Right now, mine is at 1 h 16 min with 26% battery. You can click if you want as well and it will tell you the same thing but with options on how you can save battery

  • The August 2012 calendar items are not available in the calendar of the modern user interface application

    The August 2012 calendar items are not available in the calendar of the modern user interface application.  They are available through a web browser and the application MS Office Outlook.  Y at - it a setting or another way to access old calendar items in the modern user interface.  The phone application has the same problem.

    Original title: elements of August 2012 calendar

    Hello

    I suggest for the link and run the troubleshooting utility Apps and follow the other steps in the article:

    What to do if you have problems with a soft

    http://Windows.Microsoft.com/en-in/Windows-8/what-troubleshoot-problems-app

    See also:

    Application of calendar for Windows: FAQ

    http://Windows.Microsoft.com/en-in/Windows-8/calendar-FAQ

    Stay in touch with email and calendar

    http://Windows.Microsoft.com/en-us/Windows-8/mail-calendar#1TC=T1

    I hope this helps. If you have any other queries/issues related to Windows, write us and we will be happy to help you further.

  • Use the ADF security to grant access to the application

    Hello

    One of our customers has to move their forms ADF application. The customer also wants to implement SSO using Kerberos. I could implement the ADF to the application security.

    The Application has two types of users whose information is stored in the USERS table in the database-

    1. Users of the application (not a domain user)
    2. Active Directory/domain users.

    What the clients want to do, is that if the user belongs to the domain, while the user must be able to view the home page directly. If the user is not a domain user, then the login page must be displayed and the user must be authenticated before the redirection to the home page.

    The first part, i.e. to implement SSO for users in domain works. But I don't know exactly how to proceed with the Application users.

    Can I create a custom authenticator that connects to the database and authenticate users of the Application?

    Any suggestion and pointers will be helpful.

    Thanks and greetings

    Tinto

    You probably don't need to create the custom authenticator.

    WLS provides already ReadOnlySQLAuthenticator: Configuration of authentication - 11 g Release 1 (10.3.6) providers

    Define "control indicator" for two suppliers of "SUFFICIENT".

    I guess within the Web.XML you have something like:

    CLIENT-CERT

    ?

    WLS supports several methods of connection in the element for you can use something like:

    CLIENT-CERT, FORM

    Login

    errorPage

    (no doubt simpler is to configure the security of form based in the ADF Security Assistant and then manually add CLIENT-CERT in the web.xml file)

    Dario

  • How to restrict access to a single user for a proxy in OSB service

    How to restrict access to a single user for a proxy in OSB service

    A. go to the Proxy Service and click on the Security tab

    B. click on Transport Acess political of control to be edited.

    C. click Add to the terms to restrict users.

    D. in the main list, select the category from the user

    E. give the user name to which you want to give access.

  • How to run the Manager user interface programmatically

    I am looking for a method to run programmatically (from Labview), the Manager user interface, and then to connect it.

    Is there an API from .net to who?

    Thank you

    Note: I developed for earlier versions of VeriStand, a high-level application that manages projects of test benches and their versions. I want to update with the new manager of the user VeriStand interface.

    It is not a .NET API to control UI Manager, but there are some command line utilities, you can use to launch the user interface Manager, open a specific project, specify the IP address of the gateway to use and connect automatically.

    Try the following command line arguments:

    /nivsprj 'c:\project.nivsprj' Gateway localhost / connect

    They are documented in the online profile of Stimulus help editor.

  • How do you program to the new user account?

    I have successfully created a new user account under XP, but it doesn't have the programs in my account. How to load these into the new user account?

    Hello

    Thanks for joining us!

    You want to know "how to copy data from a corrupted to a new profile in Windows XP user profile".

    What is the edition of Windows XP, work?

    Please see this link:

    How to copy data from a corrupted to a new profile in Windows XP user profile

    http://support.Microsoft.com/kb/811151

    I hope that helps!

    If the problem persists, let us know.

    If you encounter problems with Windows, please keep us informed.

    We will be happy to help you.

  • How to recover the active user interface objects on a screen?

    Hello

    Is it possible to recover all of the active user interface objects on a screen?

    I found ago api like net.rim.device.api.ui.Screen.getFieldWithFocus, but how to get sound type of subclass as ButtonField or BitmapField?

    another take:

    If you retrieve the field with focus, you can check what type of field you have recovered (using instanceof, for example)

  • Problem with the receiver of messages in Backgroundlisterner Application user interface Thread

    Hi all

    I have a UI application with earpiece in the background with MessageListener interface and I'm regestering it to receive Notification of incoming text Messages on a particular port.

    But the notifyIncomingMessage() is never called and sms always comes in the Inbox.

    If using port 8855, and

    _mc = (MessageConnection)Connector.open("sms://:8855");
    _mc.setMessageListener (this);

    Detail of my code.

    I have one user interface application with the other point of entry, in the background I register mylistener, so he notifys me message inbound, and then I can launch my application with user interface.

    Code:

    My Application user interface.

    public static void main(String[] args)
        {
    
            if(args != null && args.length > 0 && args[0].endsWith("gui"))
            {
    
                MyUiApplication mb = new MyUiApplication();
                mb.enterEventDispatcher();
            }
            else
            {
                //Entered through the alternate application entry point
                    BackgroundListener.waitForSingleton();
            }
    
        }
    

    And my bottom Lisnter looks to...

    public class BackgroundListener implements PIMListListener, javax.wireless.messaging.MessageListener
    
    public BackgroundListener()
        {
            try
            {
                System.out.println("Adding the Message Listner");
                //Implementing the Message Listner:
                _mc = (MessageConnection)Connector.open("sms://:8855");
                _mc.setMessageListener(this);
    
            }
            catch(Exception e)
            {
            }
        }
    
    public void notifyIncomingMessage(MessageConnection conn)
        {
            System.out.println("BBBBBBB Received the SMS,Read Message Thread Start BBBBBBBBBB");
            Logger.log(DEBUG, "BBBBBBB Received the SMS,Read Message Thread Start BBBBBBBBBB");
            //startMessageReadThread();
    
            new Thread()
            {
                MessageConnection connection;
                Thread set (MessageConnection con)
                {
                    this.connection = con;
                    return (this);
                }
                public void run()
                {
                    try
                    {
                        Message m = connection.receive();
                        String msg = null;
    
                        if (m instanceof TextMessage)
                        {
                            TextMessage tm = (TextMessage)m ;
                            msg =tm.getPayloadText();
                        }
                        if (msg.equals(CBConstants.SMS_CMD_SYNC))
                        {
    
                        }
                        //if ()
                    }catch(Exception error)
                    {
                        System.out.println(error.getMessage());
                    }
                }
            }.set(conn).start();
    
        }
    
    public static BackgroundListener waitForSingleton()
        {
            //Ensure this is a singleton instance.
            //Open RuntimeStore and obtain the reference of BackgroundListener
            Logger.log(DEBUG, "In the Listener class");
            RuntimeStore store = RuntimeStore.getRuntimeStore();
            Object obj = store.get(RTSID_LISTENER_ID);
    
            //If obj is null, there is no current reference to BackgroundListener
            //Start a new instance of BackgroundLIstener if one is not running
            if(obj == null)
            {
                Logger.log(DEBUG, "In the Listener class obj is null so newBackgroundlistener");
                store.put(RTSID_LISTENER_ID, new BackgroundListener());
                return (BackgroundListener)store.get(RTSID_LISTENER_ID);
            }
            else
            {
                Logger.log(DEBUG, "In the Listener class, already a instance so will return the obj");
                return(BackgroundListener)obj;
            }
        }
    

    Can someone please suggest me where I am doing wrong.

    I also saw all the methods for sms listening, with the datagram and messagelistener.

    As this will be contineously run in the background, I thought about MessageListener.

    Any help appreciated.

    Thank you

    Anne Laure

    I received the demand for labour,

    I changed the port to '0', although it is in the Inbox. But now its okay for me, because the unit does not receive it IDE oucederomsurlesecondport 8855.

    Thank you

    Anne Laure

  • If I want to hide an object in the back how I would do on the application on my phone?

    If I want to hide an object in the back how I would do on the application on my phone?

    Hi erikag,

    You wouldn't be able to do it on the Mobile with Lightroom application.

    You must use the Lightroom / Photoshop on your computer for such purposes.

  • How to sign out of the application of the shape on iphone?

    How to sign out of the application of the shape on iphone?

    rolandomarazzi Here's how you disconnect (disconnect) the form of Adobe on iPhone application:

    • Out again the form of Adobe, then launch Adobe application forms app.
    • Press 'x' in the lower left corner to move the camera view of the library.
    • In the library view tap the icon in the upper left corner of the screen. The settings screen is displayed.
    • On the settings screen, tap my account. The account appears.
    • Tap Adobe ID email address listed below.
    • On the shortcut menu that appears, press disconnect.

Maybe you are looking for