mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 15:12:51 +08:00
Set default camera image to base64. Add comments.
This commit is contained in:
parent
d39781f3fb
commit
5d83a44ec3
@ -25,7 +25,7 @@ public class CameraLauncher extends ActivityResultModule {
|
|||||||
|
|
||||||
private int mQuality; // Compression quality hint (0-100: 0=low quality & high compression, 100=compress of max quality)
|
private int mQuality; // Compression quality hint (0-100: 0=low quality & high compression, 100=compress of max quality)
|
||||||
private Uri imageUri; // Uri of captured image
|
private Uri imageUri; // Uri of captured image
|
||||||
private boolean base64 = false;
|
private boolean base64 = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
@ -36,6 +36,20 @@ public class CameraLauncher extends ActivityResultModule {
|
|||||||
public CameraLauncher(WebView view, DroidGap gap) {
|
public CameraLauncher(WebView view, DroidGap gap) {
|
||||||
super(view, gap);
|
super(view, gap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the type of data to return. The data can either be returned
|
||||||
|
* as a base64 string or a URI that points to the file.
|
||||||
|
* To display base64 string in an img tag, set the source to:
|
||||||
|
* img.src="data:image/jpeg;base64,"+result;
|
||||||
|
* or to display URI in an img tag
|
||||||
|
* img.src=result;
|
||||||
|
*
|
||||||
|
* @param b T=return base64 string (default), F=return URI
|
||||||
|
*/
|
||||||
|
public void setBase64(boolean b) {
|
||||||
|
this.base64 = b;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Take a picture with the camera.
|
* Take a picture with the camera.
|
||||||
|
@ -71,6 +71,7 @@ import android.widget.LinearLayout;
|
|||||||
* @Override
|
* @Override
|
||||||
* public void onCreate(Bundle savedInstanceState) {
|
* public void onCreate(Bundle savedInstanceState) {
|
||||||
* super.onCreate(savedInstanceState);
|
* super.onCreate(savedInstanceState);
|
||||||
|
* super.addModule("com.phonegap.examples.MyModule", "MyModule");
|
||||||
* super.loadUrl("file:///android_asset/www/index.html");
|
* super.loadUrl("file:///android_asset/www/index.html");
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
|
@ -48,7 +48,6 @@ public abstract class Module {
|
|||||||
* @param message
|
* @param message
|
||||||
*/
|
*/
|
||||||
public void sendJavascript(String statement) {
|
public void sendJavascript(String statement) {
|
||||||
System.out.println("Module.sendResponse("+statement+")");
|
|
||||||
this.gap.callbackServer.sendJavascript(statement);
|
this.gap.callbackServer.sendJavascript(statement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user