Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

How to use javascript Uint8array as parameter of ace.Native.Invoke helper #76

Open
airomyas opened this issue Mar 24, 2017 · 0 comments

Comments

@airomyas
Copy link

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant