Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

..
Failed to load latest commit information.
src/blackberry/ui/screen
README.md
library.xml

README.md

Screen Object

The screen object will allow you to subscribe to scrolling events on the screen, set the screen's title and show/hide the virtual keyboard.

Author: Tim Neil Adam Stanley

Tested On

  • BlackBerry Storm 9550 v5.0.0.469
  • BlackBerry Torch 9800 v6.0.0.190
  • BlackBerry Torch 9800 v6.0.0.246

Requires BlackBerry WebWorks SDK for Smartphones v5.0 or higher

Known Issues

  • Currently the setTitle() function has painting problems and isn't very functional

Have a problem with this extension? Log an Issue or contact the Author

How To Configure The Extension For Use

  1. Locate your BlackBerry WebWorks SDK for Smartphone extensions directory using your File Explorer. Default path is C:\Program Files\Research In Motion\BlackBerry WebWorks Packager\ext

  2. Create a new blackberry.ui.screen directory in the ext directory

  3. Download the source from this repository and unzip it to a location on your computer

  4. Using File Explorer browse to this extension's downloaded source code Smartphone\Screen

  5. Copy the library.xml file from the downloaded Smartphone\Screen directory to your new ext\blackberry.ui.screen directory

  6. Copy the downloaded Smartphone\Screen\src\blackberry directory to your new ext\blackberry.ui.screen\blackberry directory

NOTE: Be sure to back-up this ext\blackberry.ui.screen directory in your WebWorks SDK extensions directory before performing a WebWorks SDK upgrade. Simply copy it back into the ext directory after you have completed your SDK upgrade.

Required Feature ID

Whenever you use the below feature id in any of your WebWorks applications this extension will be loaded for use.

<feature id="blackberry.ui.screen" />

Summary

static void onScrollStart(callback : function() )
static void onScrollEnd(callback : function(verticalPosition : Number, horizontalPosition : Number) )
static void showKeyboard()
static void hideKeyboard()
static void setTitle(title : String)
 static void screenshot(filename : String)

Code Example

function foo()
{
  blackberry.ui.screen.onScrollStart( function() {
    alert('starting to scroll');
  });

  blackberry.ui.screen.onScrollEnd(function(vPos, hPos) {
    alert('Vertical Position: ' + vPos + ' Horizontal Position: ' + hPos);
  });
}

function takeScreenshot()
{
 var filename = "screenshot1.png";
  blackberry.ui.screen.screenshot(filename);
}
Something went wrong with that request. Please try again.