BlackBerry® DEVCON 2010 is just around the corner and we’re getting a lot of questions around what we’re going to unveil at the show. As with previous years, DEVCON 2010 will be a showcase of new technologies and tools for developers, and you can expect a number of exciting announcements on new and future products that are designed to help our developer community be successful and profitable.

This year you, our attendees, will not only be the first to hear our announcements, but we will have dedicated break-out sessions with live demos and deep dives on all of the new announcements, so you can see them firsthand and get your questions answered! We can’t share all the news yet, but here’s a sneak peek at some of the new technologies and services that you can expect to hear about at BlackBerry DEVCON 2010 on September 27th-30th in San Francisco, California:

(1) Taking Social to a Whole New Level: New Social Apps Platform for Developers

Last year we unveiled the BlackBerry Push Service and opened it up to developers around the world. The feedback has been hugely positive, and we now see new apps launching every week that take advantage of BlackBerry Push Service. But then someone asked us: “Why can I only push from a server to an app running on a device? Why can’t I push data immediately from device to device like BlackBerry® Messenger does, so my app can engage two mobile users in a truly real-time social experience”? Hmmmmmm…what a great idea! And what if that were expanded into a broader platform for mobile social apps? Sound interesting? We think so. What a great way to take Super Apps to the next level!

(2) Building Commercial Businesses on BlackBerry: New Commerce Services

BlackBerry App World™ 2.0 was a huge step forward in opening up commercial opportunities for our developer community. We added credit card and carrier billing capabilities along with the ability for customers to purchase apps from the desktop storefront. So what’s next? Well, you’ll find out at DEVCON! And you won’t just hear about what’s new – you’ll get a chance to join detailed break-out sessions with sample code, Q&A and more.

(3) New Enterprise Integration Services for Enterprise App Developers

We’re so excited about this one that we’re going to wait for DEVCON to unveil what it’s really all about. And really, the live demos will do a much better job of showcasing the power of this new platform than anything we can write in text. So let’s just say this: If you think there is still a huge opportunity out there for mobilizing mission-critical enterprise applications and back-end data stores, but feel that it is still too difficult and costly to manage data replication, client-side app development, back-end authentication and so on – well, we’re going to have some exciting things to show you!

The BlackBerry Widget platform enables full-featured apps to be built in web technologies such as HTML and JavaScript. But that was just the beginning! Find out where the BlackBerry Web platform is heading, and how we’re taking the BlackBerry Widget platform to the next level to enable full-featured, highly interactive Super Apps to be built entirely in HTML5. Sound too good to be true? Find out at DEVCON!

And that’s just a start! Come to DEVCON for hands-on experience related to these topics and the other announcements that we have planned. Oh, and did we mention that DEVCON will be your first opportunity to see BlackBerry® OS 6 running on a cross-section of BlackBerry smartphones, including the BlackBerry® Bold™ 9700 smartphone, BlackBerry® Pearl™ 9100 smartphone and more? Don’t miss out!

Please let us know if you find these developer guides helpful, as well as what else you might like to see!

]]>http://devblog.blackberry.com/2010/08/blackberry-6-browser-developer-documentation/feed/1adamstan1BlackBerry® BrowserBlackBerry BrowserHTML5 Elements for BlackBerryhttp://devblog.blackberry.com/2010/08/blackberry-html5/
http://devblog.blackberry.com/2010/08/blackberry-html5/#commentsWed, 18 Aug 2010 12:32:57 +0000http://devblog.blackberry.com/?p=2004]]>As I’m sure you’ve heard by now, WebKit has come to BlackBerry®! This is an exciting time not only for the BlackBerry Web Platform, but for web technologies in general. With the combination of WebKit and the new W3C standard for HTML5, web applications are going to become more and more powerful.

Here at Research In Motion® (RIM), we’re incredibly excited about this development. The support of WebKit and HTML5 in BlackBerry® 6 – along with the recent introduction of BlackBerry® Widgets – shows the way the platform is changing and growing for web developers looking to make rich, compelling apps that have the same look, feel and features as a native application.

HTML5 contains lots of new elements for developers to leverage, including elements to help make web content easier to index and optimize for search engines; elements that enable you to play media in your application; elements that let you take it offline; and a plethora of other features to make your application a thing of beauty. The BlackBerry implementation of WebKit and HTML5 will be no different – going forward with the BlackBerry 6 Browser and Widget engines, you’ll be able to leverage all of the same elements that you would for any desktop browsers with virtually no limitations.

With the added capabilities of HTML5 to the BlackBerry® Browser, web developers will be able to create content that they would have never been able to run through the mobile web before – compelling games, interactive media, 3D graphics, and the list goes on. HTML5 looks to be an invaluable tool for web developers around the world!

Here’s a few blogs and websites with some examples of the compelling features of HTML5:

With the announcement of the new BlackBerry® Torch™ 9800 smartphone today, I wanted to provide an overview of the device from the perspective of the developer, in order to help developers understand what opportunities this new smartphone opens up.

The BlackBerry Torch 9800 smartphone is the first to support BlackBerry® 6, which has been previewed recently on the Inside BlackBerry Blog. It opens up new opportunities for our developer community, from enhanced Java® applications to game-changing web applications to BlackBerry® Widgets using HTML5 and CSS3.

