How to use javascript Uint8array as parameter of ace.Native.Invoke helper
airomyas opened this issue · 0 comments
I'm using cordova file plugin to retrieve a jpg picture from sd card and I need to pass this picture to java side through Ace's native invoker.
Here is part of my code:
javascript side:
fileEntry.file(function (file) {
var reader = new FileReader();
reader.onloadend = function() {
console.log("Successful file read: " + this.result);
var className = ace.valueOn({ android: "videotest.VideoTest"});
ace.NativeObject.invoke(className, "startFull360View", new Uint8Array(this.result), size, index, function(result){});
java side:
public static int startFull360View(byte[] img, int len, int index)
{
LOG.e("Full360View", "size is " + len);
...
When I do this there is no error message appear on the logcat but it doesn't work, Anyone could help?