Would you like to tell us how we are doing?

You bet No thanks

Sorry about the red box, but we really need you to update your browser. Read this excellent article if you're wondering why we are no longer supporting this browser version. Go to Browse Happy for browser suggestions and how to update.

SVG CLDC sample app

The SVG CLDC sample application demonstrates how to create and render three shapes (a circle, a spiral, and an ellipse), using the SVG APIs. The sample application uses APIs that are implemented using the JSR 226 standard for interactive and animated 2-D graphics on the Java ME platform.

You can use the approach that the sample application demonstrates as an alternative to generating an SVG image by defining it in an .svg file. You can also use this approach to manipulate SVG images during the runtime of the application.

Filename

Description

SVGCLDCDemo.java

application, which includes the application's entry point that starts the application and displays the SVGScreen

SVGScreen.java

Screen class, which creates and displays the images

Util.java

utility class that converts values that are hard-coded for the BlackBerry Bold 9000 Smartphone to values that will render the SVG images correctly on the device that runs the application

This sample features the following classes:

javax.microedition.m2g.SVGImage

This class represents an SVG image that conforms to the W3C SVG Tiny 1.2 profile. The SVGImage that the sample application creates is a null image.

The sample application uses this SVGImage class to access the Document object that it needs to create the DOM tree structure for SVG elements.

Install the sample app

Visit http://www.blackberry.com/go/svgcldcsample to download the sample application.

Extract the svgcldcdemo.zip file.

On the taskbar, click Start > Programs > Research In Motion > BlackBerry JDE 4.7.0 > JDE.

Open the workspace that you want to add the sample application to.

In the workspace tree, right-click the project that you want to add the sample application to.

Click Add project to <workspace directory> .

In the Add project to <workspace> dialog box, browse to the folder where you extracted the sample application.

Click the SVGCLDCDemo.jdp file.

Click Open.

The sample app is also available in github.

Run the sample app

In the workspace where you added the svgcldcdemo project, right-click svgcldcdemo.

Click Build project.

On the taskbar, click Start > Applications > Research in Motion > BlackBerry JDE 4.7.0 > Device Simulator.

On the Home screen of the BlackBerry Smartphone Simulator, click the Downloads folder.

Click the SVG CLDC Demo icon.