For Java developers, you can check out our BlackBerry 6 developer page for more information on the new APIs and to download the new tools needed to get started. Developers will also be able to download the latest BlackBerry Java SDK v6.0 via the Eclipse® update site.

Web and BlackBerry® Widget developers can also visit the BlackBerry 6 developer page for more information on the new capabilities. All of the existing web development tools on BlackBerry® smartphones will work with BlackBerry 6, but you will want to download the latest simulator to check out your new HTML5 content.

To coincide with the major enhancements to the BlackBerry® Browser in BlackBerry 6 with the inclusion of the new WebKit rendering engine, we have also modified the User Agent header for the browser to better reflect the type of web content supported by our browser. To ensure that your mobile and desktop websites are providing the best possible content and experience for our users, developers should modify their websites to detect this new User Agent header:

4 GB of onboard memory, with microSD support for up to 32GB (for multimedia, etc.); 512MB flash memory (Application Space)

The first BlackBerry smartphone with a physical keyboard and touch screen!

Touch screen and trackpad: Touch screen does not utilize SurePress™ – to accommodate in-market apps supporting SurePress, a TouchEvent.DOWN event will also generate TouchEvent.CLICK and TouchEvent.UNCLICK events. So what would’ve previously been a DOWN / UP sequence on previous BlackBerry smartphones supporting touch now results in a DOWN / CLICK / UNCLICK / UP sequence, where the CLICK and UNCLICK events are generated following the DOWN event.

With the exciting news of the upcoming BlackBerry® 6 release, we wanted to make sure that everyone had a chance to preview the latest WebKit rendering engine with their BlackBerry Widgets leading up to the availability of the BlackBerry® Torch™ 9800 smartphone. To do this, we are making available an early patch for the BlackBerry Widget SDK that will allow you to build your widgets so that they are both compatible with BlackBerry Device Software v5.0 and the new BlackBerry 6.

We are all very excited about the power that the new WebKit engine brings to the BlackBerry platform, and with such a major change, there were changes in the inner workings of our Widget packaging that needed to be taken into account. We also wanted to make sure that we provided developers with a mechanism so that they didn’t have to manage different sets of code to target both v5.0 and BlackBerry 6 devices.

This early patch synchronizes the two versions to the point where you don’t have to worry about it. This means is that in order to have your BlackBerry Widget run the best on both v5.0 and BlackBerry 6, you will want to apply this patch and rebuild your Widget using the Widget SDK. We will also be releasing a full upgrade of the BlackBerry Widget SDK and the BlackBerry Web Plug-ins for Eclipse® and Visual Studio® shortly.

NOTE: This patch is only for the standalone version of the BlackBerry Widget SDK and will not work with the existing versions of the BlackBerry Web Plug-in v2.0.

RIM® is looking to strongly support the HTML5 standard moving forward. As such, BlackBerry 6 no longer supports Gears functionality since that same functionality is now found in HTML5 standard.

To ease the work involved in supporting two code lines for BlackBerry Device Software v5.0 and BlackBerry 6, we have created a JavaScript toolkit that you can load into your BlackBerry Widget to provide HTML5 capabilities in Widgets running on 5.0 device software.

The JavaScript toolkit provides the following HTML5 interfaces as a simple layer over top of the Gears capabilities currently available in 5.0:

The toolkit is smart enough to know if it needs to be loaded or not, so when a page with the toolkit is loaded in the WebKit browser on BlackBerry 6, it doesn’t add these interfaces since they already exist natively. This toolkit will allow you to construct your code so that it is standards compliant and it will work on both operating systems with a single source base.

The details of how to use and retrieve this HTML5 JavaScript toolkit can be found in the same Resource Center Article which has the details on the BlackBerry Widget SDK patch for BlackBerry 6. Check it out, then come back and let us know what you think!

Creating MenuItem objects

The keywords “Hello” and “World” are displayed as captions in the menu, and corresponding JavaScript functions named “callBackHello” and “callBackWorld” are called when the user selects the respective menu items.
This example also demonstrates how to create a menu item separator. Note the first parameter of the constructor is a Boolean value, indicating whether or not the MenuItem is a separator:

When to create the menu

The most straightforward way to add menu items in your Widget application is to call the “createMenu()” method from the “onload” event which occurs immediately after the browser rendering engine loads the page. This ensures that all required JavaScript has been loaded into memory, and that when the user is ready to interact with your application, the menu has been created:

<body onload=”createMenu()”>
You can also re-build the menu at any time by calling the createMenu function elsewhere on the page:
<button id=”btnMenu” onclick=”createMenu(1)”>
Re-build menu </button>
</body>

Menu and Super Apps

One of the key principles of the Super App concept is being able to provide a contextual user experience. This means allowing your application to make use of any conditional information in order to deliver content and services that are relevant within the current context.

The Widget Menu API provides an easy dynamic user interface you can adjust to the current context of the application. By displaying menu items that are relevant to what the user is currently doing, you can increase engagement and optimize the user experience by making it easier for your users to access the information they need within your application.

