Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 7 commits
  • 172 files changed
  • 0 comments
  • 1 contributor
Dec 01, 2011
Stephen Legge BlackBerry Samples for Java release 4.6.1.
An Open Source version of the samples as they were released
with the 4.6.1 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.
5ab143e
Stephen Legge BlackBerry Samples for Java release 4.7.0.
An Open Source version of the samples as they were released
with the 4.7.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.
0b09199
Stephen Legge BlackBerry Samples for Java release 5.0.0.
An Open Source version of the samples as they were released
with the 5.0.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.
b3db4c1
Stephen Legge BlackBerry Samples for Java release 6.0.0.
An Open Source version of the samples as they were released
with the 6.0.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.
ea58453
Stephen Legge BlackBerry Samples for Java release 7.0.0.
An Open Source version of the samples as they were released
with the 7.0.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.
ec58ace
Stephen Legge 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.
c2fd978
Dec 12, 2011
Stephen Legge Adjustments to README.md based on feedback. e44c4fc

Showing 172 changed files with 20,922 additions and 2,778 deletions. Show diff stats Hide diff stats

  1. 28  README.md
  2. 347  com/rim/samples/device/accelerometerdemo/AccelerometerDemo.java
  3. 52  com/rim/samples/device/accelerometerdemo/AccelerometerDemo.jdp
  4. BIN  com/rim/samples/device/accelerometerdemo/img/accelerometerdemo_jde.png
  5. BIN  com/rim/samples/device/accelerometerdemo/img/ball.png
  6. 150  com/rim/samples/device/accessibilitydemo/customcomponentsdemo/CustomComponentsDemo.java
  7. 62  com/rim/samples/device/accessibilitydemo/customcomponentsdemo/CustomComponentsDemo.jdp
  8. 504  com/rim/samples/device/accessibilitydemo/customcomponentsdemo/IconToolbarComponent.java
  9. 419  com/rim/samples/device/accessibilitydemo/customcomponentsdemo/TableComponent.java
  10. 461  com/rim/samples/device/accessibilitydemo/customcomponentsdemo/TextComponent.java
  11. 316  com/rim/samples/device/accessibilitydemo/customcomponentsdemo/ValueComponent.java
  12. BIN  com/rim/samples/device/accessibilitydemo/customcomponentsdemo/img/1.png
  13. BIN  com/rim/samples/device/accessibilitydemo/customcomponentsdemo/img/2.png
  14. BIN  com/rim/samples/device/accessibilitydemo/customcomponentsdemo/img/3.png
  15. BIN  com/rim/samples/device/accessibilitydemo/customcomponentsdemo/img/4.png
  16. BIN  com/rim/samples/device/accessibilitydemo/customcomponentsdemo/img/accessibilitydemo_jde.png
  17. 365  com/rim/samples/device/accessibilitydemo/screenreaderdemo/ChildReader.java
  18. 177  com/rim/samples/device/accessibilitydemo/screenreaderdemo/ScreenReader.java
  19. 53  com/rim/samples/device/accessibilitydemo/screenreaderdemo/ScreenReaderDemo.jdp
  20. 1,101  com/rim/samples/device/accessibilitydemo/screenreaderdemo/ScreenReaderHandler.java
  21. 142  com/rim/samples/device/accessibilitydemo/screenreaderdemo/Util.java
  22. 149  com/rim/samples/device/activetextfieldsdemo/ActiveTextFieldsDemo.java
  23. 12  com/rim/samples/device/activetextfieldsdemo/ActiveTextFieldsDemo_autostartup.jdp
  24. 88  com/rim/samples/device/applicationpermissionsdemo/ApplicationPermissionsDemo.java
  25. 6  com/rim/samples/device/applicationpermissionsdemo/ApplicationPermissionsDemo.jdp
  26. 12  com/rim/samples/device/applicationpermissionsdemo/DemoReasonProvider.java
  27. 194  com/rim/samples/device/attachmentdemo/AttachmentAction.java
  28. 109  com/rim/samples/device/attachmentdemo/AttachmentDemo.java
  29. 63  com/rim/samples/device/attachmentdemo/AttachmentDemo.jdp
  30. 135  com/rim/samples/device/attachmentdemo/AttachmentDemoScreen.java
  31. 412  com/rim/samples/device/attachmentdemo/FileExplorerScreen.java
  32. 80  com/rim/samples/device/attachmentdemo/FileHolder.java
  33. 145  com/rim/samples/device/attachmentdemo/FileUploadAction.java
  34. 136  com/rim/samples/device/attachmentdemo/FileUploadDialog.java
  35. BIN  com/rim/samples/device/attachmentdemo/attachments/logo.png
  36. BIN  com/rim/samples/device/attachmentdemo/attachments/test.abc
  37. BIN  com/rim/samples/device/attachmentdemo/attachments/test_doc.doc
  38. BIN  com/rim/samples/device/attachmentdemo/img/attachmentdemo_jde.png
  39. 139  com/rim/samples/device/augmentedrealitydemo/ARDemoCameraScreen.java
  40. 72  com/rim/samples/device/augmentedrealitydemo/AugmentedRealityDemo.java
  41. 55  com/rim/samples/device/augmentedrealitydemo/AugmentedRealityDemo.jdp
  42. 210  com/rim/samples/device/augmentedrealitydemo/Cube.java
  43. 233  com/rim/samples/device/augmentedrealitydemo/DemoGLField.java
  44. BIN  com/rim/samples/device/augmentedrealitydemo/img/BlackBerry.png
  45. BIN  com/rim/samples/device/augmentedrealitydemo/img/augmentedrealitydemo_jde.png
  46. 296  com/rim/samples/device/barcodescandemo/BarcodeScanDemo.java
  47. 53  com/rim/samples/device/barcodescandemo/BarcodeScanDemo.jdp
  48. BIN  com/rim/samples/device/barcodescandemo/img/barcodescandemo_jde.png
  49. 51  com/rim/samples/device/blackberry/browser/BrowserFieldDemo.jdp
  50. 156  com/rim/samples/device/blackberry/options/OptionsProviderDemo.java
  51. 58  com/rim/samples/device/blackberry/pim/PIMDemo.java
  52. 209  com/rim/samples/device/blackberrybalancedemo/BlackBerryBalanceDemo.java
  53. 56  com/rim/samples/device/blackberrybalancedemo/BlackBerryBalanceDemo.jdp
  54. 292  com/rim/samples/device/blackberrybalancedemo/BlackBerryBalanceDemoScreen.java
  55. 134  com/rim/samples/device/blackberrybalancedemo/Memo.java
  56. 163  com/rim/samples/device/blackberrybalancedemo/MemoScreen.java
  57. 82  com/rim/samples/device/blackberrybalancedemo/MultiServiceListener.java
  58. 105  com/rim/samples/device/blackberrybalancedemo/PersistentStoreListener.java
  59. BIN  com/rim/samples/device/blackberrybalancedemo/img/blackberrybalancedemo_jde.png
  60. 81  com/rim/samples/device/blackberrymaildemo/BlackBerryMailDemo.java
  61. 60  com/rim/samples/device/blackberrymaildemo/BlackBerryMailDemo.jdp
  62. 370  com/rim/samples/device/blackberrymaildemo/BlackBerryMailDemoScreen.java
  63. 456  com/rim/samples/device/blackberrymaildemo/ComposeScreen.java
  64. 180  com/rim/samples/device/blackberrymaildemo/FoldersViewScreen.java
  65. 526  com/rim/samples/device/blackberrymaildemo/MessageScreen.java
  66. 230  com/rim/samples/device/blackberrymaildemo/MessagesListField.java
  67. 296  com/rim/samples/device/blackberrymaildemo/MessagesViewScreen.java
  68. 159  com/rim/samples/device/blackberrymaildemo/Util.java
  69. BIN  com/rim/samples/device/blackberrymaildemo/img/blackberrymaildemo_jde.png
  70. 135  com/rim/samples/device/blackberrymapsdemo/BlackBerryMapsDemo.java
  71. 113  com/rim/samples/device/blackberrymapsdemo/InvokeContactScreen.java
  72. 117  com/rim/samples/device/blackberrymapsdemo/InvokeLocationDocumentScreen.java
  73. 148  com/rim/samples/device/bluetooth/bluetoothdemo/AppScreen.java
  74. 73  com/rim/samples/device/bluetooth/bluetoothdemo/BluetoothDemo.java
  75. 2  com/rim/samples/device/{ → bluetooth}/bluetoothdemo/BluetoothDemo.jdp
  76. 430  com/rim/samples/device/bluetooth/bluetoothdemo/SPPScreen.java
  77. 0  com/rim/samples/device/{ → bluetooth}/bluetoothdemo/img/bluetooth_jde.png
  78. 138  com/rim/samples/device/bluetooth/bluetoothdemo/readme.txt
  79. 154  com/rim/samples/device/bluetooth/bluetoothjsr82demo/BluetoothJSR82Demo.java
  80. 56  com/rim/samples/device/bluetooth/bluetoothjsr82demo/BluetoothJSR82Demo.jdp
  81. 466  com/rim/samples/device/bluetooth/bluetoothjsr82demo/ClientScreen.java
  82. 151  com/rim/samples/device/bluetooth/bluetoothjsr82demo/InfoScreen.java
  83. 331  com/rim/samples/device/bluetooth/bluetoothjsr82demo/ServerScreen.java
  84. BIN  com/rim/samples/device/bluetooth/bluetoothjsr82demo/img/bluetoothJSR82demo_jde.png
  85. 144  com/rim/samples/device/{ → bluetooth}/bluetoothserialportdemo/BluetoothSerialPortDemo.java
  86. 0  com/rim/samples/device/{ → bluetooth}/bluetoothserialportdemo/BluetoothSerialPortDemo.jdp
  87. 0  com/rim/samples/device/{ → bluetooth}/bluetoothserialportdemo/img/serialportdemo_jde.png
  88. 104  com/rim/samples/device/bluetoothdemo/AppScreen.java
  89. 313  com/rim/samples/device/bluetoothdemo/SSPScreen.java
  90. 96  com/rim/samples/device/bluetoothdemo/readme.txt
  91. 117  ...samples/device/{blackberry/browser → browser/browsercontentmanagerdemo}/BrowserContentManagerDemo.java
  92. 7  .../samples/device/{blackberry/browser → browser/browsercontentmanagerdemo}/BrowserContentManagerDemo.jdp
  93. 0  .../device/{blackberry/browser → browser/browsercontentmanagerdemo}/img/browsercontentmanagerdemo_jde.png
  94. 148  com/rim/samples/device/browser/browserfield2demo/BrowserField2Demo.java
  95. 55  com/rim/samples/device/browser/browserfield2demo/BrowserField2Demo.jdp
  96. 359  com/rim/samples/device/browser/browserfield2demo/BrowserFieldScreen.java
  97. BIN  com/rim/samples/device/browser/browserfield2demo/img/browserfield2demo_jde.png
  98. 34  com/rim/samples/device/browser/browserfield2demo/index.html
  99. 32  com/rim/samples/device/browser/browserfield2demo/js/jquery.js
  100. 30  com/rim/samples/device/browser/browserfield2demo/js/script.js
  101. 96  com/rim/samples/device/{blackberry/browser → browser/browserfielddemo}/BrowserFieldDemo.java
  102. 17  com/rim/samples/device/{otasyncdemo/OTASyncDemo.jdp → browser/browserfielddemo/BrowserFieldDemo.jdp}
  103. 0  ...berry/browser/img/browserfieldapidemo_jde.png → browser/browserfielddemo/img/browserfielddemo_jde.png}
  104. 55  com/rim/samples/device/{blackberry/browser → browser/browserplugin}/BrowserPlugin.java
  105. 0  com/rim/samples/device/{blackberry/browser → browser/browserplugin}/BrowserPlugin.jdp
  106. 10  com/rim/samples/device/{blackberry/browser → browser/browserplugin}/LoaderApp.java
  107. 0  com/rim/samples/device/{blackberry/browser → browser/commonlib}/CommonLib.jdp
  108. 17  com/rim/samples/device/{blackberry/browser → browser/commonlib}/SecondaryResourceFetchThread.java
  109. 43  com/rim/samples/device/{blackberry/browser → browser/commonlib}/Utilities.java
  110. 138  com/rim/samples/device/bufferedplaybackdemo/BufferedPlayback.java
  111. 202  com/rim/samples/device/bufferedplaybackdemo/LimitedRateStreamingSource.java
  112. 4  com/rim/samples/device/bufferedplaybackdemo/bufferedplaybackdemo.jdp
  113. 812  com/rim/samples/device/camerademo/CameraDemo.java
  114. 5  com/rim/samples/device/camerademo/CameraDemo.jdp
  115. 52  com/rim/samples/device/camerademo/EncodingProperties.java
  116. 81  com/rim/samples/device/camerademo/EncodingPropertiesScreen.java
  117. 221  com/rim/samples/device/camerademo/ImageScreen.java
  118. 428  com/rim/samples/device/chapidemo/ChapiDemo.java
  119. 9  com/rim/samples/device/chapidemo/ChapiDemo.jdp
  120. 8  com/rim/samples/device/chapidemo/ChapiDemo_Autostartup.jdp
  121. 1  com/rim/samples/device/chapidemo/Data/rim.csv
  122. 161  com/rim/samples/device/chapidemo/DemoContentHandler.java
  123. 46  com/rim/samples/device/chapidemo/DemoContentHandler2.java
  124. 55  com/rim/samples/device/communicationapidemo/CommunicationAPIDemo.java
  125. 78  com/rim/samples/device/communicationapidemo/CommunicationAPIDemo.jdp
  126. 58  com/rim/samples/device/communicationapidemo/CommunicationAPILocalHelper.jdp
  127. 1,094  com/rim/samples/device/communicationapidemo/CommunicationController.java
  128. 20  .../device/{bluetoothdemo/BluetoothDemo.java → communicationapidemo/CommunicationControllerListener.java}
  129. 73  com/rim/samples/device/communicationapidemo/ResponseCallback.java
  130. 14  com/rim/samples/device/communicationapidemo/config/config.xml
  131. BIN  com/rim/samples/device/communicationapidemo/img/communicationapidemo_jde.png
  132. 110  com/rim/samples/device/communicationapidemo/local/CommunicationController.java
  133. 48  com/rim/samples/device/communicationapidemo/local/LocalHelper.java
  134. 91  com/rim/samples/device/communicationapidemo/local/MenuMainScreen.java
  135. 140  com/rim/samples/device/communicationapidemo/local/SendFireForgetScreen.java
  136. 133  com/rim/samples/device/communicationapidemo/readme.txt
  137. 69  com/rim/samples/device/communicationapidemo/ui/FullWidthButton.java
  138. 114  com/rim/samples/device/communicationapidemo/util/Utils.java
  139. 152  com/rim/samples/device/communicationapidemo/view/AuthenticationScreen.java
  140. 171  com/rim/samples/device/communicationapidemo/view/MenuMainScreen.java
  141. 182  com/rim/samples/device/communicationapidemo/view/MenuManager.java
  142. 129  com/rim/samples/device/communicationapidemo/view/MenuReceiveScreen.java
  143. 116  com/rim/samples/device/communicationapidemo/view/MenuSendNonBlockScreen.java
  144. 130  com/rim/samples/device/communicationapidemo/view/MenuSendScreen.java
  145. 148  com/rim/samples/device/communicationapidemo/view/MessageCancellationScreen.java
  146. 118  com/rim/samples/device/communicationapidemo/view/ReceiveBPSScreen.java
  147. 184  com/rim/samples/device/communicationapidemo/view/ReceiveIPCScreen.java
  148. 183  com/rim/samples/device/communicationapidemo/view/ReceivePushScreen.java
  149. 147  com/rim/samples/device/communicationapidemo/view/SendBlockScreen.java
  150. 139  com/rim/samples/device/communicationapidemo/view/SendFireForgetScreen.java
  151. 200  com/rim/samples/device/communicationapidemo/view/SendNonBlockAtomScreen.java
  152. 256  com/rim/samples/device/communicationapidemo/view/SendNonBlockJsonScreen.java
  153. 200  com/rim/samples/device/communicationapidemo/view/SendNonBlockRssScreen.java
  154. 212  com/rim/samples/device/communicationapidemo/view/SendNonBlockSoapScreen.java
  155. 188  com/rim/samples/device/communicationapidemo/view/SendNonBlockXmlScreen.java
  156. 140  com/rim/samples/device/communicationapidemo/view/StreamDataScreen.java
  157. 130  com/rim/samples/device/contactlinkingdemo/ContactLinkingDemo.java
  158. 61  com/rim/samples/device/contactlinkingdemo/ContactLinkingDemo.jdp
  159. 48  com/rim/samples/device/contactlinkingdemo/ContactLinkingDemo_autostartup.jdp
  160. 580  com/rim/samples/device/contactlinkingdemo/ContactListScreen.java
  161. 91  com/rim/samples/device/contactlinkingdemo/EventScreen.java
  162. 70  com/rim/samples/device/contactlinkingdemo/SampleContact.java
  163. 105  com/rim/samples/device/contactlinkingdemo/SampleLinkedContactInfoProvider.java
  164. 80  com/rim/samples/device/contactlinkingdemo/SampleMenuItem.java
  165. BIN  com/rim/samples/device/contactlinkingdemo/img/contactlinkingdemo_jde.png
  166. BIN  com/rim/samples/device/contactlinkingdemo/img/logo_black.jpg
  167. BIN  com/rim/samples/device/contactlinkingdemo/img/logo_blue.jpg
  168. 197  com/rim/samples/device/cryptodemo/CryptoDemo.java
  169. 328  com/rim/samples/device/embeddedmapdemo/EmbeddedMapDemo.java
  170. 52  com/rim/samples/device/embeddedmapdemo/EmbeddedMapDemo.jdp
  171. 267  com/rim/samples/device/embeddedmapdemo/ExtendedMapField.java
