Package net.rim.device.api.system

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


   * Registers pattern matcher so that this application can handle certain URI
   * schemes referenced in other applications.
   */
  private static void registerStringPattern() {
    if (!sInitialized) {
      RuntimeStore runtimeStore = RuntimeStore.getRuntimeStore();
      UriActiveFieldCookieFactory factory = new UriActiveFieldCookieFactory();
      runtimeStore.put(FACTORY_ID, factory);

      StringPattern pattern = new UriStringPattern();
      StringPatternRepository.addPattern(pattern);

      sInitialized = true;
View Full Code Here


    }

    private void setUiRunningIndication() {
        Object ui_running_token = new Object();
        RuntimeStore rts = RuntimeStore.getRuntimeStore();
        rts.replace(Constants.UI_IS_RUNNING, ui_running_token);
    }
View Full Code Here

    public void run() {
        boolean running = true;
        Utilities.log("XXXX " + Thread.currentThread().getName() + " Starting RuntimeStore monitoring for screen");
        while(running) {
            try {
                RuntimeStore rts = RuntimeStore.getRuntimeStore();
                try {
                    Utilities.log("XXXX " + Thread.currentThread().getName() + " waiting for object from RTS");
                    Object obj = rts.waitFor(NfcTransHandlerApp.PASSED_TO_UI_DATA_ID);
                    Utilities.log("XXXX " + Thread.currentThread().getName() + " got object from RTS=" + obj);
                    if(obj != null) {
                        String aids_received = (String) rts.remove(NfcTransHandlerApp.PASSED_TO_UI_DATA_ID);
                        Utilities.log("XXXX " + Thread.currentThread().getName() + " AIDs received are:" + aids_received);
                        setAidsReceived(Utilities.hexPresentation(aids_received));
                        UiApplication.getApplication().requestForeground();

                    }
View Full Code Here

            return "OFF";
        }
    }

    public static boolean isUiRunning() {
        RuntimeStore rts = RuntimeStore.getRuntimeStore();
        Utilities.log("XXXX isUiRunning()");
        Object ui_running_token = rts.get(Constants.UI_IS_RUNNING);
        if(ui_running_token != null) {
            return true;
        } else {
            return false;
        }
View Full Code Here

            return false;
        }
    }

    public static void setUiNotRunningIndication() {
        RuntimeStore rts = RuntimeStore.getRuntimeStore();
        rts.remove(Constants.UI_IS_RUNNING);
    }
View Full Code Here

    }

    private void showDetailsScreen(final String aids) {
        Utilities.log("XXXX " + pid + ":" + Thread.currentThread().getName() + " showDetailsScreen...");
        Backlight.enable(true, 10);
        RuntimeStore store = RuntimeStore.getRuntimeStore();
        try {
            if(!Utilities.isUiRunning()) {
                Utilities.log("XXXX " + pid + ":" + Thread.currentThread().getName() + " UI not running");
                int pid = ApplicationManager.getApplicationManager().launchApplication("NfcTransactionHandler");
                Utilities.log("XXXX " + pid + ":" + Thread.currentThread().getName() + " PID = " + pid);
            } else {
                Utilities.log("XXXX " + pid + ":" + Thread.currentThread().getName() + " UI already running");
            }
        } catch(final ApplicationManagerException e) {
            Utilities.log("XXXX " + pid + ":" + Thread.currentThread().getName() + " Error:" + e.getMessage());
        }
        store.put(PASSED_TO_UI_DATA_ID, aids);
    }
View Full Code Here

     *
     * @return The singleton instance of the OTABackupRestoreContactCollection
     *         class
     */
    static OTABackupRestoreContactCollection getInstance() {
        final RuntimeStore rs = RuntimeStore.getRuntimeStore();

        synchronized (rs) {
            OTABackupRestoreContactCollection collection =
                    (OTABackupRestoreContactCollection) rs.get(AR_KEY);

            if (collection == null) {
                collection = new OTABackupRestoreContactCollection();
                rs.put(AR_KEY, collection);
            }

            return collection;
        }
    }
View Full Code Here

     * @return The singleton instance of the MessagelistDemoStore
     */
    public static synchronized MessageListDemoStore getInstance() {
        // Keep messages as singleton in the RuntimeStore
        if (_instance == null) {
            final RuntimeStore rs = RuntimeStore.getRuntimeStore();

            synchronized (rs) {
                _instance = (MessageListDemoStore) rs.get(MSG_KEY);

                if (_instance == null) {
                    _instance = new MessageListDemoStore();
                    rs.put(MSG_KEY, _instance);
                }
            }
        }

        return _instance;
View Full Code Here

     * Returns the singleton instance of the AddressBook
     *
     * @return The singleton instance of the AddressBook
     */
    static AddressBook getInstance() {
        final RuntimeStore rs = RuntimeStore.getRuntimeStore();

        synchronized (rs) {
            AddressBook addressBook = (AddressBook) rs.get(ADDRESS_BOOK);

            if (addressBook == null) {
                addressBook = new AddressBook();
                rs.put(ADDRESS_BOOK, addressBook);
            }

            return addressBook;
        }
    }
View Full Code Here

TOP

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

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.