The best example of effective use of a contextual menu is one that most BlackBerry users are familiar with: the Messages application. The initial context of the Messages application provides a list of messages, and the menu on this screen includes items such as “Open” and “Search By.” When a message is opened, the context of the application changes – and so does the menu, becoming relevant to the user viewing a message. The “Open” menu item is removed, and the “More” and “Add to Contacts” menu items are added. This allows the user to easily access the application functionality that is most important to them at that point in time.

Another example of how you can contextualize the menu is having your application perform an automatic check for updates on startup. If a new version of your application is available, an “Update Now” item can be added to the menu. When selected, the menu item can redirect the user to either an over-the-air download page, or launch BlackBerry App World™ to your product download page.

Another final example of effective menu usage could be to use the Widget System API to detect whether the current BlackBerry smartphone has Wi-Fi® capability, and to provide an “Enable Wi-Fi” menu item in advance of your user accessing a high-bandwidth feature of your application.

Super App Developer Challenge

By making your apps context-aware, you can easily increase the usefulness and relevance of your services and deliver the Super App experience. Effective use of Menu items in your application is a great way to provide a highly contextualized user experience.

As a reminder, BlackBerry Widget applications can qualify for the BlackBerry Super Apps Developer Challenge. If you have or are building an application that you think meets the requirements for being a Super App, please don’t hesitate to submit it to the Developer Challenge before September 6, 2010.

]]>http://devblog.blackberry.com/2010/06/how-to-add-menu-items-using-blackberry-widget-sdk/feed/0adamstan1Menu ItemsMenu ItemMenu ItemsUsing Invoke APIs in your BlackBerry widgethttp://devblog.blackberry.com/2010/06/using-invoke-apis-in-your-blackberry-widget/
http://devblog.blackberry.com/2010/06/using-invoke-apis-in-your-blackberry-widget/#commentsFri, 11 Jun 2010 05:00:00 +0000http://devblog.blackberry.com/?p=1670]]>One feature of Super Apps is that they integrate with the native applications on BlackBerry® smartphones. So, how do you go about doing this? For BlackBerry® Widgets, it’s actually pretty simple. The BlackBerry® Widget API provides the Invoke object, which allows you to design your application to seamlessly work with the other applications on the BlackBerry smartphone. This results in a richer BlackBerry smartphone user experience.

By leveraging the Invoke API, you can invoke virtually any other application on the BlackBerry smartphone through a simple API call, where you’ll set a parameter for the app you want to invoke and then pass in any parameters that application is expecting. Right out of the box, the BlackBerry API contains these APIs to invoke:

By leveraging these APIs, you can come up with a compelling user story or use case to design your application as a one-stop shop for anyone looking to organize their daily tasks through your app. Open an email, save a meeting invite, set GPS to locate the meeting room, associate tasks with that meeting – these are just a few of the countless ways you can easily leverage the Invoke APIs, taking your BlackBerry Widget to the next level and embracing the Super App concept!

Have you leveraged any of the Invoke APIs yet? Please share your stories with us here in the comments.

One of the questions I am asked quite often is how to get a BlackBerry® Widget into the market, or how to deploy it to users. The answer to this requires a bit of an understanding of the underlying technology of a BlackBerry Widget.

In the end, the BlackBerry Widget is a Java® application that leverages the BrowserField2 component. Since it’s a Java application, your Widget can be deployed using any of the available means that any other BlackBerry® application would leverage. Something to be aware of, however, is that your application will require to be signed using the Research In Motion® (RIM) code signing keys. Once signed, your application can then be deployed in one of four typical means:

2. Over The Air (OTA) download through the BlackBerry Browser
If you’ve developed a BlackBerry Widget, I’m guessing that you’re probably a web developer, which means odds are pretty good that you’ve got a website. OTA deployment can be done through the BlackBerry® Browser, where the user will download the application from your website. Since the browser comes installed by default on every single BlackBerry smartphone sold today, you have a tremendous amount of consumers out there that are only a few clicks away from downloading your application!

When deploying OTA, all you’ll need to do is host the JAD file with the respective COD files for your application and then point the URL to the JAD file. It’s the same thing as posting a file to download on a website – just use a href=”[path to my jad file]” to link to your JAD and allow the user to download the application.

3. OTA Push via BlackBerry Enterprise Server
A BlackBerry Enterprise Server administrator is able to push applications to any BlackBerry smartphone connected to that particular BlackBerry Enterprise Server. One thing to note is that utilizing BlackBerry Enterprise Server Push to send applications down to BlackBerry smartphones is only available via corporate environments, since it requires a BlackBerry Enterprise Server.

4. BlackBerry Desktop Manager
You can use this option for most applications; it uses the BlackBerry Application Loader that is installed as part of the BlackBerry Desktop Software. An automated application installer installs the application’s .alx file locally on the user’s computer. The user then navigates to the file and installs it on their BlackBerry smartphone.

For further reading, Andre Fabris has written a fantastic tutorial outlining all of the deployment models available for you to distribute your application to market as quickly and effectively as possible.

Depending on which deployment model – or combination of models – you choose, there will likely be a few prerequisites that you’ll need to set up in order to effectively make use of them. We’ve provided a document which summarizes the methods and the prerequisites that you’ll have to set up before leveraging them.