28  README.md
Source Rendered
... ...
@@ -1,8 +1,8 @@
1  
-# BlackBerry® Samples for Java
  1
+# BlackBerry® JDE Samples
2 2
 
3  
-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.
  3
+The BlackBerry® JDE Samples project is an Open Source repository of samples that in the past were released within the BlackBerry® Java® Development Environment or BlackBerry® Java® Plug-in for Eclipse®.  The samples range in scope from Hello World, to Advanced UI components and include both samples and libraries that offer extended functionality.
4 4
 
5  
-The samples in the project have been re-formatted and adjusted for Open Source release.  Branches and Tags will be created to match the state of the samples as they were/are released along with a BlackBerry® Java Development Environment.
  5
+Sample code is available that matches JDE released from 4.5.0 to 7.1.0 beta.  The samples in the project have been re-formatted and adjusted for Open Source release.  Branches and Tags have/will been created to match the state of the samples as they were/are released along with a BlackBerry® Java® Development Environment.
6 6
 
7 7
 The sample code is Open Source under the [Apache 2.0 License][].
8 8
 
@@ -11,8 +11,8 @@ The sample code is Open Source under the [Apache 2.0 License][].
11 11
 
12 12
 **Applies To**
13 13
 
14  
-* [BlackBerry® Java Development Environment](http://us.blackberry.com/developers/javaappdev/javadevenv.jsp)
15  
-* [BlackBerry® Java Plug-in for Eclipse](http://us.blackberry.com/developers/javaappdev/javaupdate.jsp)
  14
+* [BlackBerry® Java® Development Environment](http://us.blackberry.com/developers/javaappdev/javadevenv.jsp)
  15
+* [BlackBerry® Java® Plug-in for Eclipse](http://us.blackberry.com/developers/javaappdev/javaupdate.jsp)
16 16
 
17 17
 
18 18
 **Author** 
@@ -22,6 +22,8 @@ The sample code is Open Source under the [Apache 2.0 License][].
22 22
 
23 23
 **Dependencies**
24 24
 
  25
+The following dependencies are not included and must be downloaded and placed in the appropriate places:
  26
+
25 27
 1. [activation.jar][jaf-1.1.zip] which is part of [JavaBeans Activation Framework 1.1][jaf-1.1] is required for
26 28
    the Browser Multi-part Push Demo.  activation.jar should be extracted from the JavaBeans Activation Framework
27 29
    zip and placed in com/rim/samples/server/browsermultipartpushdemo/ as activation.jar.
@@ -34,7 +36,7 @@ The sample code is Open Source under the [Apache 2.0 License][].
34 36
   [javamail-1.4.4]: http://www.oracle.com/technetwork/java/javamail/index-138643.html
35 37
   [javamail-1.4.4.zip]: http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-eeplat-419426.html#javamail-1.4.4-oth-JPR
36 38
 
37  
-* Everything required to compile and run the BlackBerry® Samples for Java is included in either of the BlackBerry® Java environments.
  39
+* Everything required to compile and run the BlackBerry® Samples for Java® is included in either of the BlackBerry® Java® environments.
38 40
 
39 41
 **To contribute code to this repository you must be [signed up as an official contributor](http://blackberry.github.com/howToContribute.html).**
40 42
 
@@ -43,7 +45,7 @@ The sample code is Open Source under the [Apache 2.0 License][].
43 45
 
44 46
 To build the BlackBerry® Samples:
45 47
 
46  
-With the BlackBerry® JDE installed, load the BlackBerry® JDE Samples for Java workspace and select **Build** from the **Build** menu or press the **F7** key.  All active projcets will compile.  You are notified of any compilation or syntax errors during compilation.  If any errors occur, the process stops.
  48
+With the BlackBerry® JDE installed, load the BlackBerry® JDE Samples for Java® workspace and select **Build** from the **Build** menu or press the **F7** key.  All active projcets will compile.  You are notified of any compilation or syntax errors during compilation.  If any errors occur, the process stops.
47 49
 
48 50
 **To activate or deavtivate a project**
49 51
 
@@ -52,10 +54,10 @@ Right-click on the project and select **Activate Project** or **Deactivate Proje
52 54
 
53 55
 ## More Info
54 56
 
55  
-* [Java Application Development Overview][1]
  57
+* [Java® Application Development Overview][1]
56 58
 * [Get started with the BlackBerry® JDE][2]
57  
-* [Java Development Guides and API Reference][3]
58  
-* [BlackBerry® Java Developer Support Forum][4]
  59
+* [Java® Development Guides and API Reference][3]
  60
+* [BlackBerry® Java® Developer Support Forum][4]
59 61
 
60 62
   [1]: http://us.blackberry.com/developers/javaappdev/
61 63
   [2]: http://supportforums.blackberry.com/t5/Java-Development/Get-started-with-the-BlackBerry-JDE/ta-p/444837
@@ -67,9 +69,9 @@ Right-click on the project and select **Activate Project** or **Deactivate Proje
67 69
 
68 70
 To add new Samples or make modifications to existing Samples:
69 71
 
70  
-1. Fork the **BlackBerryJDE-Samples** repository
  72
+1. Fork the **JDE-Samples** repository
71 73
 2. Make the changes/additions to your fork
72  
-3. Send a pull request from your fork back to the **BlackBerryJDE-Samples** repository
  74
+3. Send a pull request from your fork back to the **JDE-Samples** repository
73 75
 4. If you made changes to code which you are NOT the owner, send a message via github messages to the Author(s) of the Sample to indicate that you have a pull request for them to review
74 76
 5. If you made changes to code which you own, send a message via github messages to one of the Committers listed below to have your code merged
75 77
 
@@ -78,7 +80,7 @@ To add new Samples or make modifications to existing Samples:
78 80
 
79 81
 If you find a bug in a Sample, or have an enhancement request, simply file an [Issue][] for the Sample and send a message (via github messages) to the Sample Author(s) to let them know that you have filed an [Issue][].
80 82
 
81  
-  [Issue]: https://github.com/blackberry/BlackBerryJDE-Samples/issues
  83
+  [Issue]: https://github.com/blackberry/JDE-Samples/issues
82 84
 
83 85
 ## Disclaimer
84 86
 
347  com/rim/samples/device/accelerometerdemo/AccelerometerDemo.java
... ...
@@ -0,0 +1,347 @@
  1
+/**
  2
+ * AccelerometerDemo.java
  3
+ * 
  4
+ * Copyright © 1998-2011 Research In Motion Limited
  5
+ * 
  6
+ * Licensed under the Apache License, Version 2.0 (the "License");
  7
+ * you may not use this file except in compliance with the License.
  8
+ * You may obtain a copy of the License at
  9
+ *
  10
+ * http://www.apache.org/licenses/LICENSE-2.0
  11
+ *
  12
+ * Unless required by applicable law or agreed to in writing, software
  13
+ * distributed under the License is distributed on an "AS IS" BASIS,
  14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15
+ * See the License for the specific language governing permissions and
  16
+ * limitations under the License.
  17
+ *
  18
+ * Note: For the sake of simplicity, this sample application may not leverage
  19
+ * resource bundles and resource strings.  However, it is STRONGLY recommended
  20
+ * that application developers make use of the localization features available
  21
+ * within the BlackBerry development platform to ensure a seamless application
  22
+ * experience across a variety of languages and geographies.  For more information
  23
+ * on localizing your application, please refer to the BlackBerry Java Development
  24
+ * Environment Development Guide associated with this release.
  25
+ */
  26
+
  27
+package com.rim.samples.device.accelerometerdemo;
  28
+
  29
+import java.util.Random;
  30
+
  31
+import net.rim.device.api.command.Command;
  32
+import net.rim.device.api.command.CommandHandler;
  33
+import net.rim.device.api.command.ReadOnlyCommandMetadata;
  34
+import net.rim.device.api.system.AccelerometerSensor;
  35
+import net.rim.device.api.system.AccelerometerSensor.Channel;
  36
+import net.rim.device.api.system.Bitmap;
  37
+import net.rim.device.api.system.DeviceInfo;
  38
+import net.rim.device.api.system.Display;
  39
+import net.rim.device.api.ui.Graphics;
  40
+import net.rim.device.api.ui.MenuItem;
  41
+import net.rim.device.api.ui.Screen;
  42
+import net.rim.device.api.ui.Ui;
  43
+import net.rim.device.api.ui.UiApplication;
  44
+import net.rim.device.api.ui.component.Dialog;
  45
+import net.rim.device.api.ui.component.Menu;
  46
+import net.rim.device.api.ui.container.MainScreen;
  47
+import net.rim.device.api.util.StringProvider;
  48
+
  49
+/**
  50
+ * This sample demonstrates the Accelerometer API. The DrawThread opens the
  51
+ * accelerometer channel and periodically queries for the current data reading.
  52
+ * The data is then used to apply corresponding force to a ball drawn on the
  53
+ * screen.
  54
+ */
  55
+public final class AccelerometerDemo extends UiApplication {
  56
+    private AccelerometerDemoScreen _screen;
  57
+    private DrawThread _thread;
  58
+
  59
+    private Bitmap _ball;
  60
+    private int _ballWidth;
  61
+    private int _ballHeight;
  62
+
  63
+    private int _x;
  64
+    private int _y;
  65
+    private float _xSpeed;
  66
+    private float _ySpeed;
  67
+
  68
+    private Random _r;
  69
+
  70
+    private boolean _simulated;
  71
+    private Channel _accChannel;
  72
+    private final short[] _xyz = new short[3];
  73
+
  74
+    private static final float G_NORM =
  75
+            9.8066f / AccelerometerSensor.G_FORCE_VALUE;
  76
+    private static final float TABLE_FRICTION = 0.98f;
  77
+    private static final float BOUNCE_SLOWDOWN = 0.6f;
  78
+
  79
+    private static final int DEFAULT_ORIENTATION = Display.DIRECTION_NORTH;
  80
+
  81
+    private int _tick = 0;
  82
+
  83
+    private MenuItem _startMenuItem;
  84
+    private MenuItem _stopMenuItem;
  85
+
  86
+    /**
  87
+     * Entry point for application
  88
+     * 
  89
+     * @param args
  90
+     *            Command line arguments (not used)
  91
+     */
  92
+    public static void main(final String[] args) {
  93
+        // Create a new instance of the application and make the currently
  94
+        // running thread the application's event dispatch thread.
  95
+        final AccelerometerDemo app = new AccelerometerDemo();
  96
+        app.enterEventDispatcher();
  97
+    }
  98
+
  99
+    /**
  100
+     * Creates a new AccelerometerDemo object
  101
+     */
  102
+    public AccelerometerDemo() {
  103
+        if (AccelerometerSensor.isSupported()) {
  104
+
  105
+            // Menu item to start the ball moving
  106
+            _startMenuItem =
  107
+                    new MenuItem(new StringProvider("Start"), 0x230010, 0);
  108
+            _startMenuItem.setCommand(new Command(new CommandHandler() {
  109
+                /**
  110
+                 * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
  111
+                 *      Object)
  112
+                 */
  113
+                public void execute(final ReadOnlyCommandMetadata metadata,
  114
+                        final Object context) {
  115
+                    if (_thread == null) {
  116
+                        // Start drawing
  117
+                        _thread = new DrawThread();
  118
+                        _thread.start();
  119
+                    }
  120
+                }
  121
+            }));
  122
+
  123
+            // Menu item to stop the ball moving
  124
+            _stopMenuItem =
  125
+                    new MenuItem(new StringProvider("Stop"), 0x230010, 0);
  126
+            _stopMenuItem.setCommand(new Command(new CommandHandler() {
  127
+                /**
  128
+                 * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
  129
+                 *      Object)
  130
+                 */
  131
+                public void execute(final ReadOnlyCommandMetadata metadata,
  132
+                        final Object context) {
  133
+                    if (_thread != null) {
  134
+                        synchronized (_thread) {
  135
+                            _thread._running = false;
  136
+                            _thread.notifyAll();
  137
+                            _thread = null;
  138
+                        }
  139
+                    }
  140
+                }
  141
+            }));
  142
+
  143
+            _screen = new AccelerometerDemoScreen();
  144
+            pushScreen(_screen);
  145
+
  146
+            _ball = Bitmap.getBitmapResource("img/ball.png");
  147
+            _r = new Random();
  148
+
  149
+            if (_ball != null) {
  150
+                _ballWidth = _ball.getWidth();
  151
+                _ballHeight = _ball.getHeight();
  152
+            }
  153
+
  154
+            // Prevent UI from rotating the screen
  155
+            Ui.getUiEngineInstance().setAcceptableDirections(
  156
+                    DEFAULT_ORIENTATION);
  157
+        } else {
  158
+            UiApplication.getUiApplication().invokeLater(new Runnable() {
  159
+                public void run() {
  160
+                    Dialog.alert("This device does not support accelerometer.");
  161
+                    System.exit(0);
  162
+                }
  163
+            });
  164
+        }
  165
+    }
  166
+
  167
+    /**
  168
+     * Calculates ball position
  169
+     * 
  170
+     * @param xAcc
  171
+     *            x axis acceleration
  172
+     * @param yAcc
  173
+     *            y axis acceleration
  174
+     */
  175
+    private void applyForce(final int xAcc, final int yAcc) {
  176
+        // Calculate new speed
  177
+        _xSpeed += xAcc * G_NORM;
  178
+        _ySpeed += yAcc * G_NORM;
  179
+
  180
+        // Apply table friction
  181
+        _xSpeed *= TABLE_FRICTION;
  182
+        _ySpeed *= TABLE_FRICTION;
  183
+
  184
+        // Move the ball
  185
+        _x += _xSpeed;
  186
+        _y += _ySpeed;
  187
+
  188
+        if (_x < 0) {
  189
+            _x = 0;
  190
+            _xSpeed = -(_xSpeed * BOUNCE_SLOWDOWN);
  191
+        } else {
  192
+            final int screenWidth = _screen.getWidth();
  193
+            if (_x > screenWidth - _ballWidth) {
  194
+                _x = screenWidth - _ballHeight;
  195
+                _xSpeed = -(_xSpeed * BOUNCE_SLOWDOWN);
  196
+            }
  197
+        }
  198
+
  199
+        if (_y < 0) {
  200
+            _y = 0;
  201
+            _ySpeed = -(_ySpeed * BOUNCE_SLOWDOWN);
  202
+        } else {
  203
+            final int screenHeight = _screen.getHeight();
  204
+            if (_y > screenHeight - _ballHeight) {
  205
+                _y = screenHeight - _ballHeight;
  206
+                _ySpeed = -(_ySpeed * BOUNCE_SLOWDOWN);
  207
+            }
  208
+        }
  209
+    }
  210
+
  211
+    /**
  212
+     * A thread class to handle screen updates
  213
+     */
  214
+    private class DrawThread extends Thread {
  215
+        private boolean _running;
  216
+
  217
+        public void run() {
  218
+            _running = true;
  219
+
  220
+            // Start querying the accelerometer sensor
  221
+            openAccelerometerConnection();
  222
+
  223
+            while (_running) {
  224
+                _tick++;
  225
+
  226
+                // Get current acceleration
  227
+                readAcceleration();
  228
+
  229
+                // Apply force to the ball
  230
+                applyForce(-_xyz[0], _xyz[1]);
  231
+
  232
+                try {
  233
+                    synchronized (this) {
  234
+                        wait(50);
  235
+                    }
  236
+                } catch (final InterruptedException e) {
  237
+                    UiApplication.getUiApplication().invokeLater(
  238
+                            new Runnable() {
  239
+                                public void run() {
  240
+                                    Dialog.alert("wait(long) threw InterruptedException");
  241
+                                }
  242
+                            });
  243
+                }
  244
+
  245
+                if (!_running) {
  246
+                    break;
  247
+                }
  248
+
  249
+                _screen.invalidate();
  250
+            }
  251
+
  252
+            // Stop querying the sensor to save battery charge
  253
+            closeAccelerometerConnection();
  254
+        }
  255
+
  256
+        /**
  257
+         * Returns running state of thread
  258
+         * 
  259
+         * @return True if this thread is running, otherwise false
  260
+         */
  261
+        public boolean isRunning() {
  262
+            return _running;
  263
+        }
  264
+    }
  265
+
  266
+    /**
  267
+     * Opens the data channel
  268
+     */
  269
+    private void openAccelerometerConnection() {
  270
+        if (DeviceInfo.isSimulator()) {
  271
+            _simulated = true;
  272
+        } else {
  273
+            _accChannel =
  274
+                    AccelerometerSensor
  275
+                            .openRawDataChannel(AccelerometerDemo.this);
  276
+            _simulated = false;
  277
+        }
  278
+    }
  279
+
  280
+    /**
  281
+     * Gets the latest acceleromenter data
  282
+     */
  283
+    private void readAcceleration() {
  284
+        if (_simulated) {
  285
+            // Running in a simulator, simulate random
  286
+            if (_tick % 10 == 0) {
  287
+                _xyz[0] = (short) (_r.nextInt(400) - 200);
  288
+                _xyz[1] = (short) (_r.nextInt(400) - 200);
  289
+            }
  290
+        } else {
  291
+            // Real device, call the API for samples
  292
+            _accChannel.getLastAccelerationData(_xyz);
  293
+        }
  294
+    }
  295
+
  296
+    /**
  297
+     * Closes the data channel
  298
+     */
  299
+    private void closeAccelerometerConnection() {
  300
+        if (_accChannel != null) {
  301
+            _accChannel.close();
  302
+            _accChannel = null;
  303
+        }
  304
+    }
  305
+
  306
+    /**
  307
+     * A screen on which to display the ball
  308
+     */
  309
+    private class AccelerometerDemoScreen extends MainScreen {
  310
+        /**
  311
+         * @see Screen#paint(Graphics)
  312
+         */
  313
+        protected void paint(final Graphics graphics) {
  314
+            if (_ball != null) {
  315
+                graphics.drawBitmap(_x, _y, _ballWidth, _ballHeight, _ball, 0,
  316
+                        0);
  317
+            }
  318
+        }
  319
+
  320
+        /**
  321
+         * @see MainScreen#makeMenu(Menu, int)
  322
+         */
  323
+        protected void makeMenu(final Menu menu, final int instance) {
  324
+            if (_thread == null || !_thread.isRunning()) {
  325
+                menu.add(_startMenuItem);
  326
+            } else {
  327
+                menu.add(_stopMenuItem);
  328
+            }
  329
+
  330
+            super.makeMenu(menu, instance);
  331
+        }
  332
+
  333
+        /**
  334
+         * @see Screen#onClose()
  335
+         */
  336
+        public boolean onClose() {
  337
+            if (_thread != null) {
  338
+                synchronized (_thread) {
  339
+                    _thread._running = false;
  340
+                    _thread.notifyAll();
  341
+                }
  342
+                Thread.yield();
  343
+            }
  344
+            return super.onClose();
  345
+        }
  346
+    }
  347
+}
52  com/rim/samples/device/accelerometerdemo/AccelerometerDemo.jdp
... ...
@@ -0,0 +1,52 @@
  1
+## RIM Java Development Environment
  2
+# RIM Project file
  3
+#
  4
+# This file is generated and managed by BlackBerry developer tools.
  5
+# It SHOULD NOT BE modified manually.
  6
+#
  7
+AddOn=0
  8
+AlwaysBuild=0
  9
+[AlxImports
  10
+]
  11
+AutoRestart=0
  12
+[ClassProtection
  13
+]
  14
+[CustomBuildFiles
  15
+]
  16
+[CustomBuildRules
  17
+]
  18
+[DefFiles
  19
+]
  20
+[DependsOn
  21
+]
  22
+ExcludeFromBuildAll=0
  23
+[Files
  24
+AccelerometerDemo.java
  25
+img\accelerometerdemo_jde.png
  26
+img\ball.png
  27
+]
  28
+HaveAlxImports=0
  29
+HaveDefs=0
  30
+HaveImports=0
  31
+[Icons
  32
+img\accelerometerdemo_jde.png
  33
+]
  34
+[ImplicitRules
  35
+]
  36
+[Imports
  37
+]
  38
+Listing=0
  39
+Options=-quiet 
  40
+OutputFileName=AccelerometerDemo
  41
+[PackageProtection
  42
+]
  43
+RibbonPosition=0
  44
+[RolloverIcons
  45
+]
  46
+RunOnStartup=0
  47
+StartupTier=7
  48
+SystemModule=0
  49
+Title=Accelerometer Demo
  50
+Type=0
  51
+Vendor=Research In Motion Limited
  52
+Version=0.9
BIN  com/rim/samples/device/accelerometerdemo/img/accelerometerdemo_jde.png
BIN  com/rim/samples/device/accelerometerdemo/img/ball.png
150  com/rim/samples/device/accessibilitydemo/customcomponentsdemo/CustomComponentsDemo.java
... ...
@@ -0,0 +1,150 @@
  1
+/*
  2
+ * CustomComponentsDemo.java
  3
+ *
  4
+ * Copyright © 1998-2011 Research In Motion Limited
  5
+ * 
  6
+ * Licensed under the Apache License, Version 2.0 (the "License");
  7
+ * you may not use this file except in compliance with the License.
  8
+ * You may obtain a copy of the License at
  9
+ *
  10
+ * http://www.apache.org/licenses/LICENSE-2.0
  11
+ *
  12
+ * Unless required by applicable law or agreed to in writing, software
  13
+ * distributed under the License is distributed on an "AS IS" BASIS,
  14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15
+ * See the License for the specific language governing permissions and
  16
+ * limitations under the License.
  17
+ *
  18
+ * Note: For the sake of simplicity, this sample application may not leverage
  19
+ * resource bundles and resource strings.  However, it is STRONGLY recommended
  20
+ * that application developers make use of the localization features available
  21
+ * within the BlackBerry development platform to ensure a seamless application
  22
+ * experience across a variety of languages and geographies.  For more information
  23
+ * on localizing your application, please refer to the BlackBerry Java Development
  24
+ * Environment Development Guide associated with this release.
  25
+ */
  26
+
  27
+package com.rim.samples.device.accessibilitydemo.customcomponentsdemo;
  28
+
  29
+import net.rim.device.api.system.Bitmap;
  30
+import net.rim.device.api.ui.Screen;
  31
+import net.rim.device.api.ui.UiApplication;
  32
+import net.rim.device.api.ui.accessibility.AccessibilityManager;
  33
+import net.rim.device.api.ui.component.Dialog;
  34
+import net.rim.device.api.ui.component.SeparatorField;
  35
+import net.rim.device.api.ui.container.MainScreen;
  36
+
  37
+import com.rim.samples.device.accessibilitydemo.screenreaderdemo.ScreenReader;
  38
+
  39
+/**
  40
+ * The Accessibility Demo consists of two projects, CustomComponentsDemo and
  41
+ * ScreenReaderDemo. CustomComponentsDemo is a UI application featuring
  42
+ * customized accessible UI fields. ScreenReaderDemo is a library project
  43
+ * containing the ScreenReader class, which is a listener for accessible events,
  44
+ * and utility classes for handling the accessible events generated by the
  45
+ * accessible fields in the CustomComponentsDemo.
  46
+ */
  47
+public final class CustomComponentsDemo extends UiApplication {
  48
+    private static ScreenReader _screenReader;
  49
+
  50
+    /**
  51
+     * Entry point for application.
  52
+     * 
  53
+     * @param args
  54
+     *            Command line arguments (not used)
  55
+     */
  56
+    public static void main(final String[] args) {
  57
+        // Create a new instance of the application and make the currently
  58
+        // running thread the application's event dispatch thread.
  59
+        new CustomComponentsDemo().enterEventDispatcher();
  60
+    }
  61
+
  62
+    /**
  63
+     * Creates a new CustomComponentsDemo object
  64
+     */
  65
+    public CustomComponentsDemo() {
  66
+        try {
  67
+            // Only one listener can be registered
  68
+            if (!AccessibilityManager.isAccessibleEventListenerRegistered()) {
  69
+                _screenReader = new ScreenReader();
  70
+                AccessibilityManager.setAccessibleEventListener(_screenReader);
  71
+            } else {
  72
+                System.out
  73
+                        .println("An AccessibleEventListener is already registered");
  74
+            }
  75
+        } catch (final net.rim.device.api.system.UnsupportedOperationException uoe) {
  76
+            UiApplication.getUiApplication().invokeLater(new Runnable() {
  77
+                public void run() {
  78
+                    Dialog.alert("Accessibilty not supported on this device");
  79
+                }
  80
+            });
  81
+        }
  82
+
  83
+        // Push the UI screen onto the display stack
  84
+        pushScreen(new CustomComponentsDemoScreen());
  85
+    }
  86
+
  87
+    /**
  88
+     * The UI screen for the CustomComponentsDemo
  89
+     */
  90
+    private static final class CustomComponentsDemoScreen extends MainScreen {
  91
+        private final IconToolbarComponent _iconToolbar;
  92
+        private final TableComponent _tableComponent;
  93
+        private final TextComponent _textComponent;
  94
+        private final ValueComponent _valueComponent;
  95
+
  96
+        /**
  97
+         * Creates a new CustomComponentsDemoScreen object
  98
+         */
  99
+        private CustomComponentsDemoScreen() {
  100
+            setTitle("Accessibility Demo");
  101
+
  102
+            // Initialize the IconToolbarComponent
  103
+            _iconToolbar = new IconToolbarComponent();
  104
+            final Bitmap bitmap1 = Bitmap.getBitmapResource("1.png");
  105
+            final Bitmap bitmap2 = Bitmap.getBitmapResource("2.png");
  106
+            final Bitmap bitmap3 = Bitmap.getBitmapResource("3.png");
  107
+            final Bitmap bitmap4 = Bitmap.getBitmapResource("4.png");
  108
+            _iconToolbar.addIcon(bitmap1, " Maps ");
  109
+            _iconToolbar.addIcon(bitmap2, " Media ");
  110
+            _iconToolbar.addIcon(bitmap3, " Documents ");
  111
+            _iconToolbar.addIcon(bitmap4, " Applications ");
  112
+
  113
+            // Add the IconToolbarComponent to the screen
  114
+            add(_iconToolbar);
  115
+
  116
+            add(new SeparatorField());
  117
+
  118
+            // Create TableComponent and add to the screen
  119
+            _tableComponent = new TableComponent(3, 4);
  120
+            add(_tableComponent);
  121
+
  122
+            add(new SeparatorField());
  123
+
  124
+            // Create ValueComponent and add to the screen
  125
+            _valueComponent = new ValueComponent(0, 50, 100);
  126
+            add(_valueComponent);
  127
+
  128
+            add(new SeparatorField());
  129
+
  130
+            // Create TextComponent and add to the screen
  131
+            _textComponent =
  132
+                    new TextComponent(
  133
+                            "Connect to everything you love in life through the power of a BlackBerry® smartphone");
  134
+            add(_textComponent);
  135
+        }
  136
+
  137
+        /**
  138
+         * @see Screen#close()
  139
+         */
  140
+        public void close() {
  141
+            // Unregister the accessible event listener when exiting the app
  142
+            if (AccessibilityManager.isAccessibleEventListenerRegistered()) {
  143
+                AccessibilityManager
  144
+                        .removeAccessibleEventListener(_screenReader);
  145
+            }
  146
+
  147
+            super.close();
  148
+        }
  149
+    }
  150
+}
62  com/rim/samples/device/accessibilitydemo/customcomponentsdemo/CustomComponentsDemo.jdp
... ...
@@ -0,0 +1,62 @@
  1
+## RIM Java Development Environment
  2
+# RIM Project file
  3
+#
  4
+# This file is generated and managed by BlackBerry developer tools.
  5
+# It SHOULD NOT BE modified manually.
  6
+#
  7
+AddOn=0
  8
+AlwaysBuild=0
  9
+[AlxImports
  10
+]
  11
+AutoRestart=0
  12
+[ClassProtection
  13
+]
  14
+[CustomBuildFiles
  15
+]
  16
+[CustomBuildRules
  17
+]
  18
+[DefFiles
  19
+]
  20
+[DependsOn
  21
+ScreenReaderDemo
  22
+]
  23
+ExcludeFromBuildAll=0
  24
+Exported=0
  25
+[Files
  26
+CustomComponentsDemo.java
  27
+IconToolbarComponent.java
  28
+img\1.png
  29
+img\2.png
  30
+img\3.png
  31
+img\4.png
  32
+img\accessibilitydemo_jde.png
  33
+TableComponent.java
  34
+TextComponent.java
  35
+ValueComponent.java
  36
+]
  37
+HaveAlxImports=0
  38
+HaveDefs=0
  39
+HaveImports=0
  40
+[Icons
  41
+img\accessibilitydemo_jde.png
  42
+]
  43
+[ImplicitRules
  44
+]
  45
+[Imports
  46
+]
  47
+Listing=0
  48
+Options=-quiet 
  49
+OutputFileName=CustomComponentsDemo
  50
+[PackageProtection
  51
+]
  52
+RibbonPosition=0
  53
+[RolloverIcons
  54
+]
  55
+RunOnStartup=0
  56
+SkipCompile=0
  57
+StartupTier=7
  58
+SystemModule=0
  59
+Title=Accessibility Demo
  60
+Type=0
  61
+Vendor=Research In Motion Limited
  62
+Version=0.9
504  com/rim/samples/device/accessibilitydemo/customcomponentsdemo/IconToolbarComponent.java
... ...
@@ -0,0 +1,504 @@
  1
+/*
  2
+ * IconToolbarComponent.java
  3
+ *
  4
+ * Copyright © 1998-2011 Research In Motion Limited
  5
+ * 
  6
+ * Licensed under the Apache License, Version 2.0 (the "License");
  7
+ * you may not use this file except in compliance with the License.
  8
+ * You may obtain a copy of the License at
  9
+ *
  10
+ * http://www.apache.org/licenses/LICENSE-2.0
  11
+ *
  12
+ * Unless required by applicable law or agreed to in writing, software
  13
+ * distributed under the License is distributed on an "AS IS" BASIS,
  14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15
+ * See the License for the specific language governing permissions and
  16
+ * limitations under the License.
  17
+ *
  18
+ * Note: For the sake of simplicity, this sample application may not leverage
  19
+ * resource bundles and resource strings.  However, it is STRONGLY recommended
  20
+ * that application developers make use of the localization features available
  21
+ * within the BlackBerry development platform to ensure a seamless application
  22
+ * experience across a variety of languages and geographies.  For more information
  23
+ * on localizing your application, please refer to the BlackBerry Java Development
  24
+ * Environment Development Guide associated with this release.
  25
+ */
  26
+
  27
+package com.rim.samples.device.accessibilitydemo.customcomponentsdemo;
  28
+
  29
+import java.util.Vector;
  30
+
  31
+import net.rim.device.api.system.Bitmap;
  32
+import net.rim.device.api.ui.AccessibleEventDispatcher;
  33
+import net.rim.device.api.ui.Field;
  34
+import net.rim.device.api.ui.Graphics;
  35
+import net.rim.device.api.ui.Manager;
  36
+import net.rim.device.api.ui.accessibility.AccessibleContext;
  37
+import net.rim.device.api.ui.accessibility.AccessibleRole;
  38
+import net.rim.device.api.ui.accessibility.AccessibleState;
  39
+import net.rim.device.api.ui.accessibility.AccessibleTable;
  40
+import net.rim.device.api.ui.accessibility.AccessibleText;
  41
+import net.rim.device.api.ui.accessibility.AccessibleValue;
  42
+
  43
+/**
  44
+ * IconToolbarComponent is a customized accessible UI field implementation. The
  45
+ * field contains icons laid out in a horizontal configuration. The icons are
  46
+ * themselves accessible and are represented by the inner class Icon.
  47
+ */
  48
+public final class IconToolbarComponent extends Field implements
  49
+        AccessibleContext {
  50
+    private final Vector _icons;
  51
+    private int[] _iconX;
  52
+    private int _currentSelection;
  53
+    private int _iconHeight;
  54
+    private int _state;
  55
+
  56
+    /**
  57
+     * Creates a new IconToolbarComponent object
  58
+     */
  59
+    public IconToolbarComponent() {
  60
+        super(Field.FOCUSABLE);
  61
+
  62
+        _icons = new Vector();
  63
+        _currentSelection = -1;
  64
+
  65
+        // The component can recieve focus
  66
+        _state = AccessibleState.FOCUSABLE;
  67
+    }
  68
+
  69
+    /**
  70
+     * Adds an accessible icon to the icons vector
  71
+     * 
  72
+     * @param image
  73
+     *            The icon image
  74
+     * @param label
  75
+     *            The icon label
  76
+     */
  77
+    void addIcon(final Bitmap image, final String label) {
  78
+        final Icon icon = new Icon(label, image);
  79
+        _icons.addElement(icon);
  80
+
  81
+        final int iconHeight = image.getHeight();
  82
+        if (_iconHeight < iconHeight) {
  83
+            _iconHeight = iconHeight;
  84
+        }
  85
+
  86
+        // The first icon will be selected by default
  87
+        if (_currentSelection == -1) {
  88
+            _currentSelection = 0;
  89
+            icon._state |= AccessibleState.FOCUSED;
  90
+        }
  91
+
  92
+        // Causes the component to be repainted
  93
+        invalidate();
  94
+    }
  95
+
  96
+    /**
  97
+     * @see Field#layout(int, int)
  98
+     */
  99
+    protected void layout(final int width, final int height) {
  100
+        final int iconCount = _icons.size();
  101
+
  102
+        // Layout icons horizontally
  103
+        if (iconCount != 0) {
  104
+            final int xStep = width / iconCount;
  105
+            int x = 0;
  106
+
  107
+            _iconX = new int[iconCount];
  108
+            for (int i = 0; i < iconCount; i++) {
  109
+                _iconX[i] = x;
  110
+                x += xStep;
  111
+            }
  112
+
  113
+            setExtent(width, Math.min(_iconHeight, height));
  114
+        }
  115
+    }
  116
+
  117
+    /**
  118
+     * @see Field#navigationMovement(int, int, int, int)
  119
+     */
  120
+    protected boolean navigationMovement(final int dx, final int dy,
  121
+            final int status, final int time) {
  122
+        // Move to next or prev icon
  123
+        if (dx > 0) {
  124
+            if (_currentSelection < _icons.size() - 1) {
  125
+                // Update accessible state and notify screen reader
  126
+                Icon currentIcon = (Icon) _icons.elementAt(_currentSelection);
  127
+                currentIcon.focusChanged(false);
  128
+
  129
+                // Update current selected icon in the toolbar
  130
+                _currentSelection++;
  131
+
  132
+                // Update accessible state and notify screen reader
  133
+                currentIcon = (Icon) _icons.elementAt(_currentSelection);
  134
+                currentIcon.focusChanged(true);
  135
+            }
  136
+
  137
+            // Force a repaint of the component
  138
+            invalidate();
  139
+
  140
+            return true;
  141
+        } else if (dx < 0) {
  142
+            if (_currentSelection > 0) {
  143
+                // Update accessible state and notify screen reader
  144
+                Icon currentIcon = (Icon) _icons.elementAt(_currentSelection);
  145
+                currentIcon.focusChanged(false);
  146
+
  147
+                _currentSelection--;
  148
+
  149
+                // Update accessible state and notify screen reader
  150
+                currentIcon = (Icon) _icons.elementAt(_currentSelection);
  151
+                currentIcon.focusChanged(true);
  152
+            }
  153
+
  154
+            // Force a repaint of the component
  155
+            invalidate();
  156
+
  157
+            return true;
  158
+        }
  159
+        return super.navigationMovement(dx, dy, status, time);
  160
+    }
  161
+
  162
+    /**
  163
+     * @see Field#paint(Graphics)
  164
+     */
  165
+    protected void paint(final Graphics graphics) {
  166
+        // Paint all the icons at their locations.
  167
+        for (int i = 0; i < _icons.size(); i++) {
  168
+            final Icon icon = (Icon) _icons.elementAt(i);
  169
+            icon.paint(graphics, _iconX[i], 0);
  170
+        }
  171
+    }
  172
+
  173
+    /**
  174
+     * @see Field#drawFocus(Graphics, boolean)
  175
+     */
  176
+    protected void drawFocus(final Graphics graphics, final boolean on) {
  177
+        drawHighlightRegion(graphics, Field.HIGHLIGHT_FOCUS, on,
  178
+                _iconX[_currentSelection], 0, 48, _iconHeight);
  179
+    }
  180
+
  181
+    /**
  182
+     * @see Field#onFocus(int)
  183
+     */
  184
+    protected void onFocus(final int direction) {
  185
+        super.onFocus(direction);
  186
+
  187
+        // Update accessible state and notify screen reader
  188
+        final int oldState = _state;
  189
+        _state = _state | AccessibleState.FOCUSED;
  190
+
  191
+        // Notify screen reader if the panel is visible
  192
+        if (isVisible()) {
  193
+            AccessibleEventDispatcher.dispatchAccessibleEvent(
  194
+                    AccessibleContext.ACCESSIBLE_STATE_CHANGED, new Integer(
  195
+                            oldState), new Integer(_state), this);
  196
+        }
  197
+    }
  198
+
  199
+    /**
  200
+     * @see Field#onUnfocus()
  201
+     */
  202
+    protected void onUnfocus() {
  203
+        super.onUnfocus();
  204
+
  205
+        // Update accessible state and notify screen reader
  206
+        final int oldState = _state;
  207
+        _state = _state & ~AccessibleState.FOCUSED;
  208
+
  209
+        // Notify screen reader if the panel is visible
  210
+        if (isVisible()) {
  211
+            AccessibleEventDispatcher.dispatchAccessibleEvent(
  212
+                    AccessibleContext.ACCESSIBLE_STATE_CHANGED, new Integer(
  213
+                            oldState), new Integer(_state), this);
  214
+        }
  215
+    }
  216
+
  217
+    /**
  218
+     * @see Field#getAccessibleContext()
  219
+     */
  220
+    public AccessibleContext getAccessibleContext() {
  221
+        return this;
  222
+    }
  223
+
  224
+    // *********** AccessibleContext implementation ****************************
  225
+
  226
+    /**
  227
+     * @see AccessibleContext#getAccessibleChildAt(int)
  228
+     */
  229
+    public AccessibleContext getAccessibleChildAt(final int index) {
  230
+        // Return icon child at the requested index
  231
+        return (Icon) _icons.elementAt(index);
  232
+    }
  233
+
  234
+    /**
  235
+     * @see AccessibleContext#getAccessibleChildCount()
  236
+     */
  237
+    public int getAccessibleChildCount() {
  238
+        // Return total number of children
  239
+        return _icons.size();
  240
+    }
  241
+
  242
+    /**
  243
+     * @see AccessibleContext#getAccessibleName()
  244
+     */
  245
+    public String getAccessibleName() {
  246
+        return " My Icon Toolbar ";
  247
+    }
  248
+
  249
+    /**
  250
+     * @see AccessibleContext#getAccessibleParent()
  251
+     */
  252
+    public AccessibleContext getAccessibleParent() {
  253
+        // Return manager where the toolbar component is added
  254
+        final Manager manager = getManager();
  255
+        return manager != null ? manager.getAccessibleContext() : null;
  256
+    }
  257
+
  258
+    /**
  259
+     * @see AccessibleContext#getAccessibleRole()
  260
+     */
  261
+    public int getAccessibleRole() {
  262
+        // This is a panel with icons
  263
+        return AccessibleRole.PANEL;
  264
+    }
  265
+
  266
+    /**
  267
+     * @see AccessibleContext#getAccessibleSelectionCount()
  268
+     */
  269
+    public int getAccessibleSelectionCount() {
  270
+        // Only one icon selected at a time
  271
+        return 1;
  272
+    }
  273
+
  274
+    /**
  275
+     * @see AccessibleContext#getAccessibleSelectionAt(int)
  276
+     */
  277
+    public AccessibleContext getAccessibleSelectionAt(final int index) {
  278
+        if (index == 0) {
  279
+            return (Icon) _icons.elementAt(_currentSelection);
  280
+        }
  281
+
  282
+        // Wrong selection index
  283
+        return null;
  284
+    }
  285
+
  286
+    /**
  287
+     * @see AccessibleContext#getAccessibleStateSet()
  288
+     */
  289
+    public int getAccessibleStateSet() {
  290
+        return _state;
  291
+    }
  292
+
  293
+    /**
  294
+     * @see AccessibleContext#isAccessibleStateSet(int)
  295
+     */
  296
+    public boolean isAccessibleStateSet(final int state) {
  297
+        return (getAccessibleStateSet() & state) != 0;
  298
+    }
  299
+
  300
+    /**
  301
+     * @see AccessibleContext#isAccessibleChildSelected(int)
  302
+     */
  303
+    public boolean isAccessibleChildSelected(final int index) {
  304
+        // Check whether child icon at the specified index is selected
  305
+        return _currentSelection == index;
  306
+    }
  307
+
  308
+    /**
  309
+     * @see AccessibleContext#getAccessibleTable()
  310
+     */
  311
+    public AccessibleTable getAccessibleTable() {
  312
+        // This is a panel, not a table
  313
+        return null;
  314
+    }
  315
+
  316
+    /**
  317
+     * @see AccessibleContext#getAccessibleText()
  318
+     */
  319
+    public AccessibleText getAccessibleText() {
  320
+        // This is a panel, not text
  321
+        return null;
  322
+    }
  323
+
  324
+    /**
  325
+     * @see AccessibleContext#getAccessibleValue()
  326
+     */
  327
+    public AccessibleValue getAccessibleValue() {
  328
+        // This is a panel, not a numerical value
  329
+        return null;
  330
+    }
  331
+
  332
+    // ********************** IconToolbarComponent child ***********************
  333
+
  334
+    /**
  335
+     * The Icon class, serves as a child to the icon toolbar component
  336
+     */
  337
+    public class Icon implements AccessibleContext {
  338
+        private final String _label;
  339
+        private final Bitmap _image;
  340
+        private int _state;
  341
+
  342
+        /**
  343
+         * Creates a new Icon object
  344
+         * 
  345
+         * @param label
  346
+         *            Label for the icon
  347
+         * @param image
  348
+         *            Bitmap image for the icon
  349
+         */
  350
+        public Icon(final String label, final Bitmap image) {
  351
+            _label = label;
  352
+            _image = image;
  353
+
  354
+            // Icon can be focused
  355
+            _state = AccessibleState.FOCUSABLE;
  356
+        }
  357
+
  358
+        /**
  359
+         * Paints this icon using the provided Graphics object
  360
+         * 
  361
+         * @param graphics
  362
+         *            Graphics object used for drawing
  363
+         * @param x
  364
+         *            Horizontal position within the IconToolbarComponent at
  365
+         *            which to draw the icon
  366
+         * @param y
  367
+         *            Vertical position within the IconToolbarComponent at which
  368
+         *            to draw the icon
  369
+         */
  370
+        public void paint(final Graphics graphics, final int x, final int y) {
  371
+            graphics.drawBitmap(x, y, _image.getWidth(), _image.getHeight(),
  372
+                    _image, 0, 0);
  373
+        }
  374
+
  375
+        // *********** AccessibleContext implementation
  376
+        // ****************************
  377
+
  378
+        /**
  379
+         * @see AccessibleContext#getAccessibleName()
  380
+         */
  381
+        public String getAccessibleName() {
  382
+            // Icon has a name and it will be read by the reader
  383
+            return _label;
  384
+        }
  385
+
  386
+        /**
  387
+         * @see AccessibleContext#getAccessibleParent()
  388
+         */
  389
+        public AccessibleContext getAccessibleParent() {
  390
+            // Icon toolbar contains the icon
  391
+            return IconToolbarComponent.this;
  392
+        }
  393
+
  394
+        /**
  395
+         * @see AccessibleContext#getAccessibleRole()
  396
+         */
  397
+        public int getAccessibleRole() {
  398
+            return AccessibleRole.ICON;
  399
+        }
  400
+
  401
+        /**
  402
+         * @see AccessibleContext#getAccessibleChildAt(int)
  403
+         */
  404
+        public AccessibleContext getAccessibleChildAt(final int index) {
  405
+            // Icon contains no children
  406
+            return null;
  407
+        }
  408
+
  409
+        /**
  410
+         * @see AccessibleContext#getAccessibleChildCount()
  411
+         */
  412
+        public int getAccessibleChildCount() {
  413
+            // Icon contains no children
  414
+            return 0;
  415
+        }
  416
+
  417
+        /**
  418
+         * @see AccessibleContext#getAccessibleSelectionAt(int)
  419
+         */
  420
+        public AccessibleContext getAccessibleSelectionAt(final int index) {
  421
+            // Icon contains no children
  422
+            return null;
  423
+        }
  424
+
  425
+        /**
  426
+         * @see AccessibleContext#getAccessibleSelectionCount()
  427
+         */
  428
+        public int getAccessibleSelectionCount() {
  429
+            // Icon contains no children.
  430
+            return 0;
  431
+        }
  432
+
  433
+        /**
  434
+         * @see AccessibleContext#getAccessibleStateSet()
  435
+         */
  436
+        public int getAccessibleStateSet() {
  437
+            return _state;
  438
+        }
  439
+
  440
+        /**
  441
+         * @see AccessibleContext#getAccessibleTable()
  442
+         */
  443
+        public AccessibleTable getAccessibleTable() {
  444
+            // This is an icon, not a table
  445
+            return null;
  446
+        }
  447
+
  448
+        /**
  449
+         * @see AccessibleContext#getAccessibleText()
  450
+         */
  451
+        public AccessibleText getAccessibleText() {
  452
+            // This is an icon, not text
  453
+            return null;
  454
+        }
  455
+
  456
+        /**
  457
+         * @see AccessibleContext#getAccessibleValue()
  458
+         */
  459
+        public AccessibleValue getAccessibleValue() {
  460
+            // Icon contains no numerical values
  461
+            return null;
  462
+        }
  463
+
  464
+        /**
  465
+         * @see AccessibleContext#isAccessibleChildSelected(int)
  466
+         */
  467
+        public boolean isAccessibleChildSelected(final int index) {
  468
+            // Icon contains no children
  469
+            return false;
  470
+        }
  471
+
  472
+        /**
  473
+         * @see AccessibleContext#isAccessibleStateSet(int)
  474
+         */
  475
+        public boolean isAccessibleStateSet(final int state) {
  476
+            return (getAccessibleStateSet() & state) != 0;
  477
+        }
  478
+
  479
+        /**
  480
+         * Called when the icon gains or loses focus
  481
+         * 
  482
+         * @param focusGained
  483
+         *            True if focus gained, false if focus lost
  484
+         */
  485
+        private void focusChanged(final boolean focusGained) {
  486
+            // Update state
  487
+            final int initialState = _state;
  488
+            if (focusGained) {
  489
+                _state |= AccessibleState.FOCUSED;
  490
+            } else {
  491
+                _state &= ~AccessibleState.FOCUSED;
  492
+            }
  493
+
  494
+            // Notify screen reader if component is visible
  495
+            final int currentState = _state;
  496
+            if (initialState != currentState && isVisible()) {
  497
+                AccessibleEventDispatcher.dispatchAccessibleEvent(
  498
+                        AccessibleContext.ACCESSIBLE_STATE_CHANGED,
  499
+                        new Integer(initialState), new Integer(currentState),
  500
+                        this);
  501
+            }
  502
+        }
  503
+    }
  504
+}
419  com/rim/samples/device/accessibilitydemo/customcomponentsdemo/TableComponent.java