相关疑难解决方法(0)

外部库会使应用程序变慢吗?

我正在构建一个从网页上抓取信息的应用程序.为此,我选择使用名为Jsoup的html scraper,因为它使用起来非常简单.Jsoup还依赖于Apache Commons Lang libray.(他们一起共计385kB).所以Jsoup将用于下载页面并解析它.

我的问题是,如果使用这些简化库而不是使用Androids内置库,是否会使我的应用程序变慢?(在下载数据和解析方面).

我在想,内部库将针对Android进行优化.

java performance android jsoup

5
推荐指数
2
解决办法
1606
查看次数

必须导入哪些包?

import java.io.*;
import java.net.URL;
import java.net.URLConnection;
import java.sql.*;  
public class linksfind{
public static void main(){
    String html = "http://www.apple.com/pr/";
    Document document = Jsoup.parse(html); // Can also take an URL.
    for (Element element : document.getElementsByTag("a")) {
        System.out.println(element.attr("href"));
}
}
}
Run Code Online (Sandbox Code Playgroud)

伙计们,在上面的程序中,在执行时我发现了这些错误.怎么解决?我已经在我的文件夹位置下载了Jsoup.jar文件.我还该怎么办?

linksfind.java:8: cannot find symbol
symbol  : class Document
location: class linksfind
    Document document = Jsoup.parse(html); // Can also take a
    ^
linksfind.java:8: cannot find symbol
symbol  : variable Jsoup
location: class linksfind
    Document document = Jsoup.parse(html); // Can also take …
Run Code Online (Sandbox Code Playgroud)

java jsoup

4
推荐指数
1
解决办法
8523
查看次数

标签 统计

java ×2

jsoup ×2

android ×1

performance ×1