For more information and demonstrations on how to leverage these deployment mechanisms, I’d encourage you to take a look at the BlackBerry Developer Video Library, where there are several videos that provide in-depth explanations of the entire deployment process for a BlackBerry Application. I’d like to strongly encourage everyone to keep up the hard work, and leverage these deployment methods to get your apps into consumers’ hands!

]]>http://devblog.blackberry.com/2010/06/how-can-i-deploy-my-blackberry-widget/feed/0Prosanta B.BlackBerry App WorldWorking around the backlight timeout with JavaScript and meta tagshttp://devblog.blackberry.com/2010/05/working-around-the-backlight-timeout/
http://devblog.blackberry.com/2010/05/working-around-the-backlight-timeout/#commentsFri, 21 May 2010 10:00:00 +0000http://devblog.blackberry.com/?p=1627]]>The JavaScript® engine used in the BlackBerry® Browser is designed to terminate any scripts running longer than 10 seconds, or to stop running your JavaScript after the device backlight goes out. This can be a little troublesome when your application is designed to use the settimeout function to trigger an event after a given interval. You obviously don’t want your script to stop running while the user is still on your webpage. This behavior was initially implemented in the BlackBerry Browser to save battery life and network bandwidth; however, more and more web applications are leveraging AJAX and the setTimeout function to trigger timed JavaScript calls, which are then being blocked out by the backlight timeout on the BlackBerry smartphone device.

In this blog post, I’m going to show you an easy way to have your JavaScript code fired up again and running as soon as the device is woken up from the backlight going out. The method below actually came about because of the need to check if a session had expired while the user was still on a webpage, so there are some serious real world applications that could benefit from using this method. This workaround won’t actually prevent the backlight from dimming or the device from locking; it will instead re-trigger the JavaScript code once the device is woken up from the backlight being dimmed, acting as a good substitute to the setTimeout function.

The workaround is really just as simple as using an iframe with a meta tag. The solution consists of two files; index.html and autorefresh.html.

This code will actually trigger the JavaScript function ‘wakeUp’ every five seconds. When the device backlight dims, it will stop running; however, once the device backlight is activated again, the refresh meta tag triggers and begins its timing again. Five seconds after waking up, it will call wakeUp again. So a real world application of this could have the wakeUp function check to see if the user’s session has timed out, and if so, perform a JavaScript redirect to the login page in order to start up a new session again.

Have you heard of BlackBerry® Widget navigation mode yet? It is a configuration option that allows Widget developers to set their own focus-based navigation scheme. Instead of using the default mode, choosing this type of navigation mode allows you to provide your users with more granular control over how they interact with page elements in their Widget applications.

What is the default navigation mode for BlackBerry Widget applications?

When a BlackBerry Widget application is created, its default navigation mode is pointer mode. This means that a cursor, similar to a mouse pointer, moves around the screen when you scroll the trackpad or trackball. It is very similar to how the native BlackBerry® Browser application is used where different regions of the page can be interacted with, such as hyperlinks and input fields. The reason for this similarity is because of a browser field object that is embedded within a compiled BlackBerry Widget – one that is used to render embedded (and remote) web content.

However, the BlackBerry Browser input mechanism isn’t always the best fit for BlackBerry Widget applications.

Wouldn’t it be great if there was a different type of navigation scheme?

Yes, it would be great, and guess what – there is!

We call it “navigation mode,” and it’s a focus-based navigation scheme that is used in the other native BlackBerry applications. Developers define interactive regions of page content as being “focusable” (e.g. tab headers, input fields, buttons, etc.) that automatically gain focus when the user scrolls the trackpad/trackball towards them. This provides a similar user experience to how native BlackBerry applications are used, such as the Messages or Contacts application. When scrolling up and down within these applications, focus moves between each email or contact.

Another example is the home screen on your BlackBerry® smartphone. You scroll from icon to icon, rather than moving a pointer around the screen. Depending on the design/layout of your Widget application, “navigation mode” may be more intuitive, and help make it easier and quicker to navigate between interactive application elements.

Figure 2: Focus based navigation. Scrolling Up/Down changes focus between
page elements that have been marked as focusable. Ideal for an application like this,
where the screen is composed entirely of buttons.

That’s awesome. How do I use it?

1. Using either the BlackBerry® Web Plug-in for Microsoft® Visual Studio® or the BlackBerry® Web Plug-in for Eclipse®, open the configuration document (Config.xml), within your BlackBerry Widget project, and select the “Enable trackball/trackpad navigation” checkbox.

2. Add the property “x-blackberry-focusable=”true”” to whichever HTML elements within your web content you wish to mark as focusable. When navigation scrolls towards these items, they will automatically gain focus. For example:

3. Customize the default behavior of navigation mode by using JavaScript® and HTML. You can use the blackberry.focus JavaScript object and x-blackberry HTML properties to produce a more granular user experience:

blackberry.focus.setFocus(id) – sets focus to an element having the given ID.

x-blackberry-onDown=”callbackFunction()” – calls JavaScript function when focus moves down from the current element. There are also corresponding properties that allow you to capture onUp, onLeft and onRight events.

Conclusion

Implementing focus-based Widget navigation mode is only relevant on BlackBerry smartphones that have trackball/trackpad input. On a touch screen device, users interact with elements on the screen simply by touching the screen, and do not have a cursor/pointer that they can navigate among elements within an application. As a result, BlackBerry Widget developers should be aware that only touch input events are recognized on a touch screen device; regardless of whether a BlackBerry Widget application is configured to use focus-based navigation, users can only interact with elements in their Widget using touch events.

