mirror of
https://gitee.com/shuto/customCamera.git
synced 2024-10-06 10:22:07 +08:00
Test d'appel de la camera depuis le plugin.
This commit is contained in:
parent
87428ce2b9
commit
3e71ec7b12
@ -21,5 +21,7 @@
|
||||
<config-file target="AndroidManifest.xml" parent="/*">
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
</config-file>
|
||||
|
||||
<source-file src="src/org/geneanet/customCamera/CameraLauncher.java" target-dir="src/org/geneanet/customCamera/CustomCamera" />
|
||||
</platform>
|
||||
</plugin>
|
@ -0,0 +1,17 @@
|
||||
package org.geneanet.customcamera;
|
||||
|
||||
import org.apache.cordova.CordovaPlugin;
|
||||
import org.apache.cordova.CallbackContext;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
public class CameraLauncher extends CordovaPlugin {
|
||||
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
|
||||
Intent intent = new Intent("org.geneanet.customcamera.CameraView");
|
||||
cordova.startActivityForResult((CordovaPlugin) this, intent, 1111111);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@ -15,4 +15,20 @@ customCameraExport.prototype.getPicture = function() {
|
||||
alert("Oh yeah !");
|
||||
};
|
||||
|
||||
customCameraExport.prototype.startCamera = function() {
|
||||
cordova.exec(
|
||||
function(result) {
|
||||
console.log("success");
|
||||
console.log(result);
|
||||
},
|
||||
function(result) {
|
||||
console.log("fail");
|
||||
console.log(result);
|
||||
},
|
||||
"CameraLauncher",
|
||||
"customCamera",
|
||||
[]
|
||||
);
|
||||
};
|
||||
|
||||
module.exports = new customCameraExport();
|
Loading…
Reference in New Issue
Block a user