[android]_[primary]_[SDK Docs Reference API document open slow solution]

Source: Internet
Author: User


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]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.