You can find more information, such as sample code and a tutorial about using navigation mode in your Blackberry Widget applications, on the BlackBerry Widget SDK page. Check it out, then come back to the BlackBerry Developer’s Blog and let us know how it worked for you.

Eclipse is a trademark of Eclipse Foundation, Inc. Microsoft and Visual Studio are trademarks of Microsoft Corporation. JavaScript is a trademark of Sun Microsystems, Inc. All other trademarks are the property of their respective owners.

WES 2010 is now less than one day away, bringing with it a bunch of exciting sessions covering a wide range of tracks for both first time attendee and the WES veteran. While we highly recommend you check out the Session Catalog yourself, we also thought it would be a good idea to get the experts’ opinions on sessions you can’t possibly miss. We asked Mike Kirkup, Director of Developer Relations about his three most exciting sessions for the Developing Mobile Applications for the Enterprise track.

Prepare to dive into an engaging discussion about best practices, tips & tricks and examples of web services that can be used within your BlackBerry® Web or Widget applications. Web Services can conveniently provide access to services and data from web-enabled Enterprise systems and can greatly enhance the level of functionality and richness of application features and capabilities.

Don’t just built apps that people like, build apps that people love! Discover great ways to integrate your application seamlessly with native BlackBerry applications such as the inbox, calendar or address book.

As one of the key features in what can make an ordinary application a Super App, tight integration with other native BlackBerry applications can help to deliver an intuitive, contextualized and highly relevant user experience which will keep users coming back for more!

Learn more about some of the common IT security and manageability considerations that exist within an organization and their potential impact on BlackBerry applications. This session will empower you with the information you need to meet enterprise standards for releasing applications in an Enterprise environment. ”Enterprise proofing” your applications will allow your users to use and enjoy applications more successfully.

Post a comment and let us know which sessions you’re excited for. We hope to see you there!

With the great reception of BlackBerry® Widgets on the BlackBerry® 5.0 operating system – and all the talk around mobile widgets in general – we are often asked, “Why do we have to repackage our widget archives for the BlackBerry® smartphone?” After recently explaining the reasons behind this to one of the attendees at Mobile World Congress, they pointed out that the information would make for a great blog article.

There are many emerging standards around mobile widgets such as W3C, JIL, BONDI and others. In all of these different technologies, a widget application is simply a ZIP archive that is loaded into a widget runtime and executed on a smartphone. Those who are working with these emerging standards – and are now working with BlackBerry Widgets – usually question why Research In Motion (RIM) repackages a BlackBerry Widget instead of leaving it as a ZIP archive. Wonder no more – the answer lies below the jump.

How are BlackBerry Widgets Repackaged?

To give a little bit of background, I thought I would first describe how BlackBerry Widgets are repackaged.

The process of using the BlackBerry Widget Packager is to bundle a widget as a native BlackBerry application, which utilizes a Browser Field Java® control to render the content and run the JavaScript.

When the widget archive is processed by the BlackBerry Widget Packager, all the web assets (HTML, CSS, JavaScript®, Images etc.) of the widget are left untouched and are encapsulated as embedded resources. The JavaScript BlackBerry Widget APIs are then added to the nested Browser Field control.

Security

The number one reason for repackaging is based on security. Standards for a mobile widget security model are still in the developing stage; some widget frameworks such as JIL (Joint Innovation Labs) have a defined security model already, while others such as a standard W3C widget don’t quite have the security topic ironed out. The W3C is looking to standardize a security framework for widgets, but that work isn’t quite ready yet.

By packaging a BlackBerry Widget, it inherits the same BlackBerry security that has been built into the operating system since day one. This allows the user or system administrator to manage and set security permissions for a widget the same way they would for any other application on the smartphone. This also means that users don’t have to figure out where to go to configure the security for a widget versus a Java application. It is all configured the same way.

Intellectual Property

One of the complaints I occasionally hear from widget developers is that normally, the entire source code and assets of their application are quickly extractable from the zip archive. By repackaging a BlackBerry Widget and processing the archive, it provides an opportunity to better protect the assets of your application.

Application Management

A BlackBerry Widget installs and uninstalls the exact same way as any other application on the BlackBerry smartphone. It appears in the same application list for viewing application details and leverages the same menu items from the Home Screen to delete an application. This provides a consistent user experience for those looking to manage their installed applications on a BlackBerry smartphone. In contrast, having a separate runtime manager and installation model for widgets did not provide the desired user experience.

Distribution Model

The ability to distribute a BlackBerry Widget was another big influence in the repackaging approach. There are already many supported mechanisms for distributing and selling your BlackBerry applications, such as:

BlackBerry App World™

BlackBerry® Desktop Manager

Pushed Over the Air installation

Install via a hyperlink in the BlackBerry® Browser

Deployment through the BlackBerry® Enterprise Server

Third party application stores

By packaging a BlackBerry Widget the same way as all other existing BlackBerry applications, it gives developers many different immediate options for distribution of their widgets.

Chicken vs. Egg

