The Opera Widgets Mobile Emulator

By Patrick H. Lauke

24th April 2012: Please note

Starting with Opera 12, Opera Widgets will be turned off for new users and completely removed in a later release. If you're interested in building addons for Opera, we recommend going with our extensions platform — check out our extensions documentation to get started.

Making sure that your widget looks great and works exactly as it should on mobile devices can often be a tedious process. With Opera Mobile 10 for Windows, Linux and Mac we've included the Opera Widgets Mobile Emulator — a native application that can be run directly from your desktop machine, meaning developing mobile-optimized widgets has never been easier.

Download Opera Mobile 10 including the Widgets Emulator for Windows, Linux and Mac - make sure you get an Opera Mobile 10 build and not 10.1, which only includes the browser.

Opera Widgets Mobile Emulator overview

Opera Widgets provides a complete runtime environment for widgets on mobile devices.

Opera Widgets and its Notifications window

Figure 1: Opera Widgets and its Notifications window

This includes the ability found in most common widget platforms to run minimised applications in the background (with a live updating icon, to provide things like status information) and having a separate notification area (which background widgets can use to send information to the user). Opera Widgets is available for mobile phones as a separate download, and is included in Opera Mobile 10 for Windows, Linux and Mac for easy testing and debugging of mobile widgets in a phone-like environment.

Widgets settings

Opera Widgets settings for Privacy and Developer tools

Figure 2: Opera Widgets settings for Privacy and Developer tools

The Settings dialog for Opera Widgets provides access to the Privacy options (related to the built-in password manager) and the emulator's Developer tools.

Installing widgets

As on a mobile device, there are two ways to install widgets.

Add widgets from widgets.opera.com

Figure 3: Add widgets from widgets.opera.com

Selecting the Add widgets button on the main interface loads our Opera Widgets online repository.

Of more interest to developers, though, is the ability to install widgets directly from their machine. In contrast to our old Widget Emulator, this allows for more accurate testing and debugging in an environment that closely matches an actual mobile device.

Installing a widget file

Figure 4: Installing a wgt widget file

Settings > Developer tools > Install widget allows you to browse folders on your local filesystem, locate the wgt widget file, and install it.

The specific "root" folder used by the emulator will vary depending on your operating system. For instance, on Linux this will be the current user's /home/[username]/ folder.

For more information on widget development, see our series of articles for the Opera Widgets SDK.

"Local" remote debugging

With Opera Dragonfly you can check pages running in Opera Mobile 10 directly from within your main browser, giving you access to the full power of our debugging tool.

Opera Dragonfly (undocked in a separate window) debugging a Web page in Opera Mobile 10

Figure 5: Remote debugging with Opera Dragonfly (undocked in a separate window)

As demonstrated in Daniel's blog post (with added video goodness) Opera Mobile 10 and its remote debugging party trick, the process involves:

  • Setting Opera Dragonfly to listen for remote connections.
  • Establishing a connection from Opera Mobile 10 to Opera Dragonfly by going to the opera:debug internal address.
Opera Dragonfly (undocked in a separate window) debugging a widget running in the Opera Widgets Mobile Emulator

Figure 6: Remotely debugging a widget with Opera Dragonfly

Debugging widgets running in the Opera Widgets Mobile Emulator is similarly easy. Once Opera Dragonfly is set to listen for remote connections, simply go to the Settings > Developer tools > Remote access dialog to establish the connection, as outlined in our previous Remote debugging of widgets on mobile devices article.

As Opera Mobile 10 for desktop and the Opera Widgets Mobile Emulator both run on the same machine as Opera Dragonfly, there's no messing around with IP-addresses and port numbers — the default loopback/localhost address of 127.0.0.1 and standard port of 7001 should always work fine.

Conclusion

We hope that with Opera Mobile 10 for Windows, Linux and Mac and the included Opera Widgets Mobile Emulator we've made it easy and straightforward for developers to optimise their sites and widgets for mobile delivery. So what are you waiting for? Happy testing and debugging!

p

Web Evangelist in the Developer Relations Team at Opera Software ASA.
Product manager for Opera Dragonfly – Opera's built-in web developer tools.
http://www.opera.com/dragonfly/


This article is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported license.

Comments

The forum archive of this article is still available on My Opera.

No new comments accepted.