Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Contributor
nalladivenkat
Posts: 3
Registered: ‎11-01-2011
My Device: Bold

How to read image from camera share folder into Java Script Function in Web Works for PlayBook

How to read image from camera share folder into Java Script Function in Web Works for PlayBook.I am new to PlayBook Developement,I just want to read image taken by camera .I am storing image name into My WebBase DataBase, when displaying time based on that name I am looking over in camera share folder,But I am not able ti display that image on html5.Please Help me Thanks Venkat

 


<!--
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.
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>Crm Page</title>

<link rel="stylesheet" href="common/default.css">
<style>
.Container {
position: relative;
width: 480px;
height: 360px;
margin: 0 auto;
}

.Container div {
width: inherit;
height: inherit;
border: 3px outset #aa7777;
-webkit-border-radius: 23px;
}

.Container img {
width: inherit;
height: inherit;
-webkit-border-radius: 20px;
}

.Form {
background-color: #aaaaaa;
}
</style>
</head>
<body onload=" startapp();">
<h1><a href="crm.html"><img src="images/back_btn.png" style="vertical-align: middle; margin-right: 10px;"></a>Crm Page</h1>

<div style="text-align: center;">
<button onclick="ButtonClickFlip(false)">&lt; Previous</button>&nbsp;&nbsp;&nbsp;
<button onclick="ButtonClickFlip(true)">Next &gt;</button><br><br>
</div>

<div id="CONTAINER_FLIP" class="Container">
<div id="D01"><img ></img></div>
<!--<div id="D01"><img src="common/images/photos/aerogel_flower.jpg"></div>
<div id="D02"><img src="common/images/photos/aurora_borealis.jpg"></div>
<div id="D03"><img src="common/images/photos/buzz_aldrin_moon.jpg"></div>
<div id="D04"><img src="common/images/photos/cartwheel_galaxy.jpg"></div>
<div id="D05"><img src="common/images/photos/earth_western_hemisphere.jpg"></div>
<div id="D06" class="Form">
<table border="0px" align="center">
<tr>
<td><b>Field1</b>:</td>
<td><input type="text"></td>
</tr>
<tr>
<td><b>Field2</b>:</td>
<td><input type="text"></td>
</tr>
<tr>
<td><b>Field3</b>:</td>
<td><input type="text"></td>
</tr>
<tr>
<td align="center" colspan="2"><button onclick="F.setCurrent(0);">Submit</button></td>
</tr>
</table>
</div>
<div><img src="common/images/photos/hurricane_katrina.jpg"></div>-->
</div>

<!-- Feature Sniffer -->
<script type="text/javascript" src="lib/sniffer.js"></script>

<script src="js/src/alice.core.js"></script>
<script src="js/src/alice.flip.js"></script>
<script type="text/javascript">
sniffer.init();

var Flipper = alice.flip("CONTAINER_FLIP", 2000, "ease-in-out", 1500, 1000, 2);

function ButtonClickFlip(Next) {
if (Next == true)
Flipper.next();
else
Flipper.prev();
}

function startapp()
{
var dataset;

alert('storeapp in viewPhotos');
// create/open database
db = window.openDatabase("databasetest", '1.0', 'Test', 50 * 1024);

if (db) {

db.transaction(function (tx) {

tx.executeSql("CREATE TABLE IF NOT EXISTS Images (ID INTEGER PRIMARY KEY AUTOINCREMENT, name text)");

//alert('startApp');
tx.executeSql("SELECT name FROM Images", [], function (ax, results) {
//alert('executeSql');
//Check record. If zero application will not work
alert('length is in viewPhotos '+results.rows.length);

if (results.rows.length>= 1) {
//alert('if loop');
dataset = results.rows;
for (var i = 0, item = null; i < dataset.length; i++) {
item = dataset.item(i);
alert('Image Name in View Photos:'+item['name']);
var img=document.getElementById("D01");
img.src=item['name'];
}
}
else {
alert('No Images Found');

}

});
});
}


}

</script>
</body>
</html>

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: How to read image from camera share folder into Java Script Function in Web Works for PlayBook

This is the NDK forum. You should post your question to the webworks forum.
Please use plain text.