Skip to content

Commit

Permalink
Added license headers, Updated README, replaced HTML5 logo
Browse files Browse the repository at this point in the history
  • Loading branch information
haahmad committed Jul 13, 2012
1 parent b46d256 commit a139da1
Show file tree
Hide file tree
Showing 13 changed files with 133 additions and 6 deletions.
46 changes: 46 additions & 0 deletions invoke/README.md
@@ -0,0 +1,46 @@
# blackberry.invoke Sample Application

Sample applications that demonstrate how to use the blackberry.invoke API for the Blackberry 10 WebWorks SDK

**Tested On**

* BlackBerry 10.0.6 Bundle 363

**Author(s)**

* [Hasan Ahmad](https://github.com/haahmad)

**Dependencies**

1. [jquery.mobile-1.1.0.min.js, jquery.mobile-1.1.0.min.css, jquery-1.7.1.min.js ] The jQuery Project


**To contribute code to this repository you must be [signed up as an official contributor](http://blackberry.github.com/howToContribute.html).**

## How to Build

1. Clone the repo to your local machine
2. Use Using the **[Ripple Mobile Emulator](http://developer.blackberry.com/html5/download)** and either the **[BlackBerry WebWorks SDK for Smartphone](http://developer.blackberry.com/html5/download)** or the **[BlackBerry WebWorks SDK for Tablet OS](http://developer.blackberry.com/html5/download)**, package the contents of your local **BB10-WebWorks-Samples/invoke/invoker** and **BB10-WebWorks-Samples/invoke/invokable** folders into a BlackBerry application.

## Troubleshooting

## More Info

* [BlackBerry HTML5 WebWorks](https://bdsc.webapps.blackberry.com/html5/) - Downloads, Getting Started guides, samples, code signing keys.
* [BlackBerry WebWorks Development Guides] (https://bdsc.webapps.blackberry.com/html5/documentation)
* [BlackBerry WebWorks Community Forums](http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/bd-p/browser_dev)
* [BlackBerry Open Source WebWorks Contributions Forums](http://supportforums.blackberry.com/t5/BlackBerry-WebWorks/bd-p/ww_con)

## Contributing Changes

Please see the [README](https://github.com/blackberry/WebWorks-Samples) of the WebWorks-Samples repository for instructions on how to add new Samples or make modifications to existing Samples.


## Bug Reporting and Feature Requests

If you find a bug in a Sample, or have an enhancement request, simply file an [Issue](https://github.com/blackberry/WebWorks-Samples/issues) 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](https://github.com/blackberry/WebWorks-Samples/issues).


## Disclaimer

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.
16 changes: 16 additions & 0 deletions invoke/invokable/config.xml
@@ -1,4 +1,20 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2010-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.
-->

<widget xmlns=" http://www.w3.org/ns/widgets" <widget xmlns=" http://www.w3.org/ns/widgets"
xmlns:rim="http://www.blackberry.com/ns/widgets" xmlns:rim="http://www.blackberry.com/ns/widgets"
version="1.0.0" version="1.0.0"
Expand Down
Binary file modified invoke/invokable/device/invokable.bar
Binary file not shown.
16 changes: 16 additions & 0 deletions invoke/invokable/index.html
@@ -1,4 +1,20 @@
<!DOCTYPE html> <!DOCTYPE html>
<!--
* Copyright 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.
-->

<html> <html>
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
Expand Down
Binary file modified invoke/invokable/invokable.zip
Binary file not shown.
Binary file modified invoke/invokable/simulator/invokable.bar
Binary file not shown.
16 changes: 16 additions & 0 deletions invoke/invoker/config.xml
@@ -1,4 +1,20 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2010-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.
-->

<widget xmlns=" http://www.w3.org/ns/widgets" <widget xmlns=" http://www.w3.org/ns/widgets"
xmlns:rim="http://www.blackberry.com/ns/widgets" xmlns:rim="http://www.blackberry.com/ns/widgets"
version="1.0.0.6" version="1.0.0.6"
Expand Down
Binary file modified invoke/invoker/device/invoker.bar
Binary file not shown.
18 changes: 17 additions & 1 deletion invoke/invoker/index.html
@@ -1,7 +1,23 @@
<!DOCTYPE html> <!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> <html>
<head> <head>
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<script src="webworks-1.0.0.7.js"></script> <script src="webworks-1.0.0.7.js"></script>
<script src="invocations.js"></script> <script src="invocations.js"></script>
<link rel="stylesheet" type="text/css" href="jquery/jquery.mobile-1.1.0.min.css" /> <link rel="stylesheet" type="text/css" href="jquery/jquery.mobile-1.1.0.min.css" />
Expand Down
27 changes: 22 additions & 5 deletions invoke/invoker/invocations.js
@@ -1,3 +1,20 @@
/*
* 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.
*/


function onSuccess() { function onSuccess() {
document.getElementById("log").innerHTML += "<p>Invocation sucessful</p>"; document.getElementById("log").innerHTML += "<p>Invocation sucessful</p>";
} }
Expand Down Expand Up @@ -55,21 +72,21 @@ function invokePictures() {
downloadPicture(); downloadPicture();


blackberry.invoke.invoke({ blackberry.invoke.invoke({
uri: "file:///accounts/1000/shared/downloads/HTML5_Logo_512.png", uri: "file:///accounts/1000/shared/downloads/rim_logo_black.jpg",
}, onSuccess, onError); }, onSuccess, onError);
} }


//Supported in HTML5: getting binary data from XHR request //Supported in HTML5: getting binary data from XHR request
function downloadPicture() { function downloadPicture() {
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.open('GET', "/HTML5_Logo_512.png", true); xhr.open('GET', "/rim_logo_black.jpg", true);
xhr.responseType = 'arraybuffer'; xhr.responseType = 'arraybuffer';


xhr.onload = function(e) { xhr.onload = function(e) {
if (this.status == 200) { if (this.status == 200) {
var bb = new window.WebKitBlobBuilder(); var bb = new window.WebKitBlobBuilder();
bb.append(this.response); bb.append(this.response);
var blob = bb.getBlob('image/png'); var blob = bb.getBlob('image/jpeg');
saveFile(blob); saveFile(blob);
} }
}; };
Expand All @@ -79,7 +96,7 @@ function downloadPicture() {
//This function demonstrates how to use the HTML5 FileSystem API: a .png blob is saved to a URI which is used for invocation //This function demonstrates how to use the HTML5 FileSystem API: a .png blob is saved to a URI which is used for invocation
function saveFile (blob) { function saveFile (blob) {
function gotFs(fs) { function gotFs(fs) {
fs.root.getFile("/accounts/1000/shared/downloads/HTML5_Logo_512.png", {create: true}, gotFile, errorHandler); fs.root.getFile("/accounts/1000/shared/downloads/rim_logo_black.jpg", {create: true}, gotFile, errorHandler);
} }


function gotFile(fileEntry) { function gotFile(fileEntry) {
Expand All @@ -88,7 +105,7 @@ function saveFile (blob) {


function gotWriter(fileWriter) { function gotWriter(fileWriter) {
fileWriter.onerror = function (e) { fileWriter.onerror = function (e) {
alert("Failed to write PNG: " + e.toString()); alert("Failed to write JPEG: " + e.toString());
} }
fileWriter.write(blob); fileWriter.write(blob);
} }
Expand Down
Binary file modified invoke/invoker/invoker.zip
Binary file not shown.
Binary file added invoke/invoker/rim_logo_black.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified invoke/invoker/simulator/invoker.bar
Binary file not shown.

0 comments on commit a139da1

Please sign in to comment.