Scene:
1. Download the SDK when the Docs/reference document is downloaded, the document is in HTML form, because it contains Google's relevant URLs, the browser will be opened to visit these walls of the URL, so the display is huge slow.
2. The solution is to traverse the subdirectory to delete Google-related URLs, because Android development, it is implemented in Java.
3. The following run time 9 minutes, i5 dual core, 4G memory, open something else, the latest SDK docs,android 5L.
File. Cleaner.java
Import java.io.*;p ublic class cleaner{public static void Main (string[] args) {System.out.println ("begin to clean google.c Om;googleapis.com;google-analytics.com "); String currentdir = args[0]; Cleaner C = new Cleaner (); C.work (Currentdir); System.out.println ("End to clean google.com;googleapis.com;google-analytics.com");} Public Cleaner () {}public void work (String currentdir) {File File = new file (currentdir);d eletereference (File);} public void deletereference (file file) {string[] files = file.list (); String path = File.getpath (); for (string one:files) {string filePath = path+file.separatorchar+one;//System.out.println (FilePath); File Filetemp = new file (FilePath), if (Filetemp.isdirectory ()) {deletereference (filetemp);} else{//Delete Google Referenceif (Filepath.endswith (". html")) {try{bufferedreader br = new BufferedReader (new InputStreamReader (New FileInputStream (filetemp), "UTF-8")); FilePath = filepath+ ". tmp"; File NewFile = new file (FilePath); BufferedWriter bw = new BufferedWriter (New OutputstreaMwriter (New FileOutputStream (NewFile), "UTF-8")); String line = Null;while (line = Br.readline ()) = null) {String newLine = Line.replaceall ("google\\.com|googleapis\\.com |google-analytics\\.com "," "); Bw.write (newLine); Bw.newline ();} Br.close (); Bw.close (); Filetemp.delete (); Newfile.renameto (filetemp);} catch (Exception e) {e.printstacktrace ();}}}}}
Compile execution:
C:\users\admin\desktop>javac Cleaner.java & Java Cleaner E:\software\adt\sdk\docs\referencebegin to clean Google.com;googleapis.com;google-analytics.comend to clean google.com;googleapis.com;google-analytics.com
[android]_[primary]_[SDK Docs Reference API document open slow solution]