Skip to content
Browse files

BlackBerry Samples for Java release 7.1.0.

An Open Source version of the samples as they were released
with the 7.1.0 Java Development Environment release.

The BlackBerry Samples for Java project is an Open Source
repository of samples that in the past were released through
the BlackBerry Developer Knowledge Base or within the
BlackBerry Java Tools.  The samples range in scope from Hello
World, to Advanced UI components and include both samples and
libraries that offer extended functionality.

Copyright (c) 2011 Research In Motion Limited

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
  • Loading branch information...
1 parent ec58ace commit c2fd97826a7d9d17007e49974959baa898a9af31 @slegge slegge committed Dec 1, 2011
View
64 com/rim/samples/device/contactlinkingdemo/ContactLinkingDemo.java
@@ -39,21 +39,16 @@
/**
* A sample application demonstrating the ability to link application specific
- * contacts with contacts in the BlackBerry address book.
+ * contacts with contacts in the BlackBerry address book. Note that an address
+ * book contact can be linked to by more than one application.
*/
public final class ContactLinkingDemo extends UiApplication {
/**
- * The primary application id for this application
+ * The application id for this application
*/
public static final long APPLICATION_ID = 0x819417e94b6ca3b7L; // com.rim.samples.device.contactlinkingdemo.APPLICATION_ID
/**
- * A secondary application id used to demonstrate how a BlackBerryContact
- * can be linked to by more than one application.
- */
- public static final long SECONDARY_APPLICATION_ID = 0x62501e608346866eL; // com.rim.samples.device.contactlinkingdemo.SECONDARY_APPLICATION_ID
-
- /**
* Entry point for application
*
* @param args
@@ -62,63 +57,34 @@
public static void main(final String[] args) {
if (args != null && args.length > 0) {
if (args[0].equals("autostartup")) {
- // Create images
- final EncodedImage encodedImageBlue =
+ // Create image
+ final EncodedImage encodedImage =
EncodedImage
.getEncodedImageResource("img/logo_blue.jpg");
- final EncodedImage encodedImageBlack =
- EncodedImage
- .getEncodedImageResource("img/logo_black.jpg");
- final Image imageBlue =
- ImageFactory.createImage(encodedImageBlue);
- final Image imageBlack =
- ImageFactory.createImage(encodedImageBlack);
+ final Image image = ImageFactory.createImage(encodedImage);
// Create an application descriptor for this application
final ApplicationDescriptor applicationDescriptor =
new ApplicationDescriptor(ApplicationDescriptor
.currentApplicationDescriptor(),
- "Contact Linking Demo 1",
+ "Contact Linking Demo",
new String[] { "menu-invoked" });
- final ApplicationMenuItem[] items1 = new ApplicationMenuItem[2];
- items1[0] = new SampleMenuItem(APPLICATION_ID, imageBlue);
- items1[1] = new SampleMenuItem(APPLICATION_ID, imageBlue) {
+ final ApplicationMenuItem[] items = new ApplicationMenuItem[2];
+ items[0] = new SampleMenuItem(APPLICATION_ID, image);
+ items[1] = new SampleMenuItem(APPLICATION_ID, image) {
public String toString() {
return "Test item 2";
}
};
- LinkedContactUtilities.registerMenuItems(items1,
- APPLICATION_ID,
+
+ LinkedContactUtilities.registerMenuItems(items, APPLICATION_ID,
LinkedContactConstants.COMPOSE_SN_MENU_GROUP,
applicationDescriptor);
- // Creating a second descriptor to demonstrate how a given
- // BlackBerryContact can be linked to more than one application.
- final ApplicationDescriptor appDesc2 =
- new ApplicationDescriptor(applicationDescriptor,
- "Contact Linking Demo 2",
- new String[] { "menu-invoked" });
-
- final ApplicationMenuItem[] items2 = new ApplicationMenuItem[1];
- items2[0] =
- new SampleMenuItem(SECONDARY_APPLICATION_ID, imageBlack) {
- public String toString() {
- return "App 2 item";
- }
- };
-
- LinkedContactUtilities.registerMenuItems(items2,
- SECONDARY_APPLICATION_ID,
- LinkedContactConstants.COMPOSE_SN_MENU_GROUP, appDesc2);
-
- // Register info providers
+ // Register info provider
LinkedContactUtilities.registerLinkedContactInfoProvider(
- new SampleLinkedContactInfoProvider(imageBlue,
- "Demo App 1"), APPLICATION_ID,
- LinkedContactConstants.COMPOSE_SN_MENU_GROUP);
- LinkedContactUtilities.registerLinkedContactInfoProvider(
- new SampleLinkedContactInfoProvider(imageBlack,
- "Demo App 2"), SECONDARY_APPLICATION_ID,
+ new SampleLinkedContactInfoProvider(image, "Demo App"),
+ APPLICATION_ID,
LinkedContactConstants.COMPOSE_SN_MENU_GROUP);
} else if (args[0].equals("menu-invoked")) {
// Create a new instance of the application and make the
View
71 com/rim/samples/device/contactlinkingdemo/ContactListScreen.java
@@ -35,7 +35,6 @@
import net.rim.blackberry.api.invoke.Invoke;
import net.rim.blackberry.api.pdap.BlackBerryContact;
import net.rim.blackberry.api.pdap.BlackBerryContactList;
-import net.rim.blackberry.api.pdap.contactlinking.DefaultLinkableContact;
import net.rim.blackberry.api.pdap.contactlinking.LinkableContact;
import net.rim.blackberry.api.pdap.contactlinking.LinkedContactUtilities;
import net.rim.device.api.command.Command;
@@ -92,7 +91,6 @@ public ContactListScreen() {
_viewEmailMenuItem = new ViewEmailMenuItem();
_viewPhoneMenuItem = new ViewPhoneMenuItem();
_linkToBbContact = new LinkToContactMenuItem();
- _altLinkToBbContact = new AltLinkToContactMenuItem();
// Initialize the contact list with all contact information
initializeContacts();
@@ -427,14 +425,6 @@ protected void makeMenu(final Menu menu, final int instance) {
menu.add(_linkToBbContact);
}
- final DefaultLinkableContact copy =
- new DefaultLinkableContact(selected.getContactID(),
- ContactLinkingDemo.SECONDARY_APPLICATION_ID);
- if (LinkedContactUtilities.getLinkedContact(copy) != null) {
- menu.add(new AltUnlinkContactMenuItem());
- } else {
- menu.add(_altLinkToBbContact);
- }
super.makeMenu(menu, instance);
}
@@ -524,67 +514,6 @@ public void execute(final ReadOnlyCommandMetadata metadata,
}
/**
- * MenuItem to link a LinkableContact to a BlackBerryContact using
- * ContactLinkingDemo.SECONDARY_APPLICATION_ID (to demonstrate how a
- * BlackBerryContact can be linked to by multiple applications).
- */
- private class AltLinkToContactMenuItem extends MenuItem {
- public AltLinkToContactMenuItem() {
- super(new StringProvider("Secondary Link To BlackBerry Contact"),
- 0x230040, 0);
- this.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 LinkableContact linkableContact =
- getSelectedContact();
- final DefaultLinkableContact copy =
- new DefaultLinkableContact(linkableContact
- .getContactID(),
- ContactLinkingDemo.SECONDARY_APPLICATION_ID);
- copy.setString(Contact.NAME, linkableContact
- .getString(Contact.NAME));
- copy.setString(Contact.EMAIL, linkableContact
- .getString(Contact.EMAIL));
- copy.setString(Contact.ATTR_MOBILE, linkableContact
- .getString(Contact.ATTR_MOBILE));
- linkContact(copy);
- }
- }));
- }
- }
-
- /**
- * MenuItem to unlink a LinkableContact using
- * ContactLinkingDemo.SECONDARY_APPLICATION_ID (to demonstrate how a
- * BlackBerryContact can be linked to by multiple applications).
- */
- private class AltUnlinkContactMenuItem extends MenuItem {
- public AltUnlinkContactMenuItem() {
- super(new StringProvider("Secondary Unlink Contact"), 0x230050, 0);
- this.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 LinkableContact linkableContact =
- getSelectedContact();
- final DefaultLinkableContact copy =
- new DefaultLinkableContact(linkableContact
- .getContactID(),
- ContactLinkingDemo.SECONDARY_APPLICATION_ID);
- unlinkContact(copy);
- }
- }));
- }
- }
-
- /**
* Returns the name to be displayed for a given Contact
*
* @param contact
View
15 com/rim/samples/device/fileexplorerdemo/FileExplorerDemoScreen.java
@@ -40,7 +40,6 @@
import net.rim.device.api.system.Characters;
import net.rim.device.api.system.DeviceInfo;
import net.rim.device.api.system.Display;
-import net.rim.device.api.system.KeypadListener;
import net.rim.device.api.ui.Color;
import net.rim.device.api.ui.DrawStyle;
import net.rim.device.api.ui.Field;
@@ -305,20 +304,6 @@ public void execute(final ReadOnlyCommandMetadata metadata,
}
/**
- * Overrides default implementation. Performs the select action if the
- * trackwheel was clicked; otherwise, the default action occurs.
- *
- * @see net.rim.device.api.ui.Screen#navigationClick(int,int)
- */
- public boolean navigationClick(final int status, final int time) {
- if ((status & KeypadListener.STATUS_TRACKWHEEL) != KeypadListener.STATUS_TRACKWHEEL) {
- return selectAction();
- }
-
- return super.navigationClick(status, time);
- }
-
- /**
* Reads the path that was passed in and enumerates through it
*
* @param root
View
73 com/rim/samples/device/fmradiodemo/FMRadioDemo.java
@@ -0,0 +1,73 @@
+/**
+ * FMMRadioDemo.java
+ *
+ * Copyright © 1998-2011 Research In Motion Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Note: For the sake of simplicity, this sample application may not leverage
+ * resource bundles and resource strings. However, it is STRONGLY recommended
+ * that application developers make use of the localization features available
+ * within the BlackBerry development platform to ensure a seamless application
+ * experience across a variety of languages and geographies. For more information
+ * on localizing your application, please refer to the BlackBerry Java Development
+ * Environment Development Guide associated with this release.
+ */
+
+package com.rim.samples.device.fmradiodemo;
+
+import net.rim.device.api.ui.UiApplication;
+import net.rim.device.api.ui.component.Dialog;
+
+/**
+ * FMRadioDemo is an application that demonstrates the usage of the FM radio
+ * API. A Player object controls the playback of stations, lets the user specify
+ * a frequency for FM tuning, allows starting and stopping of playback and
+ * seeking up and down in the frequency band.
+ */
+public class FMRadioDemo extends UiApplication {
+ /**
+ * Entry point for application
+ *
+ * @param args
+ * Command line arguments (not used)
+ */
+ public static void main(final String[] args) {
+ // Create a new instance of the application and make the currently
+ // running thread the application's event dispatch thread.
+ final FMRadioDemo app = new FMRadioDemo();
+ app.enterEventDispatcher();
+ }
+
+ /**
+ * Creates a new FMRadioDemo object
+ */
+ public FMRadioDemo() {
+ final FMRadioDemoScreen screen = new FMRadioDemoScreen();
+ pushScreen(screen);
+ }
+
+ /**
+ * Presents a dialog to the user with a given message
+ *
+ * @param message
+ * The text to display
+ */
+ public static void errorDialog(final String text) {
+ UiApplication.getUiApplication().invokeLater(new Runnable() {
+ public void run() {
+ Dialog.alert(text);
+ }
+ });
+ }
+}
View
55 com/rim/samples/device/fmradiodemo/FMRadioDemo.jdp
@@ -0,0 +1,55 @@
+## RIM Java Development Environment
+# RIM Project file
+#
+# This file is generated and managed by BlackBerry developer tools.
+# It SHOULD NOT BE modified manually.
+#
+AddOn=0
+AlwaysBuild=0
+[AlxImports
+]
+AutoRestart=0
+[ClassProtection
+]
+[CustomBuildFiles
+]
+[CustomBuildRules
+]
+[DefFiles
+]
+[DependsOn
+]
+ExcludeFromBuildAll=0
+Exported=0
+[Files
+FMRadioDemo.java
+FMRadioDemoPlayer.java
+FMRadioDemoScreen.java
+img\fmradiodemo_jde.png
+]
+HaveAlxImports=0
+HaveDefs=0
+HaveImports=0
+[Icons
+img\fmradiodemo_jde.png
+]
+[ImplicitRules
+]
+[Imports
+]
+Listing=0
+Options=-quiet
+OutputFileName=FMRadioDemo
+[PackageProtection
+]
+RibbonPosition=0
+[RolloverIcons
+]
+RunOnStartup=0
+SkipCompile=0
+StartupTier=7
+SystemModule=0
+Title=FM Radio Demo
+Type=0
+Vendor=Research In Motion Limited
+Version=0.9
View
426 com/rim/samples/device/fmradiodemo/FMRadioDemoPlayer.java
@@ -0,0 +1,426 @@
+/**
+ * FMRadioDemoPlayer.java
+ *
+ * Copyright © 1998-2011 Research In Motion Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Note: For the sake of simplicity, this sample application may not leverage
+ * resource bundles and resource strings. However, it is STRONGLY recommended
+ * that application developers make use of the localization features available
+ * within the BlackBerry development platform to ensure a seamless application
+ * experience across a variety of languages and geographies. For more information
+ * on localizing your application, please refer to the BlackBerry Java Development
+ * Environment Development Guide associated with this release.
+ */
+
+package com.rim.samples.device.fmradiodemo;
+
+import java.io.IOException;
+
+import javax.microedition.amms.control.tuner.RDSControl;
+import javax.microedition.amms.control.tuner.TunerControl;
+import javax.microedition.media.Manager;
+import javax.microedition.media.MediaException;
+import javax.microedition.media.Player;
+import javax.microedition.media.PlayerListener;
+import javax.microedition.media.control.VolumeControl;
+
+/**
+ * A class which interacts with the FM Radio API
+ */
+public class FMRadioDemoPlayer implements PlayerListener {
+ private Player _player;
+ private FmTunerControl _fmTunerControl;
+ private RDSControl _rdsControl;
+ private VolumeControl _volumeControl;
+
+ private final FMRadioDemoScreen _screen;
+
+ private int _rssi = -90;
+ private int _volume = 50;
+
+ /**
+ * Creates a new FMRadioDemo Player object
+ */
+ public FMRadioDemoPlayer(final FMRadioDemoScreen screen) {
+ _screen = screen;
+
+ // Set up the Player object
+ createPlayer();
+ realizePlayer();
+ prefetchPlayer();
+ }
+
+ /**
+ * Switches reception for RDS/RBDS on or off
+ *
+ * @param on
+ * True, if the reception for RDS/RBDS should be switched on;
+ * false, if reception should be switched off.
+ */
+ public void switchRbds(final boolean on) {
+ final int state = _player.getState();
+
+ if (_fmTunerControl != null
+ && (state == Player.STARTED || state == Player.PREFETCHED)) {
+ try {
+ _fmTunerControl.setRdsRbdsReceptionEnabled(on);
+ } catch (final MediaException m) {
+ FMRadioDemo.errorDialog("MediaException on switching RDBS:"
+ + m.getMessage());
+ }
+ }
+ }
+
+ /**
+ * Takes the startFrequency as a basis, adds/subtracts an offset of 200kHz
+ * and seeks in the specified direction (up->higher frequencies / down ->
+ * lower frequencies) until a new station is found.
+ *
+ * @param startFrequency
+ * The frequency to start searching from.
+ * @param directionUp
+ * The direction to in which to seek: true, seek in upward
+ * direction; false, seek in downward direction
+ *
+ */
+ public void seek(final int startFrequency, final boolean directionUp) {
+ if (_player != null && _fmTunerControl != null
+ && checkFrequencyInRange(startFrequency)) {
+ // Add an offset to <code>startfrequency</code> to move off
+ // currently tuned frequency
+ final int fr = startFrequency + (directionUp ? 2000 : -2000);
+ int found = 0;
+ try {
+ // Start a seek in the given direction with the current RSSI
+ // value
+ found = _fmTunerControl.seek(fr, directionUp, _rssi)[0];
+
+ if (found == 0) // This happens if no station is found and seek
+ // times out after 5 seconds
+ {
+ _screen.updateLog("seek failed: f=" + fr);
+ _fmTunerControl.setMute(false); // Seek without station
+ // stays muted
+ tuneTo(startFrequency); // Tune back to previous frequency
+ }
+ } catch (final MediaException e) {
+ // No station found, tune to previous frequency
+ tuneTo(startFrequency);
+
+ try {
+ _fmTunerControl.setMute(false); // Seek without station
+ // stays muted
+ } catch (final MediaException e1) {
+ FMRadioDemo
+ .errorDialog("MediaException while seeking and trying to mute:"
+ + e1.getMessage());
+ }
+ }
+ }
+ }
+
+ /**
+ * Tunes the radio to a given frequency. The frequency can only be set if it
+ * is within the band limits of the given locale.
+ *
+ * @param frequency
+ * The frequency to tune the radio to in 100Hz
+ */
+ public void tuneTo(final int frequency) {
+ if (_player != null && _fmTunerControl != null) {
+ if (checkFrequencyInRange(frequency)) {
+ _fmTunerControl.setFrequency(frequency,
+ TunerControl.MODULATION_FM);
+ }
+ }
+ }
+
+ /**
+ * Utility method to check if a given frequency value is in the range of the
+ * current locale's band limits.
+ *
+ * @param frequency
+ * The frequency for which to check validity
+ * @return True, if the given frequency is within the currently supported
+ * band limits; false, otherwise.
+ */
+ public boolean checkFrequencyInRange(final int frequency) {
+ if (_player != null && _fmTunerControl != null) {
+ final int min =
+ _fmTunerControl.getMinFreq(TunerControl.MODULATION_FM);
+ final int max =
+ _fmTunerControl.getMaxFreq(TunerControl.MODULATION_FM);
+ return frequency >= min && frequency <= max;
+ }
+ return false;
+ }
+
+ /**
+ * Get the currently tuned frequency from the tuner
+ *
+ * @return The frequency the tuner is set to in 100Hz or -1 if the
+ * Player/FmTunerControl is null
+ */
+ public int getFrequency() {
+ if (_player != null && _fmTunerControl != null) {
+ return _fmTunerControl.getFrequency();
+ }
+ return -1;
+ }
+
+ /**
+ * Returns the station name identified via RDS/RBDS
+ *
+ * @return The station name decoded via RDS/RBDS or the String "NO RDS" if
+ * RDS is not used
+ */
+ public String getRdsPS() {
+ if (_rdsControl != null) {
+ return _rdsControl.getPS();
+ }
+ return "NO RDS";
+ }
+
+ /**
+ * Gets the decoded group type as String for the current station. This works
+ * only if the radio plays back from that station and RDS is turned on.
+ *
+ * @return The genre String as defined in the RDS/RBDS standard for the RDS
+ * group type
+ */
+ public String getRdsPty() {
+ if (_rdsControl != null) {
+ return _rdsControl.getPTYString(true);
+ }
+ return "NO RDS!";
+ }
+
+ /**
+ * Creates a player for FM radio playback
+ */
+ public void createPlayer() {
+ try {
+ _player = Manager.createPlayer("capture://radio");
+ _player.addPlayerListener(this);
+ } catch (final IOException e) {
+ FMRadioDemo.errorDialog("IOException on createPlayer: "
+ + e.getMessage());
+ closePlayer();
+ } catch (final SecurityException e) {
+ FMRadioDemo.errorDialog("SecurityException on createPlayer: "
+ + e.getMessage());
+ closePlayer();
+ } catch (final MediaException m) {
+ FMRadioDemo.errorDialog("MediaException on createPlayer: "
+ + m.getMessage());
+ closePlayer();
+ }
+ }
+
+ /**
+ * Realizes the player for FM radio playback. The player needs to be in
+ * Player.UNREALIZED state. This call also instantiates an FmTunerControl
+ * and an RDSControl.
+ */
+ public void realizePlayer() {
+ if (_player != null) {
+ if (_player.getState() == Player.UNREALIZED) {
+ try {
+ _player.realize();
+
+ _fmTunerControl =
+ (FmTunerControl) _player.getControl("TunerControl");
+
+ _rdsControl = (RDSControl) _player.getControl("RDSControl");
+ } catch (final MediaException m) {
+ FMRadioDemo.errorDialog("MediaException on realizePlayer: "
+ + m.getMessage());
+ closePlayer();
+ }
+ }
+ }
+ }
+
+ /**
+ * Prefetches the Player. The Player needs to be in the Player.REALIZED
+ * state before calling the method.
+ */
+ public void prefetchPlayer() {
+ if (_player != null) {
+ if (_player.getState() == Player.REALIZED) {
+ try {
+ _player.prefetch();
+ } catch (final MediaException m) {
+ FMRadioDemo
+ .errorDialog("MediaException on prefetchPlayer: "
+ + m.getMessage());
+ closePlayer();
+ }
+ }
+ }
+ }
+
+ /**
+ * Starts the Player. The Player needs to be in Player.PREFETCHED state.
+ */
+ public void startPlayer() {
+ if (_player != null) {
+ if (_player.getState() == Player.PREFETCHED) {
+ try {
+ tuneTo(_screen.getFrequency());
+ _player.start();
+ _volumeControl =
+ (VolumeControl) _player
+ .getControl("javax.microedition.media.control.VolumeControl");
+ setVolume();
+ } catch (final MediaException m) {
+ FMRadioDemo.errorDialog("MediaException on startPlayer: "
+ + m.getMessage());
+ closePlayer();
+ }
+ }
+ }
+ }
+
+ /**
+ * Stops the Player. The Player needs to be in the Player.STARTED state.
+ */
+ public void stopPlayer() {
+ if (_player != null) {
+ if (_player.getState() == Player.STARTED) {
+ try {
+ _player.stop();
+ } catch (final MediaException m) {
+ FMRadioDemo.errorDialog("MediaException on stopPlayer: "
+ + m.getMessage());
+ closePlayer();
+ }
+ }
+ }
+ }
+
+ /**
+ * Closes the Player
+ */
+ public void closePlayer() {
+ _player.close();
+ }
+
+ /**
+ * Increases the volume
+ */
+ public void increaseVolume() {
+ if (_volume < 100) {
+ _volume += 10;
+ setVolume();
+ }
+ }
+
+ /**
+ * Decreases the volume
+ */
+ public void decreaseVolume() {
+ if (_volume > 0) {
+ _volume -= 10;
+ setVolume();
+ }
+ }
+
+ /**
+ * Sets the current volume
+ */
+ private void setVolume() {
+ if (_player != null) {
+ if (_volumeControl != null) {
+ _volumeControl.setLevel(_volume);
+ }
+ }
+ }
+
+ /**
+ * @see javax.microedition.media.PlayerListener#playerUpdate(Player, String,
+ * Object)
+ */
+ public void playerUpdate(final Player player, final String event,
+ final Object eventData) {
+ if (player != _player) {
+ return;
+ }
+
+ _screen.updateLog("playerUpdate() event = " + event);
+
+ if (event == PlayerListener.STARTED
+ && _player.getState() != Player.STARTED) {
+ _screen.updateLog("playerUpdate() event = " + event
+ + ", eventData = " + eventData);
+ } else if (event.equals(PlayerListener.STOPPED)) {
+ _screen.updateLog("playerUpdate() event = STOPPED, eventData = "
+ + eventData);
+ } else if (event.equals(PlayerListener.DEVICE_UNAVAILABLE)) {
+ final int status = _player.getState();
+ if (status == Player.STARTED) {
+ _screen.updateLog("FMRadio: playerUpdate() event = DEVICE_UNAVAILABLE, eventData = "
+ + eventData);
+ }
+ } else if (event.equals(PlayerListener.DEVICE_AVAILABLE)) {
+ _screen.updateLog("FMRadio: playerUpdate() event = DEVICE_AVAILABLE");
+ } else if (event.equals(RDSControl.RDS_NEW_DATA) && eventData != null) {
+ _screen.updateRDS();
+ _screen.updateLog("FMRadio: playerUpdate() event = RDS_NEW_DATA");
+ } else if (event.equals(PlayerListener.ERROR)) {
+ // This happens if the device is switched off while playing back
+ _screen.updateLog("FMRadio: playerUpdate() event = ERROR, eventData = "
+ + eventData);
+ }
+ }
+
+ /**
+ * Gets the current RSSI value as String for representation in a Field
+ *
+ * @return The current RSSI value as String
+ */
+ public String getRSSI() {
+ return Integer.toString(_rssi);
+ }
+
+ /**
+ * Increases the RSSI value by one
+ */
+ public void increaseRSSI() {
+ _rssi++;
+ }
+
+ /**
+ * Decreases the RSSI value by one
+ */
+ public void decreaseRSSI() {
+ _rssi--;
+ }
+
+ /**
+ * Gets the current Player state
+ *
+ * @return The player state as defined in the Player interface as one of:
+ * UNREALIZED, REALIZED, PREFETCHED, STARTED, CLOSED, or -1 if the
+ * Player is null
+ */
+ public int getPlayerState() {
+ if (_player != null) {
+ return _player.getState();
+ }
+
+ return -1;
+ }
+}
View
416 com/rim/samples/device/fmradiodemo/FMRadioDemoScreen.java
@@ -0,0 +1,416 @@
+/**
+ * FMRadioDemoScreen.java
+ *
+ * Copyright © 1998-2011 Research In Motion Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Note: For the sake of simplicity, this sample application may not leverage
+ * resource bundles and resource strings. However, it is STRONGLY recommended
+ * that application developers make use of the localization features available
+ * within the BlackBerry development platform to ensure a seamless application
+ * experience across a variety of languages and geographies. For more information
+ * on localizing your application, please refer to the BlackBerry Java Development
+ * Environment Development Guide associated with this release.
+ */
+
+package com.rim.samples.device.fmradiodemo;
+
+import javax.microedition.media.Player;
+
+import net.rim.device.api.command.Command;
+import net.rim.device.api.command.CommandHandler;
+import net.rim.device.api.command.ReadOnlyCommandMetadata;
+import net.rim.device.api.media.MediaActionHandler;
+import net.rim.device.api.system.Application;
+import net.rim.device.api.ui.Field;
+import net.rim.device.api.ui.component.ButtonField;
+import net.rim.device.api.ui.component.LabelField;
+import net.rim.device.api.ui.component.SeparatorField;
+import net.rim.device.api.ui.component.StandardTitleBar;
+import net.rim.device.api.ui.component.TextField;
+import net.rim.device.api.ui.container.HorizontalFieldManager;
+import net.rim.device.api.ui.container.MainScreen;
+import net.rim.device.api.ui.container.VerticalFieldManager;
+
+/**
+ * The UI screen for the FM Radio Demo
+ */
+public class FMRadioDemoScreen extends MainScreen {
+ private static final int INITIAL_FREQUENCY = 990000;
+
+ private FMRadioDemoPlayer _fmRadioDemoPlayer;
+
+ private ButtonField _setFrequencyButton;
+ private ButtonField _seekUpButton;
+ private ButtonField _seekDownButton;
+ private ButtonField _increaseRSSIButton;
+ private ButtonField _decreaseRSSIButton;
+ private ButtonField _playButton;
+
+ private LabelField _rssiLabel;
+
+ private TextField _rdsTextField;
+ private TextField _frequencyTextField;
+ private TextField _logTextField;
+
+ private final MediaHandler _mediaHandler;
+
+ /**
+ * Creates a new FMRadioDemoScreen object
+ */
+ public FMRadioDemoScreen() {
+ initializePlayer();
+
+ final StandardTitleBar standardTitleBar = new StandardTitleBar();
+ standardTitleBar.addTitle("FM Radio Demo");
+ standardTitleBar.addNotifications();
+ standardTitleBar.addSignalIndicator();
+ setTitleBar(standardTitleBar);
+
+ _mediaHandler = new MediaHandler();
+ Application.getApplication().addMediaActionHandler(_mediaHandler);
+
+ initializeUiComponents();
+ createLayout();
+ }
+
+ /**
+ * Initializes the Player
+ */
+ void initializePlayer() {
+ _fmRadioDemoPlayer = new FMRadioDemoPlayer(this);
+ }
+
+ /**
+ * Updates the RDS data after an event has indicated that there is new data
+ * available
+ */
+ void updateRDS() {
+ final StringBuffer rdsBuffer = new StringBuffer();
+ rdsBuffer.append("RDS_PS:");
+ rdsBuffer.append(_fmRadioDemoPlayer.getRdsPS());
+ rdsBuffer.append(" PTY:");
+ rdsBuffer.append(_fmRadioDemoPlayer.getRdsPty());
+ _rdsTextField.setText(rdsBuffer.toString());
+ }
+
+ /**
+ * Initializes the screen's UI elements and defines the button actions
+ */
+ private void initializeUiComponents() {
+ _frequencyTextField = new TextField("Frequency [MHz]: ", "");
+
+ _setFrequencyButton = new ButtonField("Set Frequency");
+ _seekUpButton = new ButtonField("Seek >");
+ _seekDownButton = new ButtonField("< Seek");
+ _increaseRSSIButton = new ButtonField("RSSI +");
+ _decreaseRSSIButton = new ButtonField("- RSSI");
+ _playButton = new ButtonField("Play");
+
+ _rssiLabel = new LabelField(_fmRadioDemoPlayer.getRSSI());
+
+ _rdsTextField = new TextField(Field.NON_FOCUSABLE);
+ _rdsTextField.setLabel("RDS: ");
+
+ _logTextField = new TextField(Field.NON_FOCUSABLE);
+ _logTextField.setLabel("Log: ");
+
+ _playButton.setCommand(new Command(new CommandHandler() {
+ public void execute(final ReadOnlyCommandMetadata data,
+ final Object context) {
+ // Check whether the Player has already been started
+ if (_fmRadioDemoPlayer.getPlayerState() == Player.STARTED) {
+ _fmRadioDemoPlayer.switchRbds(false);
+ _fmRadioDemoPlayer.stopPlayer();
+ _playButton.setLabel("Play");
+ } else {
+ _fmRadioDemoPlayer.startPlayer();
+ _fmRadioDemoPlayer.switchRbds(true);
+ _playButton.setLabel("Stop");
+ }
+ }
+ }));
+
+ _seekDownButton.setCommand(new Command(new CommandHandler() {
+ public void execute(final ReadOnlyCommandMetadata data,
+ final Object context) {
+ try {
+ final int frequency =
+ stringToFrequency(_frequencyTextField.getText());
+ _fmRadioDemoPlayer.seek(frequency, false);
+ _frequencyTextField
+ .setText(frequencyToString(_fmRadioDemoPlayer
+ .getFrequency()));
+ } catch (final NumberFormatException n) {
+ // If the TextField cannot be parsed as a valid frequency,
+ // set the TextField text to a valid frequency.
+ _frequencyTextField
+ .setText(frequencyToString(INITIAL_FREQUENCY));
+ }
+ }
+ }));
+
+ _seekUpButton.setCommand(new Command(new CommandHandler() {
+ public void execute(final ReadOnlyCommandMetadata data,
+ final Object context) {
+ try {
+ final int frequency =
+ stringToFrequency(_frequencyTextField.getText());
+ _fmRadioDemoPlayer.seek(frequency, true);
+ _frequencyTextField
+ .setText(frequencyToString(_fmRadioDemoPlayer
+ .getFrequency()));
+ } catch (final NumberFormatException n) {
+ // If the TextField cannot be parsed as a valid frequency,
+ // set the TextField text to a valid frequency.
+ _frequencyTextField
+ .setText(frequencyToString(INITIAL_FREQUENCY));
+ }
+ }
+ }));
+
+ _increaseRSSIButton.setCommand(new Command(new CommandHandler() {
+ public void execute(final ReadOnlyCommandMetadata data,
+ final Object context) {
+ // Increase the internally stored value
+ // for RSSI that is used for seeking.
+ _fmRadioDemoPlayer.increaseRSSI();
+ _rssiLabel.setText(_fmRadioDemoPlayer.getRSSI());
+ }
+ }));
+
+ _decreaseRSSIButton.setCommand(new Command(new CommandHandler() {
+ public void execute(final ReadOnlyCommandMetadata data,
+ final Object context) {
+ // Decrease the internally stored value
+ // for RSSI that is used for seeking.
+ _fmRadioDemoPlayer.decreaseRSSI();
+ _rssiLabel.setText(_fmRadioDemoPlayer.getRSSI());
+ }
+ }));
+
+ _setFrequencyButton.setCommand(new Command(new CommandHandler() {
+ public void execute(final ReadOnlyCommandMetadata data,
+ final Object context) {
+ try {
+ final String text = _frequencyTextField.getText();
+ if (text.indexOf(".") > -1) {
+ // Convert String to an integer frequency value
+ final int frequency =
+ stringToFrequency(_frequencyTextField.getText());
+
+ if (_fmRadioDemoPlayer.checkFrequencyInRange(frequency)) {
+ // Send the given frequency to the API for tuning
+ _fmRadioDemoPlayer.tuneTo(frequency);
+ }
+ }
+ } catch (final NumberFormatException n) {
+
+ FMRadioDemo.errorDialog("Integer.parseInt() threw: "
+ + n.toString());
+ } finally {
+ String text;
+
+ if (_fmRadioDemoPlayer.getPlayerState() == Player.STARTED) {
+ text =
+ frequencyToString(_fmRadioDemoPlayer
+ .getFrequency());
+ } else {
+ text = frequencyToString(INITIAL_FREQUENCY);
+ }
+
+ _frequencyTextField.setText(text);
+ }
+ }
+ }));
+
+ _frequencyTextField.setMaxSize(5);
+ _frequencyTextField.setText(frequencyToString(INITIAL_FREQUENCY));
+ }
+
+ /**
+ * Lays out the UI elements on the screen
+ */
+ private void createLayout() {
+ final VerticalFieldManager verticalFieldManager =
+ new VerticalFieldManager(Field.FIELD_HCENTER);
+ final HorizontalFieldManager horizontalFieldManager1 =
+ new HorizontalFieldManager(Field.FIELD_HCENTER);
+ final HorizontalFieldManager horizontalFieldManager2 =
+ new HorizontalFieldManager(Field.FIELD_HCENTER);
+ final HorizontalFieldManager horizontalFieldManager3 =
+ new HorizontalFieldManager(Field.FIELD_HCENTER);
+ final HorizontalFieldManager horizontalFieldManager4 =
+ new HorizontalFieldManager(Field.FIELD_HCENTER);
+
+ horizontalFieldManager1.add(_setFrequencyButton);
+
+ horizontalFieldManager2.add(_seekDownButton);
+ horizontalFieldManager2.add(_seekUpButton);
+
+ horizontalFieldManager3.add(_decreaseRSSIButton);
+ horizontalFieldManager3.add(_rssiLabel);
+ horizontalFieldManager3.add(_increaseRSSIButton);
+
+ horizontalFieldManager4.add(_playButton);
+
+ verticalFieldManager.add(_frequencyTextField);
+ verticalFieldManager.add(horizontalFieldManager1);
+ verticalFieldManager.add(horizontalFieldManager2);
+ verticalFieldManager.add(horizontalFieldManager3);
+ verticalFieldManager.add(horizontalFieldManager4);
+ verticalFieldManager.add(new SeparatorField());
+ verticalFieldManager.add(_rdsTextField);
+ verticalFieldManager.add(_logTextField);
+
+ add(verticalFieldManager);
+ }
+
+ /**
+ * @see net.rim.device.api.ui.Screen#close()
+ */
+ public void close() {
+ try {
+ Application.getApplication()
+ .removeMediaActionHandler(_mediaHandler);
+ _fmRadioDemoPlayer.closePlayer();
+ } finally {
+ super.close();
+ }
+ }
+
+ /**
+ * @see net.rim.device.api.ui.Screen#onSavePrompt()
+ */
+ protected boolean onSavePrompt() {
+ // Supress the save dialog
+ return true;
+ }
+
+ /**
+ * Formats a frequency in KHz to a String in MHz with a dot after the MHz
+ * number and one digit after the dot to represent the 100kHz value.
+ *
+ * @param frequency
+ * Frequency in KHz units
+ * @return A String representing the frequency in MHz (e.g. "102.5")
+ */
+ private String frequencyToString(final int frequency) {
+ // The frequency should have a maximum of 5 digits in MHz
+ final StringBuffer buffer = new StringBuffer(5);
+
+ // Append MHz
+ buffer.append(frequency / 10000);
+ buffer.append(".");
+
+ // Append digit after the dot
+ buffer.append(frequency % 10000 / 1000);
+
+ return buffer.toString();
+ }
+
+ /**
+ * Utility method to convert a frequency in String format and MHz into a
+ * frequency in 100kHz.
+ *
+ * @param frequncy
+ * The frequency representation in MHz with following dot and
+ * digit for kHz
+ * @return The frequency in 100Hz
+ */
+ private int stringToFrequency(final String frequency) {
+ // Parse MHz
+ int f =
+ Integer.parseInt(frequency.substring(0, frequency.indexOf('.'))) * 10000;
+
+ // Parse value after the dot
+ f +=
+ Integer.parseInt(frequency
+ .substring(frequency.indexOf('.') + 1)) * 1000;
+
+ return f;
+ }
+
+ /**
+ * Retrieves frequency indicated in the frequency text field
+ *
+ * @return Currently set frequency as an integer
+ */
+ public int getFrequency() {
+ return stringToFrequency(_frequencyTextField.getText());
+ }
+
+ /**
+ * Logs information to the screen
+ *
+ * @param log
+ * Information of interest
+ */
+ void updateLog(final String log) {
+ _logTextField.setText(log);
+ }
+
+ /**
+ * A MediaActionHandler implementation
+ */
+ class MediaHandler implements MediaActionHandler {
+ /**
+ * @see net.rim.device.api.media.MediaActionHandler#mediaAction(int,
+ * int, Object)
+ */
+ public boolean mediaAction(final int action, final int src,
+ final Object context) {
+ switch (action) {
+ case MEDIA_ACTION_PLAYPAUSE_TOGGLE:
+ case MEDIA_ACTION_MUTE:
+ case MEDIA_ACTION_UNMUTE:
+ case MEDIA_ACTION_MUTE_TOGGLE:
+ break;
+ case MEDIA_ACTION_NEXT_TRACK:
+
+ // Use the next-track-button as a seek-up function
+ _fmRadioDemoPlayer
+ .seek(_fmRadioDemoPlayer.getFrequency(), true);
+
+ // Display the new frequency
+ _frequencyTextField
+ .setText(frequencyToString(_fmRadioDemoPlayer
+ .getFrequency()));
+
+ break;
+ case MEDIA_ACTION_PREV_TRACK:
+
+ // Use the prev-track-button as a seek-down function
+ _fmRadioDemoPlayer.seek(_fmRadioDemoPlayer.getFrequency(),
+ false);
+
+ // Display the new frequency
+ _frequencyTextField
+ .setText(frequencyToString(_fmRadioDemoPlayer
+ .getFrequency()));
+
+ break;
+ case MEDIA_ACTION_VOLUME_DOWN:
+ _fmRadioDemoPlayer.decreaseVolume();
+ break;
+ case MEDIA_ACTION_VOLUME_UP:
+ _fmRadioDemoPlayer.increaseVolume();
+ break;
+ default:
+ break;
+ }
+ return false;
+ }
+ }
+}
View
BIN com/rim/samples/device/fmradiodemo/img/fmradiodemo_jde.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
2 com/rim/samples/device/location/enhancedmapfielddemo/EnhancedMapFieldDemo.java
@@ -163,7 +163,7 @@ private void addDataToMap() {
// Add a GsImage
final GsImage img = new GsImage();
- img.setIconUri("http://na.blackberry.com/eng/developers/logo_black.jpg");
+ img.setIconUri("http://us.blackberry.com/developers/logo_black.jpg");
img.setLat(43.49000);
img.setLon(-80.53919);
img.setName("Logo");
View
3 com/rim/samples/device/location/mapfielddemo/DemoMapField.java
@@ -64,6 +64,9 @@ public DemoMapField() {
_sampleLabel = new LabelField();
_textHeight = _sampleLabel.getPreferredHeight();
_sampleLabel = null;
+
+ // Zoom in to the deepest level
+ setZoom(getMinZoom());
}
/**
View
8 com/rim/samples/device/location/mapfielddemo/MapFieldDemoScreen.java
@@ -379,8 +379,6 @@ else if (sb.toString().indexOf('o') != -1) {
* @see net.rim.device.api.ui.Screen#touchEvent(TouchEvent)
*/
protected boolean touchEvent(final TouchEvent message) {
- boolean isConsumed = false;
-
final TouchGesture touchGesture = message.getGesture();
if (touchGesture != null) {
// If the user has performed a swipe gesture we will move the
@@ -405,10 +403,12 @@ protected boolean touchEvent(final TouchEvent message) {
_map.move(magnitude, 0);
break;
}
- isConsumed = true; // We've consumed the touch event.
+ return true; // We've consumed the touch event.
}
}
- return isConsumed;
+ // Allow the parent implementation of touchEvent() to handle this event
+ // since we are not.
+ return super.touchEvent(message);
}
/**
View
185 com/rim/samples/device/magnetometerdemo/MagnetometerDemoScreen.java
@@ -58,6 +58,7 @@
FieldChangeListener, MagnetometerListener {
private final TextField _headingField;
private final TextField _angleField;
+ private final TextField _quaternionField;
private final TextField _strengthField;
private final TextField _calibrationQualityField;
private TextField _declinationField;
@@ -71,6 +72,7 @@
private final TextField _snapshotQualityField;
private final TextField _snapshotHeadingField;
private TextField _snapshotDeclinationField;
+ private final TextField _snapshotQuaternionField;
private final ButtonField _snapshotButton;
private final ButtonField _calibrateButton;
@@ -84,6 +86,9 @@
private GeomagneticField _geoField;
private final Application _app;
+ private final float[] _quaternion;
+ private final float[] _rotationMatrix;
+
/**
* Creates a new MagetometerDemoScreen object
*
@@ -95,6 +100,9 @@ public MagnetometerDemoScreen(final Application app) {
setTitle("Magnetometer Demo");
+ _quaternion = new float[4];
+ _rotationMatrix = new float[9];
+
// Cache if the device is a simulator or not
final boolean isSim = DeviceInfo.isSimulator();
@@ -103,11 +111,14 @@ public MagnetometerDemoScreen(final Application app) {
_headingField = new TextField("Heading: ", "");
_strengthField = new TextField("Field strength: ", "");
_angleField = new TextField("Angle: ", "");
+ _quaternionField = new TextField("Quaternion: ", "");
_calibrationQualityField = new TextField("Calibration quality: ", "");
_streamingManager.add(_headingField);
_streamingManager.add(_angleField);
+ _streamingManager.add(_quaternionField);
_streamingManager.add(_strengthField);
_streamingManager.add(_calibrationQualityField);
+ _streamingManager.setPadding(4, 4, 4, 4);
add(_streamingManager);
// Add HorizontalFieldManager for buttons
@@ -130,10 +141,13 @@ public MagnetometerDemoScreen(final Application app) {
_snapshotStrengthField = new TextField("Snapshot field strength: ", "");
_snapshotQualityField =
new TextField("Snapshot calibration quality: ", "");
+ _snapshotQuaternionField = new TextField("Snapshot quaternion: ", "");
_snapshotManager.add(_snapshotHeadingField);
_snapshotManager.add(_snapshotAngleField);
+ _snapshotManager.add(_snapshotQuaternionField);
_snapshotManager.add(_snapshotStrengthField);
_snapshotManager.add(_snapshotQualityField);
+ _snapshotManager.setPadding(4, 4, 4, 4);
add(_snapshotManager);
add(new SeparatorField());
@@ -190,59 +204,63 @@ public void run() {
/**
* Displays magnetometer data on the screen
*
- * @param angle
- * Clockwise angle from magnetic north
+ * @param magData
+ * magnetometerData
* @param declination
* Difference between magnetic north and true north at the
* device's snapshot location
- * @param strength
- * Strength of the magnetic field
- * @param quality
- * Quality of the calibration
- * @param heading
- * snapshot heading based on a 16 point compass rose
*/
- public void printStreaming(final float angle, final float declination,
- final float strength, final int quality, final String heading) {
- _angleField.setText((int) angle + "°");
+ public void printStreaming(final MagnetometerData magData,
+ final float declination) {
+ _angleField.setText(magData.getDirectionTop() + "°");
+
+ magData.getRotationMatrix(_rotationMatrix);
+ getNormalizedQuaternion(_quaternion, _rotationMatrix);
+ _quaternionField.setText("(" + _quaternion[0] + "," + _quaternion[1]
+ + "," + _quaternion[2] + "," + _quaternion[3] + ")");
if (!Float.isNaN(declination)) {
// If the declination is valid, print it to the screen.
// It will become valid once the GeomagneticField has been
// initialized.
- _declinationField.setText((int) declination + "°");
+ _declinationField.setText(declination + "°");
}
- _strengthField.setText(Float.toString(strength));
- _calibrationQualityField.setText(Integer.toString(quality));
- _headingField.setText(heading);
+ _strengthField.setText(Float.toString(magData.getFieldStrength()));
+ _calibrationQualityField.setText(Integer.toString(magData
+ .getCalibrationQuality()));
+ _headingField.setText(getHeadingName(MagnetometerData
+ .getHeading(magData.getDirectionTop())));
}
/**
* Displays a snapshot of magnetometer data
*
- * @param angle
- * Snapshot of the clockwise angle from magnetic north
+ * @param magData
+ * magnetometerData
* @param declination
* Snapshot of the difference between magnetic north and true
* north at teh device's snapshot location
- * @param strength
- * Snapshot of the strength of the magnetic field
- * @param quality
- * Snapshot of the quality of the calibration
- * @param heading
- * Snapshot of the heading based on a 16 point compass rose
*/
- public void printSnapshot(final float angle, final float declination,
- final float strength, final int quality, final String heading) {
- _snapshotAngleField.setText((int) angle + "°");
+ public void printSnapshot(final MagnetometerData magData,
+ final float declination) {
+ _snapshotAngleField.setText(magData.getDirectionTop() + "°");
+
+ magData.getRotationMatrix(_rotationMatrix);
+ getNormalizedQuaternion(_quaternion, _rotationMatrix);
+ _snapshotQuaternionField.setText("(" + _quaternion[0] + ","
+ + _quaternion[1] + "," + _quaternion[2] + "," + _quaternion[3]
+ + ")");
if (!Float.isNaN(declination)) {
// If the declination is valid, print it to the screen.
// It will become valid once the GeomagneticField has been
// initialized.
- _snapshotDeclinationField.setText((int) declination + "°");
+ _declinationField.setText(declination + "°");
}
- _snapshotStrengthField.setText(Float.toString(strength));
- _snapshotQualityField.setText(Integer.toString(quality));
- _snapshotHeadingField.setText(heading);
+ _snapshotStrengthField.setText(Float.toString(magData
+ .getFieldStrength()));
+ _snapshotQualityField.setText(Integer.toString(magData
+ .getCalibrationQuality()));
+ _snapshotHeadingField.setText(getHeadingName(MagnetometerData
+ .getHeading(magData.getDirectionTop())));
}
/**
@@ -426,37 +444,15 @@ public void onData(final MagnetometerData magData) {
declination = Float.NaN;
}
- // Capture the new data
- final float direction = magData.getDirectionTop();
- final float strength = magData.getFieldStrength();
- final int quality = magData.getCalibrationQuality();
- final String heading =
- getHeadingName(MagnetometerData.getHeading(direction));
-
// Print the data on the display
- printStreaming(direction, declination, strength, quality, heading);
+ printStreaming(magData, declination);
}
/**
* Retrieves a snapshot of data from the magnetometer and prints it to the
* display.
*/
public void doSnapshot() {
- float direction;
- float strength;
- int quality;
-
- // Get data from the magnetometer channel
- final MagnetometerData data = _magnetometerChannel.getData();
-
- // Synchronize on the data so that it doesn't change while we are
- // retrieving it
- synchronized (data) {
- direction = data.getDirectionTop();
- strength = data.getFieldStrength();
- quality = data.getCalibrationQuality();
- }
-
float declination;
try {
@@ -467,10 +463,7 @@ public void doSnapshot() {
declination = Float.NaN;
}
- // Convert the heading from an int value into a String heading
- final String heading =
- getHeadingName(MagnetometerData.getHeading(direction));
- printSnapshot(direction, declination, strength, quality, heading);
+ printSnapshot(_magnetometerChannel.getData(), declination);
}
/**
@@ -483,4 +476,82 @@ public void calibrate() {
MagnetometerDemo.errorDialog("Error calibrating: " + e.toString());
}
}
+
+ /**
+ * Calculates a normalized quaternion from a rotation matrix
+ *
+ * @param q
+ * Stores the normalized quaternion
+ * @param rm
+ * Rotation matrix
+ */
+ public static boolean getNormalizedQuaternion(final float[] q,
+ final float[] rm) {
+ float Rx, Ry, Rz, Ux, Uy, Uz, Bx, By, Bz;
+
+ if (rm.length == 9) {
+ Rx = rm[0];
+ Ry = rm[1];
+ Rz = rm[2];
+ Ux = rm[3];
+ Uy = rm[4];
+ Uz = rm[5];
+ Bx = rm[6];
+ By = rm[7];
+ Bz = rm[8];
+ } else if (rm.length == 16) {
+ Rx = rm[0];
+ Ry = rm[1];
+ Rz = rm[2];
+ Ux = rm[4];
+ Uy = rm[5];
+ Uz = rm[6];
+ Bx = rm[8];
+ By = rm[9];
+ Bz = rm[10];
+ } else {
+ return false;
+ }
+
+ final float qw = (float) Math.sqrt(clamp(Rx + Uy + Bz + 1) * 0.25f);
+ float qx = (float) Math.sqrt(clamp(Rx - Uy - Bz + 1) * 0.25f);
+ float qy = (float) Math.sqrt(clamp(-Rx + Uy - Bz + 1) * 0.25f);
+ float qz = (float) Math.sqrt(clamp(-Rx - Uy + Bz + 1) * 0.25f);
+
+ qx = copySign(qx, By - Uz);
+ qy = copySign(qy, Rz - Bx);
+ qz = copySign(qz, Ux - Ry);
+
+ // [w, x, y, z]
+ q[0] = qw;
+ q[1] = qx;
+ q[2] = qy;
+ q[3] = qz;
+
+ return true;
+ }
+
+ /**
+ * Clamp a float value so that it's never negative
+ */
+ private static float clamp(final float f) {
+ return f < 0 ? 0 : f;
+ }
+
+ /**
+ * Assigns the sign (positive/negative) to magitude
+ *
+ * @param magnitude
+ * Magnitude to assume the provided sign
+ * @param sign
+ * The sign to be applied
+ * @return Magnitude with sign provided
+ */
+ private static float copySign(final float magnitude, final float sign) {
+ int magnitudeBits = Float.floatToIntBits(magnitude);
+ final int signBits = Float.floatToIntBits(sign);
+ magnitudeBits = magnitudeBits & ~0x80000000 | signBits & 0x80000000;
+
+ return Float.intBitsToFloat(magnitudeBits);
+ }
}
View
54 com/rim/samples/device/svg/svgscriptingdemo/SVGScriptingDemo.java
@@ -0,0 +1,54 @@
+/*
+ * SVGScriptingDemo.java
+ *
+ * Copyright © 1998-2011 Research In Motion Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Note: For the sake of simplicity, this sample application may not leverage
+ * resource bundles and resource strings. However, it is STRONGLY recommended
+ * that application developers make use of the localization features available
+ * within the BlackBerry development platform to ensure a seamless application
+ * experience across a variety of languages and geographies. For more information
+ * on localizing your application, please refer to the BlackBerry Java Development
+ * Environment Development Guide associated with this release.
+ */
+
+package com.rim.samples.device.svg.svgscriptingdemo;
+
+import net.rim.device.api.ui.UiApplication;
+
+/**
+ * This sample application demonstrates the embedding of javascript into SVG
+ * files to allow for dynamic and interactive content. The Java classes in this
+ * sample are used for the set up and display of the SVG content, while the core
+ * of the scripting logic is in the "sample.svg" file.
+ */
+public class SVGScriptingDemo extends UiApplication {
+ /**
+ * Creates a new SVGScriptingDemo object
+ */
+ public SVGScriptingDemo() {
+ pushScreen(new SVGScriptingDemoScreen());
+ }
+
+ /**
+ * Entry point for application
+ *
+ * @param args
+ * Command line arguments (not used)
+ */
+ public static void main(final String[] args) {
+ new SVGScriptingDemo().enterEventDispatcher();
+ }
+}
View
55 com/rim/samples/device/svg/svgscriptingdemo/SVGScriptingDemo.jdp
@@ -0,0 +1,55 @@
+## RIM Java Development Environment
+# RIM Project file
+#
+# This file is generated and managed by BlackBerry developer tools.
+# It SHOULD NOT BE modified manually.
+#
+AddOn=0
+AlwaysBuild=0
+[AlxImports
+]
+AutoRestart=0
+[ClassProtection
+]
+[CustomBuildFiles
+]
+[CustomBuildRules
+]
+[DefFiles
+]
+[DependsOn
+]
+ExcludeFromBuildAll=0
+Exported=0
+[Files
+img\svgscriptingdemo_jde.png
+sample.svg
+SVGScriptingDemo.java
+SVGScriptingDemoScreen.java
+]
+HaveAlxImports=0
+HaveDefs=0
+HaveImports=0
+[Icons
+img\svgscriptingdemo_jde.png
+]
+[ImplicitRules
+]
+[Imports
+]
+Listing=0
+Options=-quiet
+OutputFileName=SVGScriptingDemo
+[PackageProtection
+]
+RibbonPosition=0
+[RolloverIcons
+]
+RunOnStartup=0
+SkipCompile=0
+StartupTier=7
+SystemModule=0
+Title=SVG Scripting Demo
+Type=0
+Vendor=Research In Motion Limited
+Version=0.9
View
129 com/rim/samples/device/svg/svgscriptingdemo/SVGScriptingDemoScreen.java
@@ -0,0 +1,129 @@
+/*
+ * SVGScriptingDemoScreen.java
+ *
+ * Copyright © 1998-2011 Research In Motion Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Note: For the sake of simplicity, this sample application may not leverage
+ * resource bundles and resource strings. However, it is STRONGLY recommended
+ * that application developers make use of the localization features available
+ * within the BlackBerry development platform to ensure a seamless application
+ * experience across a variety of languages and geographies. For more information
+ * on localizing your application, please refer to the BlackBerry Java Development
+ * Environment Development Guide associated with this release.
+ */
+
+package com.rim.samples.device.svg.svgscriptingdemo;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.microedition.m2g.SVGAnimator;
+import javax.microedition.m2g.SVGImage;
+import javax.microedition.m2g.ScalableImage;
+
+import net.rim.device.api.system.Display;
+import net.rim.device.api.ui.Field;
+import net.rim.device.api.ui.Manager;
+import net.rim.device.api.ui.component.RichTextField;
+import net.rim.device.api.ui.container.MainScreen;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.svg.SVGElement;
+
+/**
+ * This class resizes the SVG document to fit the device's display screen and
+ * then displays the SVG image.
+ */
+public class SVGScriptingDemoScreen extends MainScreen {
+ // As per the quadrant size of 150 in the svg script
+ private static final int ORIGINAL_DISPLAY_SIZE = 300;
+
+ // As per the button size in the svg script
+ private static final int ORIGINAL_BUTTON_SIZE = 80;
+
+ private static final int DISPLAY_Y_OFFSET = 10;
+
+ /**
+ * Creates a new SVGScriptingDemoScreen object
+ */
+ public SVGScriptingDemoScreen() {
+ super(Manager.NO_VERTICAL_SCROLL);
+
+ try {
+ // Load SVG from sample.svg
+ final InputStream inputStream =
+ getClass().getResourceAsStream("/sample.svg");
+
+ // Create SVGImage and resize it according to the dimensions of the
+ // device screen.
+ final SVGImage image =
+ (SVGImage) ScalableImage.createImage(inputStream, null);
+ resize(image.getDocument());
+
+ // Retrieve the SVG animator, add it to the screen, and start the
+ // SVG
+ final SVGAnimator animator =
+ SVGAnimator.createAnimator(image,
+ "net.rim.device.api.ui.Field");
+ final Field svgField = (Field) animator.getTargetComponent();
+
+ add(svgField);
+ animator.play();
+ } catch (final IOException e) {
+ add(new RichTextField("Could not load the svg file: " + e));
+ }
+ }
+
+ /**
+ * Resizes the SVG document to fit onto the device screen
+ *
+ * Note: this method is specific to the sample svg only
+ *
+ * @param doc
+ * The SVG document to resize
+ */
+ public static void resize(final Document doc) {
+ // Calculate the new dimension of the display based on the minimum
+ // display dimension size.
+ final int displayWidth = Display.getWidth();
+ final int displayHeight = Display.getHeight();
+ final int minDimension = Math.min(displayWidth, displayHeight);
+ final float newDimension = 0.9f * minDimension;
+
+ // Scale and center the display element to a portion of the device's
+ // minimum display dimension.
+ final float translateX = (displayWidth - newDimension) / 2;
+ final float scaleWidth = newDimension / ORIGINAL_DISPLAY_SIZE;
+ final float scaleHeight = newDimension / ORIGINAL_DISPLAY_SIZE;
+ final SVGElement display = (SVGElement) doc.getElementById("display");
+ display.setAttribute("transform", "translate(" + translateX + " "
+ + DISPLAY_Y_OFFSET + ") " + "scale(" + scaleWidth + " "
+ + scaleHeight + ")");
+
+ // Scale and position the play and stop buttons
+ final float newBtnSize = 0.2f * (minDimension - DISPLAY_Y_OFFSET);
+ final float scaleBtn = newBtnSize / ORIGINAL_BUTTON_SIZE;
+ final SVGElement playBtn = (SVGElement) doc.getElementById("play");
+ playBtn.setAttribute("transform", "translate(" + newBtnSize + " "
+ + (displayHeight - newBtnSize) + ") " + "scale(" + scaleBtn
+ + ")");
+
+ final SVGElement stopBtn = (SVGElement) doc.getElementById("stop");
+ stopBtn.setAttribute("transform", "translate("
+ + (displayWidth - newBtnSize) + " "
+ + (displayHeight - newBtnSize) + ") " + "scale(" + scaleBtn
+ + ")");
+ }
+}
View
BIN com/rim/samples/device/svg/svgscriptingdemo/img/icon_jde.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN com/rim/samples/device/svg/svgscriptingdemo/img/svgscriptingdemo_jde.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
298 com/rim/samples/device/svg/svgscriptingdemo/sample.svg
@@ -0,0 +1,298 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" baseProfile="tiny"
+ xmlns:ev="http://www.w3.org/2001/xml-events" onload="init(evt)">
+
+ <!-- Scripts may be embedded into svg's through a <script> tag. These scripts
+ allow for dynamic content to be generated and expand the interactivity of
+ the svg objects. This sample uses an embedded ECMAScript to generate a new
+ animation by manipulating the DOM Tree of the svg document.
+
+ It is also possible to reference external script files using the
+ xlink:href attribute in the <script> element,
+ e.g. <script type="application/ecmascript" xlink:href="script.es"/>
+ -->
+ <script type="application/ecmascript"> <![CDATA[
+ // Keep track of key nodes.
+ var SVGDocument = null;
+ var SVGRoot = null;
+ var display = null;
+
+ // Store namespace information used for elements.
+ var svgns = "http://www.w3.org/2000/svg";
+ var xlinkns = "http://www.w3.org/1999/xlink";
+
+ // Store options for random path and colors.
+ var pathTypes = "LCQ";
+ var numPathPoints = new Array(1, 3, 2);
+ var colors = new Array("silver", "gray", "maroon", "red", "purple",
+ "fuchsia", "green", "lime", "olive", "yellow",
+ "navy", "blue", "teal", "aqua");
+
+ var quadrantSize = 150;
+
+ /**
+ * Initializes this script.
+ *
+ * @param evt The event triggering the initialization.
+ */
+ function init(evt)
+ {
+ // Define some commonly used elements.
+ SVGDocument = evt.target.ownerDocument;
+ SVGRoot = SVGDocument.documentElement;
+ display = SVGDocument.getElementById("display");
+
+ // Add the original quadrant to the display.
+ var original = SVGDocument.createElementNS(svgns, "g");
+ original.setAttribute("id", "original");
+ display.appendChild(original);
+ }
+
+ /**
+ * Generates a random integer in a specified range.
+ *
+ * @param range The range of numbers that can be produced.
+ * @return An integer between 0 (inclusive) and "range" (exclusive).
+ */
+ function randInt(range)
+ {
+ return Math.floor(Math.random() * range);
+ }
+
+ /**
+ * Generates a random color.
+ *
+ * @return A random color in String form.
+ */
+ function randColor()
+ {
+ return colors[randInt(colors.length)];
+ }
+
+ /**
+ * Generate (x,y) so that the circle centered at (x,y) with radius r lies
+ * entirely inside the upper left quadrant of a circle centered at
+ * (quadrantSize, quadrantSize) with radius quadrantSize.
+ *
+ * @param r The radius of the smaller circle to be centered at (x,y)
+ * @return A random point (x,y) circle.
+ */
+ function randPoint(r)
+ {
+ var q = quadrantSize;
+ for (;;)
+ {
+ // Choose two random points within the bounding square of the
+ // upper left quadrant of the large circle.
+ var x = r + (q - r) * Math.random();
+ var y = r + (q - r) * Math.random();
+
+ // Check if it also within the bounds of the large circle.
+ if ( ((q - x) * (q - x) + (q - y) * (q - y)) <= ((q - r) * (q - r)) )
+ {
+ return x + "," + y;
+ }
+ }
+ }
+
+ /**
+ * Generate a random path along which a circle travels.
+ *
+ * @param steps The number of steps with which to make up the random path.
+ * @param radius The radius of the circle.
+ */
+ function generateRandomPath(steps, radius)
+ {
+ var path = "M" + randPoint(radius);
+ for (var step = 1; step <= steps; step++)
+ {
+ var n = randInt(pathTypes.length);
+ var subPath = pathTypes.charAt(n);
+ for (var numCoordinates = numPathPoints[n]; numCoordinates > 0; numCoordinates--)
+ {
+ subPath += " " + randPoint(radius);
+ }
+ path += " " + subPath;
+ }
+ return path + " Z";
+ }
+
+ /**
+ * Creates the background of the display area.
+ */
+ function makeBackground()
+ {
+ // Create the background circle.
+ var fullSize = quadrantSize * 2;
+ var circle = SVGDocument.createElementNS(svgns, "circle");
+ circle.setAttribute("r", randInt(20) + 5);
+ circle.setAttribute("fill", randColor());
+ circle.setAttribute("fill-opacity", "0.2");
+ circle.setAttribute("cx", quadrantSize);
+ circle.setAttribute("cy", quadrantSize);
+ display.appendChild(circle);
+
+ // Animate the background circle to grow to its full size.
+ var animateR = SVGDocument.createElementNS(svgns, "animate");
+ animateR.setAttribute("dur", "5s");
+ animateR.setAttribute("fill", "freeze");
+ animateR.setAttribute("begin", "play.click");
+ animateR.setAttribute("end", "stop.click");
+ animateR.setAttribute("attributeName", "r");
+ animateR.setAttribute("to", quadrantSize);
+ circle.appendChild(animateR);
+
+ // Show the axis.
+ var axis = SVGDocument.createElementNS(svgns, "path");
+ axis.setAttribute("stroke", randColor());
+ axis.setAttribute("stroke-width", "2");
+ axis.setAttribute("stroke-opacity", "0.6");
+ axis.setAttribute("d", "M1 " + quadrantSize + " L" + (fullSize-1) + " " + quadrantSize + // horizontal
+ " M" + quadrantSize + " 1 L" + quadrantSize + " " + (fullSize-1)); // vertical
+ display.appendChild(axis);
+ }
+
+
+ /**
+ * Fills the "original" quadrant with animated circles.
+ *
+ * @param numOfCircles The number of circles to place in the quadrant.
+ */
+ function makeOriginalQuadrant(numOfCircles)
+ {
+ // Fill the original quadrant with animated circles.
+ var original = SVGDocument.getElementById("original");
+ for (var circleNo = 1; circleNo <= numOfCircles; circleNo++)
+ {
+ // Create a circle to display.
+ var circle = SVGDocument.createElementNS(svgns, "circle");
+ var radius = randInt(20) + 5;
+ circle.setAttribute("r", radius);
+ circle.setAttribute("fill-opacity", 0.5 * Math.random() + 0.5); // [0.5, 1.0]
+ circle.setAttribute("fill", randColor());
+ circle.setAttribute("cx", 0);
+ circle.setAttribute("cy", 0);
+ original.appendChild(circle);
+
+ // Animate the circle along a random path.
+ var animMotion = SVGDocument.createElementNS(svgns, "animateMotion");
+ animMotion.setAttribute("dur", "5s");
+ animMotion.setAttribute("fill", "freeze");
+ animMotion.setAttribute("begin", "play.click");
+ animMotion.setAttribute("end", "stop.click");
+ animMotion.setAttribute("repeatCount", "indefinite");
+ animMotion.setAttribute("path", generateRandomPath(5, radius));
+ circle.appendChild(animMotion);
+
+ // Animate the circle's color.
+ var animColor = SVGDocument.createElementNS(svgns, "animate");
+ animColor.setAttribute("attributeName", "fill");
+ animColor.setAttribute("dur", "5s");
+ animColor.setAttribute("fill", "freeze");
+ animColor.setAttribute("begin", "play.click");
+ animColor.setAttribute("end", "stop.click");
+ animColor.setAttribute("repeatCount", "indefinite");
+ animColor.setAttribute("to", randColor());
+ circle.appendChild(animColor);
+ }
+ }
+
+ /**
+ * Creates a new quadrant by copying the "original" quadrant and
+ * applying a transformation onto it.
+ *
+ * @param transformation The transformation to apply to the original quadrant.
+ */
+ function makeTransformedQuadrant(transformation)
+ {
+ var original = SVGDocument.getElementById("original");
+
+ // Make the transformed quadrant.
+ var transformedQuadrant = SVGDocument.createElementNS(svgns, "g");
+ transformedQuadrant.setAttribute("transform", transformation);
+ display.appendChild(transformedQuadrant);
+
+ // Copy the contents of the original contents using a <use> tag.
+ var copy = SVGDocument.createElementNS(svgns, "use");
+ copy.setAttributeNS(xlinkns, "href", "#original");
+ transformedQuadrant.appendChild(copy);
+ }
+
+ /**
+ * Removes all the removable children from a given parent. If the child
+ * is not removable (has an id) this method will try to delete any
+ * removable children in the subtree of the child possesing the id.
+ *
+ * @param parent The parent node to remove all the removable children from.
+ */
+ function removeAllRemovable(parent)
+ {
+ var child = parent.firstElementChild;
+ while (child != null)
+ {
+ var next = child.nextElementSibling;
+ if (child.getAttribute("id") == null) // Can't remove elements with ids
+ {
+ parent.removeChild(child);
+ }
+ else // If element has an id, then try removing the child's children
+ {
+ removeAllRemovable(child);
+ }
+ child = next;
+ }
+ }
+
+ /**
+ * Handles the onclick event for the "play" button.
+ *
+ * @param evt The event that triggered this handler call.
+ */
+ function play(evt)
+ {
+ // Clear the svg display and make the background.
+ removeAllRemovable(display);
+ makeBackground();
+
+ // Make the four quadrants, using the original quadrant and reflecting it
+ // across the x and y axis to produce mirror images.
+ makeOriginalQuadrant(8);
+ var fullSize = quadrantSize * 2;
+ makeTransformedQuadrant("matrix(-1 0 0 1 " + fullSize + " 0)");
+ makeTransformedQuadrant("matrix(-1 0 0 -1 " + fullSize + " " + fullSize + ")");
+ makeTransformedQuadrant("matrix(1 0 0 -1 0 " + fullSize + ")");
+ }
+ ]]></script>
+
+ <!--
+ Note: The svg file must at least have one animation element in order
+ for the animation engine to activate.
+ -->
+
+ <!-- Display area to show the svg animation -->
+
+ <g id="display" opacity="0">
+ <animate id="fade-in" attributeName="opacity" begin="play.click" from="0" to="1" dur="9s" fill="freeze"/>
+ <animate id="fade-out" attributeName="opacity" begin="stop.click" from="1" to="0" dur="2s" fill="freeze"/>
+ </g>
+
+ <!-- Buttons to play and stop the svg animation -->
+ <g id="stop" fill-opacity="0.4" stroke-opacity="0.4">
+ <circle id="c1" r="40" stroke="navy" stroke-width="5" fill="none"/>
+ <polygon id="p1" points="-22,22 -22,-22 22,-22 22,22" fill="blue"/>
+ <set attributeName="fill-opacity" to="1.0" begin="stop.focusin"/>
+ <set attributeName="fill-opacity" to="0.4" begin="stop.focusout"/>
+ <set attributeName="stroke-opacity" to="1.0" begin="stop.focusin"/>
+ <set attributeName="stroke-opacity" to="0.4" begin="stop.focusout"/>
+
+ </g>
+ <g id="play" onclick="play(evt)">
+ <circle r="40" stroke="navy" stroke-width="5" fill="none"/>
+ <polygon points="-20,25.6 -20,-25.6 32,0" fill="blue"/>
+ <set attributeName="fill-opacity" to="1.0" begin="play.focusin"/>
+ <set attributeName="fill-opacity" to="0.4" begin="play.focusout"/>
+ <set attributeName="stroke-opacity" to="1.0" begin="play.focusin"/>
+ <set attributeName="stroke-opacity" to="0.4" begin="play.focusout"/>
+ </g>
+</svg>
+
View
4 samples.jdw
@@ -35,6 +35,7 @@ com\rim\samples\device\contactlinkingdemo\ContactLinkingDemo_autostartup.jdp
com\rim\samples\device\cryptodemo\CryptoDemo.jdp
com\rim\samples\device\embeddedmediademo\EmbeddedMediaDemo.jdp
com\rim\samples\device\fileexplorerdemo\FileExplorerDemo.jdp
+com\rim\samples\device\fmradiodemo\FMRadioDemo.jdp
com\rim\samples\device\helloworlddemo\HelloWorldDemo.jdp
com\rim\samples\device\homescreendemo\HomeScreenAlternateEntryPoint.jdp
com\rim\samples\device\homescreendemo\HomeScreenDemo.jdp
@@ -106,6 +107,7 @@ com\rim\samples\device\svg\svgformsdemo\SVGFormsDemo.jdp
com\rim\samples\device\svg\svgmapdemo\SVGMapDemo.jdp
com\rim\samples\device\svg\svgmidletdemo\SVGMidletDemo.jdp
com\rim\samples\device\svg\svgpickdemo\SVGPickDemo.jdp
+com\rim\samples\device\svg\svgscriptingdemo\SVGScriptingDemo.jdp
com\rim\samples\device\svg\svgtraitsdemo\SVGTraitsDemo.jdp
com\rim\samples\device\syncdemo\SyncDemo.jdp
com\rim\samples\device\syncdemo\SyncDemo_autostartup.jdp
@@ -165,6 +167,7 @@ com\rim\samples\device\contactlinkingdemo\ContactLinkingDemo.jdp
com\rim\samples\device\cryptodemo\CryptoDemo.jdp
com\rim\samples\device\embeddedmediademo\EmbeddedMediaDemo.jdp
com\rim\samples\device\fileexplorerdemo\FileExplorerDemo.jdp
+com\rim\samples\device\fmradiodemo\FMRadioDemo.jdp
com\rim\samples\device\helloworlddemo\HelloWorldDemo.jdp
com\rim\samples\device\homescreendemo\HomeScreenDemo.jdp
com\rim\samples\device\httpdemo\HTTPDemo.jdp
@@ -229,6 +232,7 @@ com\rim\samples\device\svg\svgformsdemo\SVGFormsDemo.jdp
com\rim\samples\device\svg\svgmapdemo\SVGMapDemo.jdp
com\rim\samples\device\svg\svgmidletdemo\SVGMidletDemo.jdp
com\rim\samples\device\svg\svgpickdemo\SVGPickDemo.jdp
+com\rim\samples\device\svg\svgscriptingdemo\SVGScriptingDemo.jdp
com\rim\samples\device\svg\svgtraitsdemo\SVGTraitsDemo.jdp
com\rim\samples\device\syncdemo\SyncDemo.jdp
com\rim\samples\device\tiltdemo\TiltDemo.jdp

0 comments on commit c2fd978

Please sign in to comment.
Something went wrong with that request. Please try again.