One of the tricky challenges when providing a runtime-based technology is to make sure that the desired version of the runtime is available for the developer wanting to install their application. For BlackBerry Widgets, we took the approach of making sure all the needed pieces for building a runtime were part of the BlackBerry Operating System v5.0. We then essentially created a lightweight runtime around each and every widget packaged.

This approach gives the freedom to add new JavaScript APIs and widget functionality without upgrading a runtime, and also allows a developer to create their own custom JavaScript extensions. It essentially removes the need for upgrading a runtime.

One thing that a lot of people don’t realize is that we actually distribute the full source code of the lightweight wrapper used for repackaging, found in the “device_templates” directory, as part of the BlackBerry Widget SDK. You can even make changes to this source code to better tailor it to your needs.

In Summary

The decision to repackage a standard widget archive into a BlackBerry Widget was based on many different factors, including the ability to provide the most flexible architecture for developers, the addition of security protocols, and enabling the most distribution methods possible.

I really encourage those out there who have not yet tried BlackBerry Widget development to download the tools. Give it a try and let us know what you think.

As part of the BlackBerry® Developer Relations team here at RIM, we are continually working with our development teams to design and deliver improvements to the developer tools available for building applications for BlackBerry smartphones.

In general, the most popular development tools in the market are Eclipse and Microsoft® Visual Studio®. Today I want to share some more with you on what Eclipse means for BlackBerry development, and what some of our philosophies and goals are moving forward for these tools.

We definitely understand the power and flexibility of Eclipse for many different types of development. This is the key reason why we have really been moving forward with a plug-in approach to Eclipse for both our Java and Web tooling and moving away from our traditional Java Development Environment.

We have been taking feedback and suggestions from the community and are now looking at our integration with Eclipse from a new angle. This new vision is apparent in our recently introduced Eclipse Web tooling for BlackBerry Widgets as well as combining that with major changes in the BlackBerry Java Plug-in for Eclipse version 1.1.

We really want to let Eclipse do what it does best, and add in BlackBerry tooling functionality where it is needed (BlackBerry Simulator support, Debugging, etc.). This allows you as a developer to use Eclipse for your development exactly as you would for any other project.

Support for Eclipse project artifacts and folder structures: Compatibility with source code control systems and Eclipse methodologies

Leverage familiar Eclipse functionality for BlackBerry development: Enable use of Eclipse features such as multiple source folders in a project, Eclipse variables, file and folder linking in projects, refactoring, working sets and launch configurations, and inclusion/exclusion patterns in projects

Support for multiple BlackBerry OS versions within a workspace: Reduced development time, cleaner project organization

Define project properties in a BlackBerry Application Descriptor File: XML-based files enable easy maintenance and tracking of changes using a source control system

Wizard to import sample applications or BlackBerry® Java® Development Environment (BlackBerry JDE) based projects into a workspace: Reduced development lifecycle

If you have suggestions and/or feature requests for our Java tooling, please be sure to leave me some comments on this post, because it is your feedback that will continue to help us shape our tooling.

BlackBerry® Widgets can be written entirely using web technologies like HTML and JavaScript®. However, a compiled BlackBerry Widget is simply a regular Java®-based BlackBerry® application. BlackBerry Widget developers must therefore be aware of an important requirement for deploying an application onto an actual BlackBerry® smartphone – code signing.

Has the following scenario happened to you?

After working tirelessly to create a beautiful looking BlackBerry Widget application, and having used a BlackBerry Smartphone Simulator to perform extensive testing on the many application features you have created, you eagerly load your application for the first time onto a real device. Anticipating a surreal and mind-blowing experience, you quickly search for your application’s icon to open it for the first time…

…and you get this:

Figure 1: Secure API prompt

I never saw that message during testing, what does this mean?

Don’t worry, you didn’t do anything wrong. This message simply means your application has not yet been assigned a RIM authorized code signature. The BlackBerry® Device Software has recognized that your application needs to use core BlackBerry® application program interfaces (APIs), but has not been granted the appropriate permission from RIM to do so, and therefore prevents your application from starting.

The reason you didn’t receive this message when loading your application onto the BlackBerry Smartphone Simulator is that the simulator does not perform this security check (this enables efficient deployment for testing purposes).

Why do BlackBerry Widgets need to be signed?

RIM must track the use of some BlackBerry APIs for security and export control reasons. If you use these controlled classes in your BlackBerry applications, your application must be signed using a signature key (provided by RIM) before you can load the application .cod files onto the BlackBerry smartphone.

APIs requiring signing are used during the compilation of BlackBerry Widget applications. If you have ever looked at the BlackBerry API reference document, you can see that any APIs requiring signing are indicated by a lock icon, or are otherwise noted as “signed”. Here is an example of one of the secured APIs used in packaging a BlackBerry Widget:

Figure 2: BlackBerry API Java Docs definition of secure API

How do I sign my BlackBerry Widget?

Setting up and signing a BlackBerry Widget application involves three steps:

BlackBerry code signing keys must be purchased from and registered with RIM. These keys are uniquely assigned to a developer and are good for life. During the registration process, you will set a password that you provide each time you make a code signing request.

The identity of the registered user is recognized each time any of the signature keys are used to sign an application. As such, it is very important that they are not shared among developers, as the registered user assumes responsibility for the implementation and use of the application that is signed. Never publish these keys online, as you have no way of knowing how they may be used if downloaded.

