4. One code, deploy to all
JavaScript is cooler everyday
- iPhone 3GS+
- Android Better then web apps
- Blackberry 5+
- WebOS
- Windows Phone 7
- W8 Coming Soon
- Symbian
- Bada
What is PhoneGAP ?
5. One code, deploy to all
JavaScript is cooler everyday
- iPhone 3GS+
- Android Better then web apps
Every day new
- Blackberry 5+ frameworks, new
- WebOS
- Windows Phone 7 cool techniques and
- W8 Coming Soon new technologies
- Symbian rise.
- Bada
What is PhoneGAP ?
6. One code, deploy to all
JavaScript is cooler everyday
- iPhone 3GS+
- Android Better then web apps
Every day new
- Blackberry 5+ frameworks, new
- WebOS
- Windows Phone 7 cool techniques and PhoneGAP allows you
to access the device
- W8 Coming Soon new technologies SDK API
- Symbian rise.
- Bada
What is PhoneGAP ?
10. <script type="text/javascript" charset="utf-8">
var pictureSource; // picture source
var destinationType; // sets the format of returned value
// Wait for PhoneGap to connect with the device
document.addEventListener(“deviceReady",onDeviceReady,false);
// PhoneGap is ready to be used
function onDeviceReady() {
pictureSource=navigator.camera.PictureSourceType;
destinationType=navigator.camera.DestinationType;
}
PhoneGAP API
11. function capturePhoto() {
navigator.camera.getPicture(onPhotoDataSuccess, onFail, {
quality: 50 });
}
//HTML
<button onclick="capturePhoto();">Capture Photo</button>
PhoneGAP API
12. function capturePhotoEdit() {
navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 20,
allowEdit: true });
}
PhoneGAP API
13. function onPhotoDataSuccess(imageData) {
var smallImage = document.getElementById('smallImage');
smallImage.style.display = 'block';
smallImage.src = "data:image/jpeg;base64," + imageData;
}
//HTML
<img style="display:none;width:60px;height:60px;" id="smallImage"
src="" />
PhoneGAP API