{"id":6413,"date":"2014-01-03T14:01:21","date_gmt":"2014-01-03T06:01:21","guid":{"rendered":"http:\/\/mynotes.org\/tech\/?p=6413"},"modified":"2014-04-28T10:41:55","modified_gmt":"2014-04-28T02:41:55","slug":"%e5%88%a9%e7%94%a8phonegap%e5%8f%8a%e5%a4%96%e6%8e%9b%e7%a8%8b%e5%bc%8f%ef%bc%8c%e5%9c%a8%e5%8a%a0%e8%8f%b2%e8%b2%93%e6%bc%ab%e7%95%ab%e7%9a%84android-app%e5%8a%a0%e5%85%a5%e6%aa%94%e6%a1%88%e7%ae%a1","status":"publish","type":"post","link":"https:\/\/mynotes.org\/tech\/2014\/01\/03\/6413.htm","title":{"rendered":"\u5229\u7528phonegap\u53ca\u5916\u639b\u7a0b\u5f0f\uff0c\u5728\u52a0\u83f2\u8c93\u6f2b\u756b\u7684android app\u52a0\u5165\u6a94\u6848\u7ba1\u7406\u529f\u80fd"},"content":{"rendered":"<p>\u5728\u5beb\u52a0\u83f2\u8c93\u6f2b\u756b\u96e2\u7dda\u95b1\u8b80android app\u7684\u6642\u5019\uff0c\u9047\u5230\u4e00\u500b\u6a94\u6848\u5bb9\u91cf\u7684\u554f\u984c\u3002\u65bc\u662f\u5e0c\u671b\u5728\u61c9\u7528\u7a0b\u5f0f\u88e1\u9762\u52a0\u5165\uff1a\u4e0b\u8f09\u6a94\u6848\u3001\u89e3\u58d3\u7e2e\u6a94\u6848\u3001\u548c\u522a\u9664\u6a94\u6848\u7684\u529f\u80fd\u3002\u7d93\u904e\u9577\u6642\u9593\u7684\u641c\u5c0b\uff0c\u7d42\u65bc\u627e\u5230\u5229\u7528phonegap\u7684\u89e3\u58d3\u7e2eapi\u4f86\u89e3\u58d3\u7e2e\u6a94\u6848\u3001\u5229\u7528\u5167\u5efa\u7684file api\u4f86\u4e0b\u8f09\u6a94\u6848\u3001\u5229\u7528\u4e00\u6bb5java script\u4f86\u522a\u9664\u6a94\u6848\uff0c\u5b8c\u6210\u4e86\u6211\u7684\u9700\u6c42\u3002<\/p>\n<p><!--more--><\/p>\n<p>phonegap\u662f\u4e00\u500b\u53ef\u4ee5\u628a\u7db2\u9801\u6539\u5beb\u6210\u61c9\u7528\u7a0b\u5f0f\u7684\u5957\u4ef6\uff0c\u6240\u4ee5\u6211\u628a\u5b83\u62ff\u4f86\u5beb\u52a0\u83f2\u8c93\u6f2b\u756b\u96e2\u7dda\u95b1\u8b80\u7684android app\u3002\u4f46\u662f\u52a0\u83f2\u8c93\u6f2b\u756b\u7684\u6a94\u6848\u4e00\u5e74\u4efd\u5927\u7d0420~25MB\uff0c\u6240\u4ee5\u4e00\u958b\u59cb\u6211\u7528\u7dda\u4e0a\u7684phonegap build\u529f\u80fd\u6642\u5c31\u9047\u5230\u4e8615MB\u7684\u9650\u5236\u3002\u5f8c\u4f86\u6539\u7528eclipse+android sdk\u7684\u684c\u4e0a\u74b0\u5883\u914d\u5408phonegap\uff0c\u82b1\u4e86\u597d\u591a\u6642\u9593\u7d42\u65bc\u641e\u5b9a\uff0c\u6c92\u60f3\u5230google apk\u5c45\u7136\u670950MB\u7684\u9650\u5236!!\u96d6\u7136google\u76ee\u524d\u958b\u653e\u5169\u500b\u64f4\u5145\u6a94\u53ef\u4ee5\u589e\u52a0\u52304G\u7684\u5bb9\u91cf\uff0c\u4f46\u662f\u6211\u627e\u4e0d\u5230\u770b\u5f97\u61c2\u7684\u6559\u5b78\uff0c\u53ea\u597d\u653e\u68c4\u9019\u500b\u65b9\u6cd5\u3002<\/p>\n<p>\u7531\u65bc\u52a0\u83f2\u8c93\u6f2b\u756b\u7684\u6a94\u6848\u5927\u5c0f\uff0c\u5982\u679c\u628a10\u5e74\u4efd\u4e00\u6b21\u653e\u9032\u8edf\u9ad4\u88e1\uff0c\u6a94\u6848\u5c31\u6703\u6709200\u591aMB\uff0c\u9019\u6a23\u7a0b\u5f0f\u672a\u514d\u4e5f\u592a\u5927\u3002\u65bc\u662f\u6211\u6253\u5f9e\u4e00\u958b\u59cb\u5c31\u60f3\u8981\u628a\u61c9\u7528\u7a0b\u5f0f\u52a0\u5165&#8221;\u4e0b\u8f09\u6a94\u6848&#8221;\u8ddf&#8221;\u522a\u9664\u6a94\u6848&#8221;\u7684\u529f\u80fd\uff0c\u8b93\u4f7f\u7528\u8005\u53ef\u4ee5\u81ea\u5df1\u6c7a\u5b9a\u8981\u5728\u624b\u6a5f\u88e1\u653e\u591a\u5c11\u6a94\u6848\u5e36\u8457\u8d70\u96a8\u8eab\u770b\uff0c\u770b\u5b8c\u4e86\u9084\u53ef\u4ee5\u522a\u9664\u3002\u7531\u65bc\u4e00\u5e74\u4efd\u7684\u6a94\u6848\u81f3\u5c11\u6709300\u591a\u500b\uff0c\u6240\u4ee5\u6211\u9700\u8981\u5148\u628a\u6a94\u6848\u6253\u5305\uff0c\u90a3\u5c31\u9084\u9700\u8981\u4e00\u500b\u89e3\u58d3\u7e2e\u6a94\u6848\u7684\u529f\u80fd\u3002\u53ea\u662f\u6211\u8a66\u904e\u5f88\u591a\u7db2\u8def\u4e0a\u7684\u65b9\u6cd5\u90fd\u4e0d\u6210\u529f\uff0c\u7b2c\u4e00\u500b\u8a66\u6210\u529f\u7684\u662f\u5f9e\u7db2\u8def\u4e0b\u8f09\u6a94\u6848\u7684\u529f\u80fd\u3002<\/p>\n<p><strong>\u4e00\u3001\u6a94\u6848\u4e0b\u8f09\u5132\u5b58\u529f\u80fd<\/strong><br \/>\n1.\u5728html\u6a94\u7684head\u6a19\u7c64\u4e4b\u9593<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n        &lt;script type=&quot;text\/javascript&quot; src=&quot;cordova-2.3.0.js&quot;&gt;&lt;\/script&gt;\r\n        &lt;script type=&quot;text\/javascript&quot; src=&quot;xui-2.3.2.min.js&quot;&gt;&lt;\/script&gt;\r\n        &lt;script type=&quot;text\/javascript&quot;&gt;\r\n               var downloadDirectory;\r\n               document.addEventListener(&quot;deviceready&quot;, onDeviceReady, true);\r\n            function onDeviceReady() {\r\n               window.requestFileSystem(\r\n               LocalFileSystem.PERSISTENT,\r\n               0,\r\n               onFileSystemSuccess,\r\n               null\r\n               );\r\n               x$('#download_btn').on( 'click', function(e) {\r\n               download();\r\n               });\r\n               }\r\n            function onFileSystemSuccess(fileSystem) {\r\n               fileSystem.root.getDirectory('\/you\/dir',\r\n               {create:true},\r\n            function(dir) {\r\n               downloadDirectory = dir;\r\n               },fail);\r\n               }\r\n            function download() {\r\n               var fileURL = document.getElementById('file_url').value;\r\n               var localFileName = getFilename(fileURL);\r\n               x$('#message').html('Downloading' + localFileName);\r\n               var fileTransfer = new FileTransfer();\r\n            fileTransfer.onprogress = function(result){\r\n                 var percent =  result.loaded \/ result.total * 100;\r\n                 percent = Math.round(percent);\r\n                 x$('#message').html('Downloaded:  ' + percent + '%');    \r\n            };\r\n               fileTransfer.download(\r\n               fileURL,\r\n               downloadDirectory.fullPath + '\/' + localFileName,\r\n               function(entry){\r\n               x$('#message').html('Download complete. File saved to: ' +\r\n               entry.fullPath);\r\n               },\r\n               function(error){\r\n               alert(&quot;Download error source &quot; + JSON.stringify(error));\r\n               }\r\n               );\r\n               }\r\n            function getFilename(url) {\r\n               if (url) {\r\n               var m = url.toString().match(\/.*\\\/(.+?)\\.\/);\r\n               if (m &amp;&amp; m.length &gt; 1) {\r\n               return m&#x5B;1] + '.' + url.split('.').pop();\r\n               }\r\n               }\r\n               return &quot;&quot;;\r\n               }\r\n               function fail(error) {\r\n               $('#message').html(\r\n               'We encountered a problem: ' + error.code);\r\n               }\r\n        &lt;\/script&gt;\r\n<\/pre>\n<p>\u4e0a\u9762\u7a0b\u5f0f\u78bc\u7684\u7b2c18\u884c\u53ef\u4ee5\u8f38\u5165\u4f60\u8981\u5132\u5b58\u6a94\u6848\u7684\u4f4d\u7f6e\u3002<\/p>\n<p>2014.01.06\u52a0\u5165\u7b2c29~33\u884c\uff0c\u986f\u793a\u4e0b\u8f09\u9032\u5ea6\u3002<br \/>\n\u53c3\u8003\u4f5c\u6cd5\u4f86\u6e90\uff1a<a href=\"https:\/\/gist.github.com\/coryjthompson\/4052684\">https:\/\/gist.github.com\/coryjthompson\/4052684<\/a><\/p>\n<p>2.\u5728body\u6a19\u7c64\u4e4b\u9593\u8f38\u5165\u4e0b\u9762\u5167\u5bb9<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;input type=&quot;text&quot;\r\nid=&quot;file_url&quot; value=&quot;&quot; \/&gt;\r\n&lt;input type=&quot;button&quot;\r\nid=&quot;download_btn&quot; value=&quot;Download&quot; \/&gt;\r\n&lt;div id=&quot;message&quot;&gt;&lt;\/div&gt;\r\n<\/pre>\n<p>3.\u57f7\u884c\u7d50\u679c\u5982\u4e0b\u5716<br \/>\n<a href=\"http:\/\/mynotes.org\/tech\/wp-content\/uploads\/2014\/01\/11.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/mynotes.org\/tech\/wp-content\/uploads\/2014\/01\/11-300x165.png\" alt=\"download function\" width=\"300\" height=\"165\" class=\"aligncenter size-medium wp-image-6416\" srcset=\"https:\/\/mynotes.org\/tech\/wp-content\/uploads\/2014\/01\/11-300x165.png 300w, https:\/\/mynotes.org\/tech\/wp-content\/uploads\/2014\/01\/11-500x275.png 500w, https:\/\/mynotes.org\/tech\/wp-content\/uploads\/2014\/01\/11.png 783w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>4.xui.js.2.3.2\u7684<a href=\"http:\/\/www.mattgifford.co.uk\/downloads\/xui.js.2.3.2.zip\">\u4e0b\u8f09\u7db2\u5740<\/a>\uff0c<a href=\"http:\/\/mynotes.org\/tech\/wp-content\/uploads\/2014\/01\/xui.js.2.3.2.zip\">\u5099\u4efd\u8f09\u9ede<\/a>\u3002<\/p>\n<p>5.\u8cc7\u6599\u4f86\u6e90\uff1a<a href=\"http:\/\/www.amazon.com\/PhoneGap-Mobile-Application-Development-Cookbook\/dp\/1849518580\" target=\"_blank\">PhoneGap Mobile Application Development Cookbook<\/a>, P.47-51<\/p>\n<p>6.\u53e6\u5916\u4e00\u500b\u597d\u7528\u7684\u4f8b\u5b50\uff0c\u9084\u5305\u542b\u76f4\u63a5\u64ad\u653emp3\u7684\u529f\u80fd\uff0c\u4f46\u662f\u5132\u5b58\u6a94\u6848\u4f4d\u7f6e\u7684\u8a2d\u5b9a\u6211\u4e0d\u559c\u6b61\u3002<br \/>\n\u7db2\u5740\uff1a<a href=\"http:\/\/www.raymondcamden.com\/index.cfm\/2013\/5\/1\/Using-the-Progress-event-in-PhoneGap-file-transfers\">http:\/\/www.raymondcamden.com\/index.cfm\/2013\/5\/1\/Using-the-Progress-event-in-PhoneGap-file-transfers<\/a><\/p>\n<p>\u628a\u4ee5\u4e0b\u7a0b\u5f0f\u78bc\u5b58\u6210download_process.js<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\ndocument.addEventListener('deviceready', deviceready, false);\r\n \r\nvar buttomDom;\r\nvar statusDom;\r\nvar fileSystem;\r\n \r\nfunction deviceready() {\r\n    console.log('dv ready');\r\n  \r\n\t\/\/step one is to request a file system\t\r\n\twindow.requestFileSystem(LocalFileSystem.TEMPORARY, 0, \r\n\t\tfunction(fs) {\r\n\t\t\tfileSystem = fs;\r\n\t\r\n\t\t\tbuttonDom = document.querySelector('#startDl');\r\n\t\t\tbuttonDom.addEventListener('touchend', startDl, false);\r\n\t\t\tbuttonDom.removeAttribute(&quot;disabled&quot;);\r\n\t\r\n\t\t\tstatusDom = document.querySelector('#status');\r\n\t\t}, function(e) {\r\n\t\t\talert('failed to get fs');\r\n\t\t\talert(JSON.stringify(e));\r\n\t\t});\r\n}\r\n \r\nfunction startDl() {\r\n    buttonDom.setAttribute(&quot;disabled&quot;,&quot;disabled&quot;);\r\n\t\r\n    var ft = new FileTransfer();\r\n    var uri = encodeURI(&quot;http:\/\/archive.org\/download\/Kansas_Joe_Memphis_Minnie-When_Levee_Breaks\/Kansas_Joe_and_Memphis_Minnie-When_the_Levee_Breaks.mp3&quot;);\r\n \r\n\tvar downloadPath = fileSystem.root.fullPath + &quot;\/download.mp3&quot;;\r\n \r\n\tft.onprogress = function(progressEvent) {\r\n\t\tif (progressEvent.lengthComputable) {\r\n\t\t\tvar perc = Math.floor(progressEvent.loaded \/ progressEvent.total * 100);\r\n\t\t\tstatusDom.innerHTML = perc + &quot;% loaded...&quot;;\r\n\t\t} else {\r\n\t\t\tif(statusDom.innerHTML == &quot;&quot;) {\r\n\t\t\t\tstatusDom.innerHTML = &quot;Loading&quot;;\r\n\t\t\t} else {\r\n\t\t\t\tstatusDom.innerHTML += &quot;.&quot;;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\t\t\t\t\t\t\r\n\tft.download(uri, downloadPath, \r\n\tfunction(entry) {\r\n\t\tstatusDom.innerHTML = &quot;&quot;;\r\n\t\tvar media = new Media(entry.fullPath, null, function(e) { alert(JSON.stringify(e));});\r\n\t\tmedia.play();\r\n\t\t\r\n\t}, \r\n\tfunction(error) {\r\n\t\talert('Crap something went wrong...');\t\r\n\t});\r\n\t\t\r\n\t\r\n}\r\n<\/pre>\n<p>\u4e0b\u9762\u662fhtml\u6a94\u7684\u5beb\u6cd5<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n    &lt;head&gt;\r\n        &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text\/html; charset=UTF-8&quot; \/&gt;\r\n        &lt;meta name = &quot;format-detection&quot; content = &quot;telephone=no&quot;\/&gt;\r\n        &lt;meta name=&quot;viewport&quot; content=&quot;user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width&quot; \/&gt;\r\n        &lt;link rel=&quot;stylesheet&quot; type=&quot;text\/css&quot; href=&quot;css\/index.css&quot; \/&gt;\r\n        &lt;title&gt;FileTransfer Test&lt;\/title&gt;\r\n    &lt;\/head&gt;\r\n    &lt;body&gt;\r\n \r\n        &lt;div id=&quot;content&quot;&gt;\r\n            &lt;p&gt;\r\n            Kansas Joe McCoy and Memphis Minnie \u2013 &quot;When The Levee Breaks&quot;\r\n            &lt;\/p&gt;\r\n \r\n  \t\t&lt;img src=&quot;img\/KansasJoeAndMemphisMinnie.jpg&quot;&gt;\r\n\t\t\t\r\n            &lt;p&gt;\r\n            &lt;button id=&quot;startDl&quot; disabled&gt;Click to Download and Play&lt;\/button&gt;\r\n            &lt;\/p&gt;\r\n        &lt;\/div&gt;\r\n\t\t\r\n\t&lt;div id=&quot;status&quot;&gt;&lt;\/div&gt;\r\n        \r\n        &lt;script type=&quot;text\/javascript&quot; src=&quot;cordova-2.3.0.js&quot;&gt;&lt;\/script&gt;\r\n        &lt;script type=&quot;text\/javascript&quot; src=&quot;download_process.js&quot;&gt;&lt;\/script&gt;\r\n    &lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>\u7b2c\u4e8c\u9801\uff1a\u89e3\u58d3\u7e2e\u6a94\u6848\u529f\u80fd<br \/>\n\u7b2c\u4e09\u9801\uff1a\u6a94\u6848\uff08\u76ee\u9304\uff09\u522a\u9664\u529f\u80fd<br \/>\n<!--nextpage--><\/p>\n<p>\u4e8c\u3001\u89e3\u58d3\u7e2e\u6a94\u6848\u529f\u80fd<br \/>\n1.\u89e3\u58d3\u7e2e\u529f\u80fd\u662f\u6839\u64daVishal Rajpal\u6240\u63d0\u4f9b\u7684\u7a0b\u5f0f\u6240\u5beb\uff0c\u8cc7\u6599\u4f86\u6e90\u70ba\uff1a<a href=\"http:\/\/vishal-rajpal.blogspot.tw\/2012\/02\/phonegap-android-plugin-to-extract.html\">\u4f5c\u8005\u90e8\u843d\u683c<\/a>\u3001<a href=\"https:\/\/github.com\/vishalrajpal\/PhoneGap-ZipFile-Plugin-2.3.0\">\u7a0b\u5f0f\u78bc<\/a>\uff08\u9069\u7528phonegap 2.3.0\u3001<a href=\"http:\/\/mynotes.org\/tech\/wp-content\/uploads\/2014\/01\/PhoneGap-ZipFile-Plugin-2.3.0-master.zip\">\u5099\u7528\u4e0b\u8f09<\/a>\uff09\u3001<a href=\"http:\/\/nattawat-nonsung.blogspot.tw\/2013\/11\/android-plugin-to-extract-zip-file-in.html\">\u7a0b\u5f0f\u78bc<\/a>\uff08\u672a\u6e2c\u8a66\u3001\u9069\u7528phonegap 3.0\uff09\u3002<\/p>\n<p>2.\u89e3\u58d3\u7e2e\u4e0a\u9762\u7684\u6a94\u6848\uff0c\u628asrc\u76ee\u9304\u8907\u88fd\u5230\u5c08\u6848\u5167\uff0c\u5408\u4f75\u539f\u672c\u7684src\u76ee\u9304\u5167\u5bb9\u3002<\/p>\n<p>3.\u89e3\u58d3\u7e2e\u904e\u5f8c\u7684\u6a94\u6848\u4e2d\u6709\u500bwww\u7684\u8cc7\u6599\u593e\uff0c\u8907\u88fd\u5230\u5c08\u6848\u4e2d\u7684assets\u76ee\u9304\u4e4b\u4e0b\uff0c\u88e1\u9762\u6709\u53ef\u4ee5\u904b\u4f5c\u7684\u7bc4\u4f8b\u3002<\/p>\n<p>4.\u5728res\u8cc7\u6599\u593e\u5167\u7684config.xml\u6a94\u6848\u5167\uff0c<\/p>\n<pre lang=\"html\"><plugins><\/pre>\n<p>\u6a19\u7c64\u4e0b\u9762\u52a0\u5165\u4e00\u884c\uff1a<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">&lt;plugin name=&quot;ExtractZipFilePlugin&quot; value=&quot;com.phonegap.plugin.ExtractZipFile.ExtractZipFilePlugin&quot; \/&gt;<\/pre>\n<p>5.\u5728index.html\u4e2d\u7684\u4e00\u884c<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">&lt;input type=&quot;button&quot; value=&quot;Extract Zip File&quot; onClick=&quot;extractFile('trynew\/UpdatedNew\/DHTML_AllFormTypes.zip');&quot;\/&gt;<\/pre>\n<p>\u5176\u4e2dtrynew\/UpdatedNew\/DHTML_AllFormTypes.zip\u662f\u8981\u89e3\u58d3\u7e2e\u7684\u6a94\u540d\u53ca\u8def\u5f91\uff0c\u5982\u679c\u6a94\u6848\u5ba4\u5728SD\u5361\u4e2d\uff0c\u53ef\u4ee5\u7528\/sdcard\/yourfilename.zip\u4f86\u4ee3\u66ff\u3002<\/p>\n<p>6.\u5176\u9918\u5c31\u5f9ewww\u8cc7\u6599\u593e\u4e2d\u7684index.html\u7bc4\u4f8b\u4f86\u6539\u5c31\u53ef\u4ee5\u4f7f\u7528\u4e86\u3002<\/p>\n<p>\u7b2c\u4e00\u9801\uff1a\u4e0b\u8f09\u6a94\u6848\u529f\u80fd<br \/>\n\u7b2c\u4e09\u9801\uff1a\u6a94\u6848\uff08\u76ee\u9304\uff09\u522a\u9664\u529f\u80fd<br \/>\n<!--nextpage--><\/p>\n<p>\u4e09\u3001\u6a94\u6848\uff08\u76ee\u9304\uff09\u522a\u9664\u529f\u80fd<br \/>\n1.\u7a0b\u5f0f\u78bc\uff08<a href=\"http:\/\/stackoverflow.com\/questions\/13355641\/phonegap-android-delete-directory\">\u4f86\u6e90<\/a>\uff09\uff1a<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nfunction ClearDirectory() {\r\n        window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onFileSystemSuccess, fail);\r\n        function fail(evt) {\r\n            alert(&quot;FILE SYSTEM FAILURE&quot; + evt.target.error.code);\r\n        }\r\n        function onFileSystemSuccess(fileSystem) {\r\n            fileSystem.root.getDirectory(\r\n                 &quot;yours\/dir\/ect\/ory&quot;,\r\n                {create : true, exclusive : false},\r\n                function(entry) {\r\n                entry.removeRecursively(function() {\r\n                    console.log(&quot;Remove Recursively Succeeded&quot;);\r\n                }, fail);\r\n            }, fail);\r\n        }\r\n    }\r\n<\/pre>\n<p>2.\u7b2c8\u884c\u662f\u8981\u522a\u9664\u7684\u76ee\u9304\u540d\u7a31\uff0c\u76ee\u9304\u5167\u7684\u6a94\u6848\u6703\u4e00\u4f75\u6e05\u9664\uff0c\u4e5f\u53ef\u4ee5\u8f38\u5165\u6a94\u6848\u540d\u7a31\uff0c\u522a\u9664\u4e00\u500b\u7279\u5b9a\u6a94\u6848\u3002<\/p>\n<p>3.\u6211\u628a\u7a0b\u5f0f\u78bc\u7684\u7b2c\u4e00\u884c\u6539\u6210<\/p>\n<pre lang=\"java\">function ClearDirectory(dirname) {<\/pre>\n<p>\u7b2c8\u884c\u6539\u6210<\/p>\n<pre lang=\"java\">dirname,<\/pre>\n<p>\u4e26\u5728html\u6a94\u4e2d\u52a0\u5165<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">&lt;input type=&quot;button&quot; value=&quot;delete directory or files&quot; onClick=&quot;ClearDirectory('directory_or_file_name');&quot;\/&gt;<\/pre>\n<p>\u7136\u5f8c\u628a\u8981\u522a\u9664\u7684\u76ee\u9304\u6216\u6a94\u540d\u53d6\u4ee3directory_or_file_name\u9019\u4e32\u5b57\u3002<\/p>\n<p>4.\u5b8c\u6210!!<\/p>\n<p>\u7b2c\u4e00\u9801\uff1a\u4e0b\u8f09\u6a94\u6848\u529f\u80fd<br \/>\n\u7b2c\u4e8c\u9801\uff1a\u89e3\u58d3\u7e2e\u6a94\u6848\u529f\u80fd<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u5beb\u52a0\u83f2\u8c93\u6f2b\u756b\u96e2\u7dda\u95b1\u8b80android app\u7684\u6642\u5019\uff0c\u9047\u5230\u4e00\u500b\u6a94\u6848\u5bb9\u91cf\u7684\u554f\u984c\u3002\u65bc\u662f\u5e0c\u671b\u5728\u61c9\u7528\u7a0b\u5f0f\u88e1\u9762\u52a0\u5165\uff1a\u4e0b\u8f09\u6a94 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","_links_to":"","_links_to_target":""},"categories":[126,131],"tags":[103,88,109,106,107,100,108],"class_list":["post-6413","post","type-post","status-publish","format-standard","hentry","category-android","category-app-android","tag-android0","tag-app","tag-delete-files","tag-download","tag-extract","tag-phonegap","tag-unzip"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mynotes.org\/tech\/wp-json\/wp\/v2\/posts\/6413","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mynotes.org\/tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mynotes.org\/tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mynotes.org\/tech\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mynotes.org\/tech\/wp-json\/wp\/v2\/comments?post=6413"}],"version-history":[{"count":17,"href":"https:\/\/mynotes.org\/tech\/wp-json\/wp\/v2\/posts\/6413\/revisions"}],"predecessor-version":[{"id":6526,"href":"https:\/\/mynotes.org\/tech\/wp-json\/wp\/v2\/posts\/6413\/revisions\/6526"}],"wp:attachment":[{"href":"https:\/\/mynotes.org\/tech\/wp-json\/wp\/v2\/media?parent=6413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mynotes.org\/tech\/wp-json\/wp\/v2\/categories?post=6413"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mynotes.org\/tech\/wp-json\/wp\/v2\/tags?post=6413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}