fetch arrayBuffer Android
See original GitHub issueTried to fetch a local file into an Array Buffer.
First try with XHR
. iOS: ok - Android: faild.
Second try with fetch
. Same result again.
This is my script error or tabris.js error?
Textscript
var filename = tabris.app.getResourceLocation('src/img/framework7.png');
console.log(filename);
fetch(filename).then(function(response) {
return response.arrayBuffer();
}).catch(function(err) {
console.error(err);
}).then(function(buffer) {
console.log(typeof buffer);
console.log(buffer);
});
Output (iOS, Android)
Issue Analytics
- State:
- Created 6 years ago
- Comments:20 (8 by maintainers)
Top Results From Across the Web
Is there a way to pass an arraybuffer from javascript to java on ...
I have a webview on Android 4.4.3 where I have a webapp who has float32array containing binary data. I would like to pass...
Read more >Response.arrayBuffer() - Web APIs - MDN Web Docs
The arrayBuffer() method of the Response interface takes a Response stream and reads it to completion. It returns a promise that resolves ...
Read more >support ArrayBuffer as fetch body · Issue #9947 - GitHub
Issue Description fetch simply pass an arraryBuffer to XMLHttpRequest as body, ... React Native version: 0.33.0; Platform(s) (iOS, Android, ...
Read more >ByteBuffer | Android Developers
Absolute and relative get and put methods that read and write values of other primitive types, translating them to and from sequences of...
Read more >Body.arrayBuffer() - Web APIs
In our fetch array buffer live, we have a Play button. When pressed, the getData() function is run. Note that before playing full...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@mpost you only get my trouble - but behind: tabris.js really rocks!
@karolszafranski Thanks for this tip! With tonights nightly platform I tested successful to get arrayBuffer, text, json. Thank you! I will close this issue.
By the way: I read about a common method: users always choose response.text and convert the result into required destination type. So they can handle malformed files better - e.g. malformed json.