Directory

← Back

phonegap

Basic dependency for Phonegap Addons

Author

Rating

Popularity

<100

This add-on should be used while integrating with PhoneGap by using phonegap-camera add-on.

Sample code

package com.devside.vaadin.example;

import com.vaadin.ui.CustomLayout;
import com.devside.vaadin.addon.pgcamera.PhonegapCamera;
import com.devside.vaadin.addon.phonegap.Phonegap;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.TextField;
import com.vaadin.ui.UI;

public class CamPage extends CustomLayout {

	public CamPage() {
		
		// the Phonegap component should be added in order to include phonegap basic js libraries.
		addComponent(new Phonegap());


		PhonegapCamera camera = new PhonegapCamera();
		camera.getCameraState().setButtonStyle("width:100%");
		camera.getCameraState().setImageStyle("width:95%;");
		// if you want to view the captured image on page this should be true. But some can only get base64 value of image in PictureCaptureListener.
		camera.getCameraState().setViewEnabled(true);
		// if viewEnabled is true, viewImageAfterCapture provides to hide image when there is no source . After capturing image , image on page will be shown.
		camera.getCameraState().setViewImageAfterCapture(true);
		addComponent(camera);
	}

}

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

Released
2013-08-23
Maturity
EXPERIMENTAL
License
Apache License 2.0

Compatibility

Framework
Vaadin 7.0+
Browser
Android Browser

phonegap - Vaadin Add-on Directory

Basic dependency for Phonegap Addons phonegap - Vaadin Add-on Directory
This add-on should be used while integrating with PhoneGap by using phonegap-camera add-on.
Online