Package net.rim.device.api.ui.container

Examples of net.rim.device.api.ui.container.MainScreen


    /**
     * Shows the test screen to allow the user to exercise the application
     * permissions capabilities.
     */
    private void showTestScreen() {
        final MainScreen screen = new MainScreen();
        screen.setTitle("Application Permissions Demo");

        if (_eventInjectorButton == null) {
            _eventInjectorButton =
                    new ButtonField("Event Injector", ButtonField.NEVER_DIRTY
                            | ButtonField.CONSUME_CLICK);
            _eventInjectorButton.setChangeListener(this);
        }

        if (_phoneButton == null) {
            _phoneButton =
                    new ButtonField("Phone", ButtonField.NEVER_DIRTY
                            | ButtonField.CONSUME_CLICK);
            _phoneButton.setChangeListener(this);
        }

        if (_deviceSettingsButton == null) {
            _deviceSettingsButton =
                    new ButtonField("Device Settings", ButtonField.NEVER_DIRTY
                            | ButtonField.CONSUME_CLICK);
            _deviceSettingsButton.setChangeListener(this);
        }

        if (_emailButton == null) {
            _emailButton =
                    new ButtonField("Email", ButtonField.NEVER_DIRTY
                            | ButtonField.CONSUME_CLICK);
            _emailButton.setChangeListener(this);
        }

        screen.add(_eventInjectorButton);
        screen.add(_phoneButton);
        screen.add(_deviceSettingsButton);
        screen.add(_emailButton);

        pushScreen(screen);
    }
View Full Code Here


    /**
     * Creates a new CryptoDemo object
     */
    public CryptoDemo() {
        final MainScreen screen = new MainScreen();
        screen.setTitle("Crypto Demo");

        _inputField = new EditField("Text: ", "");
        screen.add(_inputField);
        screen.add(new SeparatorField());

        _statusField =
                new RichTextField(
                        "Select 'Go' from the menu to perform the test.");
        screen.add(_statusField);

        // Add the menu item
        final MenuItem go = new MenuItem(new StringProvider("Go"), 0x230010, 0);
        go.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                final String text = _inputField.getText();
                if (text.length() > 0) {
                    runTest(text);
                } else {
                    Dialog.alert("Please enter some text");
                }
            }
        }));

        screen.addMenuItem(go);

        pushScreen(screen);
    }
View Full Code Here

    /**
     * Create a new GPSDemoAdvanced object
     */
    public GPSDemoAdvanced() {
        final MainScreen screen = new MainScreen();

        // Initialize UI components
        screen.setTitle("GPS Advanced Demo");
        final LabelField apiChoiceMessage =
                new LabelField("Please select an API to test:",
                        Field.USE_ALL_WIDTH | Field.FIELD_HCENTER);
        _coreTestButton =
                new ButtonField("Core GPS API Test", ButtonField.NEVER_DIRTY
                        | ButtonField.CONSUME_CLICK);
        _extendedTestButton =
                new ButtonField("Extended GPS API Test",
                        ButtonField.NEVER_DIRTY | ButtonField.CONSUME_CLICK);
        _coreTestButton.setChangeListener(this);
        _extendedTestButton.setChangeListener(this);

        screen.add(apiChoiceMessage);
        screen.add(_coreTestButton);
        screen.add(_extendedTestButton);
        pushScreen(screen);
    }
View Full Code Here

    /**
     * Creates a new BrowserFieldDemo object
     */
    public BrowserFieldDemo() {
        _mainScreen = new MainScreen(Manager.HORIZONTAL_SCROLL);
        pushScreen(_mainScreen);
        _renderingSession = RenderingSession.getNewInstance();

        // Enable javascript
        // _renderingSession.getRenderingOptions().setProperty(RenderingOptions.CORE_OPTIONS_GUID,
View Full Code Here

import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.container.MainScreen;

public class TweetPhotoTest extends UiApplication {
  public TweetPhotoTest() {
    MainScreen screen = new MainScreen();
   
        TweetPhoto tweetPhoto = new TweetPhoto();
       
        // Clear screen
        System.out.print("\f");
        System.out.println("/// TweetPhoto Started ///");
       
        // --- TweetPhoto Sign In
        // --- APIKey, Service Name (Twitter, Foursquare, Facebook), is OAuth (true/false), username / userKey, password / userSecret
        Profile profile = tweetPhoto.signIn("your_tweetphoto_api_key", "Facebook_or_Twitter_or_Foursquare", false, "identityToken", "identitySecret");
        if (profile!=null) {
        System.out.println("Login succeeded: " + profile.describe());
        screen.add(new LabelField("TweetPhoto Sign In: " + profile.describe()));
        pushScreen(screen);
          }
        else {
        System.out.println("Login error: " + tweetPhoto.m_httpStatus);
        screen.add(new LabelField("TweetPhoto Sign In Error: " + tweetPhoto.m_httpStatus));
        pushScreen(screen);
          }
       
        // Link a service to the currently auth'd user.
        //TweetPhotoResponse response = tweetPhoto.linkService(tweetPhoto.m_APIKey, "identityToken", "identitySecret", "Facebook_or_Twitter_or_Foursquare");
View Full Code Here

TOP

Related Classes of net.rim.device.api.ui.container.MainScreen

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.