Note that there are some explanatory texts on larger screens.

plurals
  1. POphonegap - cross platform way of getting default music folders on smartphones
    primarykey
    data
    text
    <p>im trying to get the default music folders for all phonegap supported platforms. basically i can download and save file on the sdcard using the function below. but i want to add code to detect platform and give me default music folders for platform so as i can save mp3 file there.</p> <pre><code> function downloadFile(remoteloc,new_name,userid,mid,errorbox,origname) { window.requestFileSystem( LocalFileSystem.PERSISTENT, 0, function onFileSystemSuccess(fileSystem) { fileSystem.root.getFile( "dummy.html", {create: true, exclusive: false}, function gotFileEntry(fileEntry) { var sPath = fileEntry.fullPath.replace("dummy.html",""); var fileTransfer = new FileTransfer(); fileEntry.remove(); $('#'+errorbox).html("&lt;div&gt;"+origname+"&lt;/div&gt;&lt;div class=\"progress progress-danger progress-striped\"&gt;&lt;div id='id_p' class=\"bar\" style=\"width: 5%\"&gt;&lt;/div&gt;&lt;/div&gt;"); fileTransfer.onprogress = function(progressEvent) { if (progressEvent.lengthComputable) { $('#id_p').css('width',Math.ceil((progressEvent.loaded / progressEvent.total)*100)+"%"); } else { } } fileTransfer.download( remoteloc, sPath + new_name, function(theFile) { $('#'+errorbox).html("&lt;div&gt;"+origname+"&lt;/div&gt;&lt;div class=\"alert alert-info fade in\"&gt;&lt;button class=\"close\" data-dismiss=\"alert\"&gt;&lt;span class=\"awe-remove-circle\"&gt;&lt;/span&gt;&lt;/button&gt;Download Complete. Added to Media Player&lt;/div&gt;" +"&lt;div&gt;&lt;a href='"+theFile.toURI()+"' target='_blank' class=\"btn btn-success\"&gt;Play Song&lt;/a&gt;&lt;/div&gt;"+"&lt;br/&gt;"+theFile.toURI()); //update the database field to show file has been transfered if (!isOnline()) { $('#error_box').html("&lt;div class=\"alert alert-error fade in\"&gt;&lt;button class=\"close\" data-dismiss=\"alert\"&gt;&lt;span class=\"awe-remove-circle\"&gt;&lt;/span&gt;&lt;/button&gt;Sorry but you seem to be offline.&lt;/div&gt;"); return; } var request={'controller':'music','action':'updatedownload','userid':userid,'mid':mid}; queryAPI(request,function (d){ //check result and set local storage variables if (d.success&gt;0) { } else { } localStorage.removeItem('resume'); window.key=false; //setTimeout(function () {$('#'+errorbox).html("&lt;div&gt;"+origname+"&lt;/div&gt;");},3000); }); }, function(error) { $('#'+errorbox).html("&lt;div&gt;"+origname+"&lt;/div&gt;&lt;div class=\"alert alert-error fade in\"&gt;&lt;button class=\"close\" data-dismiss=\"alert\"&gt;&lt;span class=\"awe-remove-circle\"&gt;&lt;/span&gt;&lt;/button&gt;Download Error! Error code:"+error.code+"&lt;/div&gt;"); } ); }, fail); }, fail); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload