Skip to content

Loading…

Adds invoke-card sample. #20

Merged
merged 1 commit into from

2 participants

@nukulb

OSS has been completed

@pelegri

Sounds good.

NOte we just started a new repository for presentations. Its all OK to not have the source there, but we would like to have a pointer from that repo to here.

Check http://github.com/blackberry/Presentations Look at the BBJam and at the section for Camera (I created that one for Sean). You should create a directory for JAM39 and link from thre to here.

@pelegri pelegri merged commit a5bc254 into blackberry:master
@nukulb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 11, 2012
  1. @nukulb

    Adds invoke-card sample.

    nukulb committed
This page is out of date. Refresh to see the latest.
Showing with 607 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +1 −0 invoke-card/App/BlackBerry-JQM-all.min.css
  3. +1 −0 invoke-card/App/BlackBerry-JQM-all.min.js
  4. +22 −0 invoke-card/App/config.xml
  5. BIN invoke-card/App/img/img1.jpg
  6. +113 −0 invoke-card/App/index.htm
  7. +1 −0 invoke-card/Card/BlackBerry-JQM-all.min.css
  8. +1 −0 invoke-card/Card/BlackBerry-JQM-all.min.js
  9. +32 −0 invoke-card/Card/config.xml
  10. BIN invoke-card/Card/images_bb/core_actionbar.png
  11. BIN invoke-card/Card/images_bb/core_actionbar_action_pressed.png
  12. BIN invoke-card/Card/images_bb/core_actionbar_back.png
  13. BIN invoke-card/Card/images_bb/core_actionbar_back_pressed.png
  14. BIN invoke-card/Card/images_bb/core_actionbar_cut_mod.png
  15. BIN invoke-card/Card/images_bb/core_actionbar_icon_actionoverflow.png
  16. BIN invoke-card/Card/images_bb/core_actionbar_icon_actionoverflow_pressed.png
  17. BIN invoke-card/Card/images_bb/core_actionbar_icon_back.png
  18. BIN invoke-card/Card/images_bb/core_actionbar_icon_back_mirrored_pressed.png
  19. BIN invoke-card/Card/images_bb/core_actionbar_icon_back_pressed.png
  20. BIN invoke-card/Card/images_bb/core_actionbar_icon_mirrored_back.png
  21. BIN invoke-card/Card/images_bb/core_actionbar_shadow.png
  22. BIN invoke-card/Card/images_bb/core_actionbar_tab_action_shadow.png
  23. BIN invoke-card/Card/images_bb/core_actionbar_tab_action_shadowright.png
  24. BIN invoke-card/Card/images_bb/core_actionbar_tab_active.png
  25. BIN invoke-card/Card/images_bb/core_actionbar_tab_icon_taboverflow.png
  26. BIN invoke-card/Card/images_bb/core_actionbar_tab_inactive.png
  27. BIN invoke-card/Card/images_bb/core_actionbar_tab_shadow.png
  28. BIN invoke-card/Card/images_bb/core_actionbar_tab_shadowleft.png
  29. BIN invoke-card/Card/images_bb/core_actionbar_tab_shadowright.png
  30. BIN invoke-card/Card/images_bb/core_activityindicator_bg_large.png
  31. BIN invoke-card/Card/images_bb/core_activityindicator_bg_large_dark.png
  32. BIN invoke-card/Card/images_bb/core_activityindicator_bg_medium.png
  33. BIN invoke-card/Card/images_bb/core_activityindicator_bg_medium_dark.png
  34. BIN invoke-card/Card/images_bb/core_activityindicator_bg_small.png
  35. BIN invoke-card/Card/images_bb/core_activityindicator_bg_small_dark.png
  36. BIN invoke-card/Card/images_bb/core_activityindicator_swirl_large.png
  37. BIN invoke-card/Card/images_bb/core_activityindicator_swirl_medium.png
  38. BIN invoke-card/Card/images_bb/core_activityindicator_swirl_small.png
  39. BIN invoke-card/Card/images_bb/core_checkbox_active.png
  40. BIN invoke-card/Card/images_bb/core_checkbox_active_mark.png
  41. BIN invoke-card/Card/images_bb/core_checkbox_disabled.png
  42. BIN invoke-card/Card/images_bb/core_checkbox_disabled_mark.png
  43. BIN invoke-card/Card/images_bb/core_checkbox_inactive.png
  44. BIN invoke-card/Card/images_bb/core_checkbox_pressed.png
  45. BIN invoke-card/Card/images_bb/core_container.png
  46. BIN invoke-card/Card/images_bb/core_container_dark.png
  47. BIN invoke-card/Card/images_bb/core_crosscutmenu_bg.png
  48. BIN invoke-card/Card/images_bb/core_crosscutmenu_selected.png
  49. BIN invoke-card/Card/images_bb/core_divider_gradient.png
  50. BIN invoke-card/Card/images_bb/core_divider_gradient_dark.png
  51. BIN invoke-card/Card/images_bb/core_divider_group.png
  52. BIN invoke-card/Card/images_bb/core_divider_group_dark.png
  53. BIN invoke-card/Card/images_bb/core_radiobutton_active.png
  54. BIN invoke-card/Card/images_bb/core_radiobutton_active_mark.png
  55. BIN invoke-card/Card/images_bb/core_radiobutton_disabled.png
  56. BIN invoke-card/Card/images_bb/core_radiobutton_disabled_active.png
  57. BIN invoke-card/Card/images_bb/core_radiobutton_inactive.png
  58. BIN invoke-card/Card/images_bb/core_radiobutton_pressed.png
  59. BIN invoke-card/Card/images_bb/core_textinput_icon_delete.png
  60. BIN invoke-card/Card/images_bb/core_textinput_icon_delete_pressed.png
  61. BIN invoke-card/Card/images_bb/core_title_bar.png
  62. BIN invoke-card/Card/images_bb/core_title_bar_shadow.png
  63. BIN invoke-card/Card/images_bb/core_title_bar_shadow_flipped.png
  64. BIN invoke-card/Card/images_bb/core_titlebar_dark.png
  65. BIN invoke-card/Card/images_bb/core_titlebar_shadow_dark.png
  66. BIN invoke-card/Card/images_bb/core_titlebar_shadow_dark_flipped.png
  67. BIN invoke-card/Card/images_bb/forward.png
  68. BIN invoke-card/Card/images_bb/generic_81_81_placeholder.png
  69. BIN invoke-card/Card/images_bb/icons-18-black.png
  70. BIN invoke-card/Card/images_bb/icons-18-white.png
  71. BIN invoke-card/Card/images_bb/icons-36-black.png
  72. BIN invoke-card/Card/images_bb/icons-36-white.png
  73. BIN invoke-card/Card/images_bb/icons-71-black.png
  74. BIN invoke-card/Card/images_bb/icons-71-white.png
  75. BIN invoke-card/Card/images_bb/input_error.png
  76. BIN invoke-card/Card/images_bb/input_validation.png
  77. BIN invoke-card/Card/images_bb/moat.png
  78. BIN invoke-card/Card/images_bb/refresh.png
  79. BIN invoke-card/Card/images_bb/search.png
  80. BIN invoke-card/Card/images_bb/share.png
  81. BIN invoke-card/Card/images_bb/site_info.png
  82. BIN invoke-card/Card/img/generic_81_81_placeholder.png
  83. BIN invoke-card/Card/img/share.png
  84. +138 −0 invoke-card/Card/index.htm
  85. BIN invoke-card/JAM39_Bhasin.pptx
  86. +243 −0 invoke-card/LICENSE
  87. +18 −0 invoke-card/NOTICE
  88. +35 −0 invoke-card/README.md