Finally, through the use of the BlackBerry Signature Tool, you can sign your BlackBerry Widget using any of the following development tools:

Your application can automatically be signed each time you build it using the BlackBerry® Web Plug-in for Microsoft® Visual Studio® 2.0 by changing the active solution configuration from ‘debug’ to ‘release signed’. You can change this configuration through the Configuration Manager menu item, found in Microsoft Visual Studio’s Build menu.

Figure 4: Changing active configuration through Configuration Manager

After making this configuration change, the next time you build your Widget, you will be prompted to enter your signing password:

Figure 5: Prompt to enter signing password

Code signing using BlackBerry Web Plug-in for Eclipse 2.0:

When building your BlackBerry Widget project using the BlackBerry® Web Plug-in for Eclipse® 2.0, you can right click on your project name in the Package Explorer window to open a contextual menu. At the bottom of the menu are two options for building, including one that will apply code signatures to your COD file(s).

Figure 6: Menu item for signing a BlackBerry Widget

After selecting this menu option, you will be prompted to enter your signing password, after which your application will be built, and signed.

Figure 7: Prompt to enter signing password

BlackBerry Signature Tool

When the BlackBerry Signature Tool signs your Widget application, you will see the following screen open. This screen displays the list of APIs requiring signing that are used by your application. Each required signature will be applied, and you will see the value in the “Status” column change from “Not Signed” to “Signed”:

Figure 8: BlackBerry Signing Authority Tool

This is great! Now what?

Take a deep breath and smile. Your BlackBerry Widget is now ready to be used and can now be deployed to your users through venues like BlackBerry App World™. Congratulations! In the comments, tell us about the latest BlackBerry Widget you developed.

Eclipse is a trademark of Eclipse Foundation, Inc. Microsoft and Visual Studio are trademarks of Microsoft Corporation. Java and JavaScript are trademarks of Sun Microsystems, Inc.

]]>http://devblog.blackberry.com/2010/03/blackberry-widgets-and-code-signing/feed/7adamstan1Menu item for signing a BlackBerry WidgetSecure API promptBlackBerry API Java Docs definition of secure APIPackaging and Signing a BlackBerry WidgetChanging active configuration through Configuration ManagerPrompt to enter signing passwordMenu item for signing a BlackBerry WidgetPrompt to enter signing passwordBlackBerry Signing Authority ToolBlackBerry Developer Resource Fridays: Week of March 15thhttp://devblog.blackberry.com/2010/03/blackberry-developer-resource-fridays-march-15th/
http://devblog.blackberry.com/2010/03/blackberry-developer-resource-fridays-march-15th/#commentsFri, 19 Mar 2010 10:00:00 +0000http://devblog.blackberry.com/?p=941]]>Welcome to BlackBerry® Developer Resource Fridays, a reoccurring event here on the BlackBerry Developer’s Blog. We’ll keep you up to date on helpful articles that have been added to the Developer Knowledge Base and other new additions to the BlackBerry Developer Zone. Here are this edition’s pearls of wisdom:

I thought I’d share a few examples of some of the HTML5 input controls supported by the BlackBerry® Browser. As you know, HTML5 is the next evolution of the hyper text markup language (HTML) standard, and the BlackBerry Browser continues to grow in order to provide support for more of the HTML5 elements as they become finalized.

One of the elements that has been finalized is the new form controls. The below HTML5 controls are supported by the BlackBerry Browser in BlackBerry Device Software version 5.0. We will continue to add support for more HTML5 elements in future versions of the BlackBerry Browser.

Datalist

You can now define list item information as an independent data structure, called a datalist. This data structure can then be associated with one or more text input fields. When the user places focus on the text field, the items in the bound data list will be displayed as selectable-drop down items.

Input

The “type” attribute of an input field includes support for a wider range of supported input types, such as date, email, color and more.

Date – In my experience, formatting and validating dates in a web form can quickly become frustrating and complicated, mainly as a result of confusion over localized date formats. In order to simplify this, when an input element is defined as a date, the BlackBerry Browser will prompt the user with an easy to use date-selection control. The input field will accept values within a pre-defined min/max range.

Email – Did you ever notice that when using the messaging application on BlackBerry® smartphones, you don’t have to type the “@” or “.” characters when you are typing an email address in the email address field? You simply press the space key, and the application adds the correct character, depending on the context of what has already been entered. This logic can now be applied to HTML input fields with a type of “email”.

For everyone who wasn’t able to attend today, we’ve embedded the WebKit demo video above for your viewing pleasure. As you can see in the video, we’ve adapted WebKit to take advantage of the incredible efficiency of the BlackBerry platform and it shows. With the new browser, pages load quickly and dynamic markup like Javascript and AJAX are fast and responsive. With improved panning and zooming it creates a seamless end user experience. The video showcases how the new browser delivers the web with full fidelity on your BlackBerry smartphone. All of this comes with full standards interoperability as shown by the 100/100 score on the ACID3 test.

As part of his App Planet keynote, Mr. Lazaridis also showcased some of the upcoming capabilities that will be supported by the new browser including:

HTML 5

CSS3

DOM L3

