L
L
lanvin lanvin072016-05-11 13:50:15
Android
lanvin lanvin07, 2016-05-11 13:50:15

Why is the file not saved?

This code:

document.getElementsByTagName('a')[0].onclick = function() {                
  var csv = "A";
  var csvData = 'data:application/csv;charset=utf-8,' + encodeURIComponent(csv);
  this.href = csvData;
  this.target = '_blank';
  this.download = 'filename1.csv';
}

it works in the browser on the desktop, the file is saved, but if you build it in Phonegap and open it locally on Android, then it doesn't.
FileSave
In Opera, I open html on the same tablet with this js inside, a save dialog box appears and the files are saved normally, and if I open the apk application built by Phonegap, then just silence. Links change to visited, but the save dialog doesn't appear.
As I understand it Android renders html+css+js via WebView?
The Phonegap Build project code does not give out, only the finished apk, otherwise it was possible to upload the project to AS and understand the Java code already.
It is clear that apk is just an archive, and I see my js project in the www folder, but I don’t know how to gut classes.dex.
Maybe you can somehow shake out the project from Phonegap Build?
Or send something to console.log to understand at what stage the snag is....
I see csvData in the log when I look at it through ADM - it is being formed, but what else can I check?
And how do you know which browser an application is using?
The browser built into the tablet does not show its name. "Browser" and that's it :-) Especially since there is no version.
Android 4.2.1.
Thank you.
apk

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question