View
2 .gitignore
@@ -0,0 +1,2 @@
+add
+.DS_Store
View
1 invoke-card/App/BlackBerry-JQM-all.min.css
1 addition, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
1 invoke-card/App/BlackBerry-JQM-all.min.js
1 addition, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
22 invoke-card/App/config.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<widget xmlns="http://www.w3.org/ns/widgets"
+ xmlns:rim="http://www.blackberry.com/ns/widgets"
+ version="1.0.0"
+ id="InvokeCard">
+ <name>InvokeCard</name>
+ <content src="index.htm"/>
+ <author>self</author>
+ <description>This app tests the invoke API.</description>
+ <feature id="blackberry.invoke" required="true" version="1.0.0.0"/>
+ <feature id="blackberry.invoke.card" required="true" version="1.0.0.0"/>
+ <feature id="blackberry.invoked" required="true" version="1.0.0.0"/>
+ <feature id="blackberry.app.orientation">
+ <param name="mode" value="portrait"/>
+ </feature>
+ <access uri="*"/>
+ <license href="http://www.apache.org/licenses/LICENSE-2.0">My License</license>
+
+ <rim:permissions>
+ <rim:permit>access_shared</rim:permit>
+ </rim:permissions>
+</widget>
View
BIN invoke-card/App/img/img1.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
113 invoke-card/App/index.htm
@@ -0,0 +1,113 @@
+<html>
+ <head>
+ <title>Invoke API</title>
+
+ <link rel="stylesheet" href="BlackBerry-JQM-all.min.css" />
+ <script src="BlackBerry-JQM-all.min.js"></script>
+
+ <script type="text/javascript" src="webworks-1.0.0.7.js"></script>
+ <script>
+ function onInvokeSuccess() {
+ console.log("Invocation successful!");
+ }
+
+ function onInvokeError(error) {
+ console.log("Invocation failed, error: " + error);
+ }
+
+ function invokeBrowser() {
+ // invoke web link - allows the system to choose an appropriate target that handles http://
+ blackberry.invoke.invoke({
+ uri: "http://www.blackberry.com"
+ }, onInvokeSuccess, onInvokeError);
+ }
+
+ function invokePictureViewer() {
+ // invoking Card is the same as invoking an application, except the target specified should point to the "Card" target entry point
+ blackberry.invoke.invoke({
+ action: "bb.action.VIEW",
+ uri : "local:///img/img1.jpg",
+ file_transfer_mode : blackberry.invoke.FILE_TRANSFER_COPY_RO
+ }, onInvokeSuccess, onInvokeError);
+ }
+
+ function boundInvokeCard() {
+ blackberry.invoke.invoke({
+ target: "picture.card",
+ action: "bb.action.VIEW",
+ type: "text/plain",
+ uri : "local:///img/img1.jpg"
+ }, onInvokeSuccess, onInvokeError);
+
+ blackberry.event.addEventListener('onChildCardClosed', function (info) {
+ console.log("Card was closed");
+ });
+ }
+ function boundInvokeCard2() {
+ blackberry.invoke.invoke({
+ target: "net.rim.webworks.invoke.invoke.card.type",
+ action: "bb.action.VIEW",
+ type: "text/plain"
+ }, onInvokeSuccess, onInvokeError);
+
+ blackberry.event.addEventListener('onChildCardClosed', function (info) {
+ console.log("Card was closed");
+ });
+ }
+
+ function invokeCamera() {
+ var mode = blackberry.invoke.card.CAMERA_MODE_PHOTO;
+ blackberry.invoke.card.invokeCamera(mode, function (path) {
+ console.log("saved "+ path);
+ },
+ function (reason) {
+ console.log("cancelled " + reason);
+ },
+ function (error) {
+ if (error) {
+ console.log("invoke error "+ error);
+ } else {
+ console.log("invoke success " );
+ }
+ });
+ }
+
+ function invokeFilePicker() {
+ var details = {
+ mode: blackberry.invoke.card.FILEPICKER_MODE_PICKER,
+ type: [blackberry.invoke.card.FILEPICKER_TYPE_PICTURE, blackberry.invoke.card.FILEPICKER_TYPE_MUSIC]
+ };
+ blackberry.invoke.card.invokeFilePicker(details, function (path) {
+ console.log("saved "+ path);
+ },
+ function (reason) {
+ console.log("cancelled " + reason);
+ },
+ function (error) {
+ if (error) {
+ console.log("invoke error "+ error);
+ } else {
+ console.log("invoke success " );
+ }
+ }
+ );
+ }
+ </script>
+ </head>
+ <body>
+ <div data-role="page">
+ <div data-role="header" data-theme="c" data-position="fixed">
+ <h1>Invoke Demo</h1>
+ </div>
+ <div data-role="content">
+ <ul data-role="listview">
+ <li><a href="#" onclick="boundInvokeCard()">Invoke Bound card</a></li>
+ <li><a href="#" onclick="invokeBrowser()">Invoke Browser</a></li>
+ <li><a href="#" onclick="invokePictureViewer()">Invoke Picture viewer</a></li>
+ <li><a href="#" onclick="invokeCamera()">Invoke Camera</a></li>
+ <li><a href="#" onclick="invokeFilePicker()">Invoke File Picker</a></li>
+ </ul>
+ </div>
+ </div><!--page-->
+ </body>
+</html>
View
1 invoke-card/Card/BlackBerry-JQM-all.min.css
1 addition, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
1 invoke-card/Card/BlackBerry-JQM-all.min.js
1 addition, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
32 invoke-card/Card/config.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<widget xmlns="http://www.w3.org/ns/widgets"
+ xmlns:rim="http://www.blackberry.com/ns/widgets"
+ version="1.2.3"
+ id="CardType">
+ <name>TheCard</name>
+ <content src="index.htm"/>
+ <author href="http://www.rim.com/"
+ rim:copyright="no copyright, go nuts!"
+ email = "email@rim.com">self
+ </author>
+ <description>This app tests invocation</description>
+ <access uri="*" />
+ <feature id="blackberry.invoke" />
+ <feature id="blackberry.app.orientation">
+ <param name="mode" value="portrait"/>
+ </feature>
+ <access uri="*" />
+ <feature id="blackberry.invoked" />
+ <license href="http://www.apache.org/licenses/LICENSE-2.0">My License</license>
+ <rim:invoke-target id="picture.card">
+ <type>card.previewer</type>
+ <filter>
+ <action>bb.action.VIEW</action>
+ <mime-type>image/*</mime-type>
+ </filter>
+ </rim:invoke-target>
+ <rim:permissions>
+ <rim:permit>use_camera</rim:permit>
+ <rim:permit>access_shared</rim:permit>
+ </rim:permissions>
+</widget>
View
BIN invoke-card/Card/images_bb/core_actionbar.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN invoke-card/Card/images_bb/core_actionbar_action_pressed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN invoke-card/Card/images_bb/core_actionbar_back.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN invoke-card/Card/images_bb/core_actionbar_back_pressed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN invoke-card/Card/images_bb/core_actionbar_cut_mod.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN invoke-card/Card/images_bb/core_actionbar_icon_actionoverflow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN invoke-card/Card/images_bb/core_actionbar_icon_actionoverflow_pressed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN invoke-card/Card/images_bb/core_actionbar_icon_back.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN invoke-card/Card/images_bb/core_actionbar_icon_back_mirrored_pressed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN invoke-card/Card/images_bb/core_actionbar_icon_back_pressed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN invoke-card/Card/images_bb/core_actionbar_icon_mirrored_back.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN invoke-card/Card/images_bb/core_actionbar_shadow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN invoke-card/Card/images_bb/core_actionbar_tab_action_shadow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN invoke-card/Card/images_bb/core_actionbar_tab_action_shadowright.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN invoke-card/Card/images_bb/core_actionbar_tab_active.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN invoke-card/Card/images_bb/core_actionbar_tab_icon_taboverflow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN invoke-card/Card/images_bb/core_actionbar_tab_inactive.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN invoke-card/Card/images_bb/core_actionbar_tab_shadow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN invoke-card/Card/images_bb/core_actionbar_tab_shadowleft.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN invoke-card/Card/images_bb/core_actionbar_tab_shadowright.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN invoke-card/Card/images_bb/core_activityindicator_bg_large.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN invoke-card/Card/images_bb/core_activityindicator_bg_large_dark.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN invoke-card/Card/images_bb/core_activityindicator_bg_medium.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN invoke-card/Card/images_bb/core_activityindicator_bg_medium_dark.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN invoke-card/Card/images_bb/core_activityindicator_bg_small.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_activityindicator_bg_small_dark.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_activityindicator_swirl_large.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_activityindicator_swirl_medium.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_activityindicator_swirl_small.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_checkbox_active.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_checkbox_active_mark.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_checkbox_disabled.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_checkbox_disabled_mark.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_checkbox_inactive.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_checkbox_pressed.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_container.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_container_dark.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_crosscutmenu_bg.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_crosscutmenu_selected.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_divider_gradient.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_divider_gradient_dark.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_divider_group.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_divider_group_dark.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_radiobutton_active.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_radiobutton_active_mark.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_radiobutton_disabled.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_radiobutton_disabled_active.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_radiobutton_inactive.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_radiobutton_pressed.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_textinput_icon_delete.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_textinput_icon_delete_pressed.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_title_bar.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_title_bar_shadow.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_title_bar_shadow_flipped.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_titlebar_dark.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_titlebar_shadow_dark.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/core_titlebar_shadow_dark_flipped.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/forward.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/generic_81_81_placeholder.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/icons-18-black.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/icons-18-white.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/icons-36-black.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/icons-36-white.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/icons-71-black.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/icons-71-white.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/input_error.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/input_validation.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/moat.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/refresh.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/search.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/share.png
Diff not rendered.
View
BIN invoke-card/Card/images_bb/site_info.png
Diff not rendered.
View
BIN invoke-card/Card/img/generic_81_81_placeholder.png
Diff not rendered.
View
BIN invoke-card/Card/img/share.png
Diff not rendered.
View
138 invoke-card/Card/index.htm
@@ -0,0 +1,138 @@
+<!DOCTYPE HTML>
+<!--
+* Copyright 2012 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.
+-->
+
+<html>
+ <head>
+ <meta charset="utf-8">
+
+ <title>Action Bar</title>
+ <link rel="stylesheet" href="BlackBerry-JQM-all.min.css" />
+ <script src="webworks-1.0.0.7.js" type="text/javascript"></script>
+ <script src="BlackBerry-JQM-all.min.js"></script>
+ <script>
+
+ function ready() {
+
+ blackberry.event.addEventListener("invoked", function (onInvokedInfo) {
+ var obj = document.getElementById('image');
+ obj.src = onInvokedInfo.uri;
+ });
+ findShareTargets();
+
+ }
+ window.addEventListener("load", function(e) {
+ document.addEventListener("webworksready", ready);
+ }, false);
+
+
+ function findShareTargets() {
+
+ var request = {
+ action: 'bb.action.SHARE',
+ type: 'image/*',
+ target_type: ["APPLICATION", "CARD"]
+ };
+
+ blackberry.invoke.query(request, function (response) {
+ console.log(response);
+ onSuccessfulFindTargets(response[0].targets)
+ }, function () {
+
+ });
+ }
+
+ function onSuccessfulFindTargets(items) {
+ var list = "";
+ for(var i = 0; i < items.length; i++) {
+ list += '<li><a href="#"><img src="file://'+ items[i].icon + '">' + items[i].label + '</a></li>';
+ }
+ $("#share-items").html(list).listveiw();
+ }
+
+
+ $(document).bind('pageinit', function(){
+ $("#action-back").bind( "vclick", function() {
+ console.log("back close")
+ blackberry.invoked.cardRequestClosure({
+ reason: "back"
+ });
+ });
+
+ $("#action-share").bind( "vclick", function() {
+ console.log($("#sharePage"));
+ $.mobile.changePage( $("#sharePage"), {transition: "slideup"});
+ });
+
+ });
+
+
+ </script>
+
+ <style>
+ .center {top:50%; margin-top:260px; /* negative half of the height */}
+ .peek-area {width:10%; height:100%; position:fixed; top:0; left:0;}
+ </style>
+ </head>
+ <body>
+ <div id="page" data-role="page" data-theme="a">
+ <div id ="content" data-role="content">
+
+ <div data-role="gridview">
+ <div data-role="row">
+ <div class="center">
+ <img id="image" alt="" />
+ </div>
+ </div>
+ </div>
+ <div id="peek-area" class="peek-area">
+ </div>
+
+ </div><!-- /content -->
+
+ <div data-role="footer" data-position="fixed">
+ <div id="action-bar-area" data-role="actionbar">
+ <div id= "action-back" data-role="back"></div>
+ <div id="action-share" data-role="action">
+ <img src="img/share.png" alt="" />
+ <p>Share</p>
+ </div>
+ </div>
+ </div>
+ </div><!-- /page -->
+
+ <div id="sharePage" data-role="page" data-dom-cache="true" data-theme="a">
+ <div data-role="header">
+ <a href="#page" data-role="button" data-rel="back">Cancel</a>
+ <h1>Share</h1>
+ </div>
+ <div data-role="content">
+ <ul id="share-items" data-role="listview">
+ </ul>
+ </div>
+ </div><!-- /page -->
+
+
+ <script>
+ var obj = document.getElementById('peek-area');
+ obj.addEventListener('touchstart', function(event) {
+ console.log("peeking")
+ blackberry.invoked.cardStartPeek("root");
+ }, false);
+ </script>
+
+ </body>
+</html>
View
BIN invoke-card/JAM39_Bhasin.pptx
Binary file not shown.
View
243 invoke-card/LICENSE
@@ -0,0 +1,243 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
+
+ ==========================================================
+ Jquery
+ ==========================================================
+
+ Copyright 2011, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+
+
+ ==========================================================
+ Sizzle.js
+ ==========================================================
+
+ Copyright 2011, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+
+ ==========================================================
+ Jquery Mobile
+ ==========================================================
+
+ Copyright 2012 jQuery Foundation and other contributors
+ http://jquery.com/
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
18 invoke-card/NOTICE
@@ -0,0 +1,18 @@
+BlackBerry 10 - jQuery Mobile Theme
+Copyright (c) 2012 Research In Motion Limited.
+
+This software includes software developed at
+Research In Motion Limited
+http://www.rim.com/
+
+This software includes jQuery
+Copyright 2011, John Resig
+http://jquery.com
+
+This software includes Sizzle.js
+Copyright 2011, The Dojo Foundation
+http://sizzlejs.com
+
+This software includes the jQuery Mobile Framework
+Copyright 2011 (c) jQuery Project
+http://jquerymobile.com
View
35 invoke-card/README.md
@@ -0,0 +1,35 @@
+This example shows invoking variety of cards like the camera, filePicker, picture Viewer, and a custom card.
+This example also shows how to expose your app as a card.
+
+# Using this example
+### Build the App
+1. Copy the webworks.js file from the WebWorks SDK into this project.
+2. In the App/index.html file please change the webworks.js script tag to match the exact version.
+3. Zip the contents of the App folder such that the config.xml is in the root.
+4. Use the WebWorks packager to package a bar and deploy it to the simulator or BB10 device.
+
+### Build the card
+
+1. Copy the webworks.js file from the WebWorks SDK into this project.
+2. In the Card/index.html file please change the webworks.js script tag to match the exact version.
+3. Zip the contents of the Card folder such that the config.xml is in the root.
+4. Use the WebWorks packager to package a bar and deploy it to the simulator or BB10 device.
+
+### Deploy both the apps to the device or simulator.
+### Open the App and click on Invoke Bound Card to invoke the custom card with an image that is bundled in this app.
+
+More details can be found in the Jam39.pptx that is
+
+## Licenses
+
+### Images used for this example
+The image file under App/img/img1.jpg is licensed under public domain and was download from here-
+http://www.publicdomainpictures.net/view-image.php?image=16513&picture=big-hamburger
+
+This image is public domain. You may use this picture for any purpose, including commercial.
+If you do use it, please consider linking back to us. If you are going to redistribute this image online,
+a hyperlink to this particular page is mandatory.
+
+The images used under Card/images_bb/ and img/ are taken from jQueryMobile-BB10-Theme
+https://github.com/blackberry/jQueryMobile-BB10-Theme
+
Something went wrong with that request. Please try again.