Not only will the new browser support all of these web technologies but we are excited to confirm that it will also support two Widget standards – BlackBerry Widgets and JIL Widgets.

This substantial step forward with WebKit and our platform efficiency will enable content developers to create robust applications for both the Web and Widget development models. This browser will deliver a compelling and powerful application experience for your users.

A key piece of any Eclipse® based tooling is the ability to provide plugin installation and updates through the Eclipse update mechanism. With a properly structured update site and tool structure, plug-in authors can allow end-users to install their tool directly into an existing Eclipse installation on the user’s machine. In addition, the plug-in author can post incremental updates of their tool to the update site, and end-users can discover and download these updates rather than download the full install on every update. The process is straightforward and seamless to the end user, as the functionality resides directly inside their tooling environment. There is no need to go to the web to figure out if an update is even available. You can simply download it, install it and restart the tool.

For various reasons, until now Eclipse update sites for our BlackBerry plug-in for Eclipse-based tools have only been available to North American users. In addition, users were prompted many times for their BlackBerry Developer Zone credentials in order to download a single package.

We are pleased to announce that Eclipse update sites for our Eclipse-based tools are now available for use around the world, and you will only be prompted once per downloaded product for your BlackBerry Developer Zone credentials. All you need to take advantage of the update sites is ensure that you download the appropriate Eclipse version for the java and web Eclipse tools, plug the update site URLs into the Eclipse update manager, and follow the bouncing ball.

]]>http://devblog.blackberry.com/2009/12/blackberry-plug-in-for-eclipse-now-available-worldwide/feed/1adamstan1BlackBerry Plug-in for Eclipse now available worldwide!How To Store Data in your BlackBerry Widgethttp://devblog.blackberry.com/2009/12/how-to-store-data-in-your-blackberry-widget/
http://devblog.blackberry.com/2009/12/how-to-store-data-in-your-blackberry-widget/#commentsTue, 01 Dec 2009 10:36:15 +0000http://blackberrydev.edstaging.com/?p=79/ Read More]]>BlackBerry® Widgets offer great means of storing data offline in your application. You can either access the SQLite database or store data on an SD card through your Widget.

Before going into how this is done, let’s take a quick look at what SQLite is. With its reputation for reliability and that it can be used across virtually any platform, SQLite can be used as the onboard backend data store. SQLite is an open source project, and requires only a built in eMMC card (found on the BlackBerry® Bold™ smarpthone/BlackBerry® Storm™ smartphone currently) or an SD Card to be inserted into the device. Data types that are used in SQLite are INTEGER, REAL, TEXT, BLOB and NULL.

In order to access SQLite and harness Google Gears™, you’ll only need to include the following code to initialize the Gears API:

When using the SQLite database, you are able to run through a variety of commands that you’d normally be able to use on a SQL database. Further documentation on the exact commands can be found on the SQLite website.

Now that we’ve gone over one of the means of storing data, lets shift gears to move towards SD cards. What is an SD card? It is a memory card developed for use in portable devices, that use either FAT or FAT32 file systems (which allow for use on virtually any host device with a reader).

In Widgets, the blackberry.io.file namespace is used to access files on the SD card. Some of the more commonly used methods are:

blackberry.io.file.saveFile

blackberry.io.file.copy

blackberry.io.file.deleteFile

blackberry.io.file.exists

blackberry.io.file.open

blackberry.io.file.readFile

Here is a quick example of how to save and read a file from the SD card:

I think these two methods of storing data will prove to be very beneficial to developers out there, as I’ve often received questions about how to architect a solution around a web app to have persistent data on the BlackBerry® smartphone. I welcome any comments and questions regarding either of these methods of storing data, and would also love to hear about any other methods you’ve used to work around data storage!

SQLite is a trademark of Hipp, Wyrick & Company, Inc. Google and Gears are trademarks of Google Inc. All other trademarks are the property of their respective owners.

The BlackBerry® Developer Conference is fast approaching, bringing with it a truckload of exciting sessions for both the experienced and budding developer. While we highly recommend you check out the Session Catalog yourself, who better to fill you in than the esteemed blogging team at the BlackBerry Developer’s Blog? Below you’ll find Director of Developer Relations Mike Kirkup’s six most exciting community related sessions.*

COM08 – Mobile Application Analytics and What They Mean to You
Mobile analytics has become an incredibly hot area lately and Raphael has positioned his talk to give you an insight into their experiences with mobile analytics including why you should use them and focal points. I think Raphael’s insights into how you should consider adapting analytics from the web concepts to mobile will be very compelling.

COM10 – Advanced UI Development: Animations, Custom Layouts and Other Tricks
Peter Werry, the lead developer for Poynt, has been pushing the limits of user interface design on the BlackBerry platform for years. He shares solid tips and tricks for making really compelling UI on BlackBerry® smartphones at a technical level. Although this is an advanced session I have no doubt that developers at all levels will learn something from Peter.

COM18 – RIMUnit: A Unit-Testing Framework for Test Driven Development on the BlackBerry Smartphone
Creating a great application is more than just development – you must ensure that your users have the best possible experience. Testing is a crucial part of the release process and many developers are looking for better ways to effectively test their products without significantly increasing costs. Sina will share their experiences with the RIMUnit open source project and how it can help you with your testing efforts.