Hey!
I'm building an app that goes to a website, grabs the source code and the searches stuff from it. The target website is a bus timetable site, which is a bit unpractical, so my plan is to find only certain elements and their contents and wrap the neatly in one textbox or list. I decided to use Jsoup as it seems to be pretty easy to use. The problem is that Jsoup.connect(url) doesn't work, but throws an error, whose message is null.

I have included the .jar file of the Jsoup successfully. There are no errors in the code, which is here:


public TKLReader(String url) {
//This is the constructor of the class (TKL is the name of the bus company)

        final String u = url;

//I put my connection statement inside a runnable
        Runnable r = new Runnable() {
            @Override
            public void run() {

                try {

                   
                    Document doc = Jsoup.connect(u).get(); //THIS HERE IS CAUSING THE PROBLEM
                    setHTML(doc); //This set the doc for later use of the app

                } catch(HttpStatusException e) {

Log.i(TAG, "An error occurred (httpstatus) (" + e.getMessage() + ")");

                } catch(IOException e) {

                    Log.i(TAG, "An error occurred (io) (" + e.getMessage() + ")");

                } catch(Exception e) {

                    Log.i(TAG, "An error occurred (casual) (" + e.getMessage() + ")");
//This message is always thrown, although I've handled couple of other exception //as as well

                }

            }
        };

        Thread t = new Thread(r);
        t.run(); //Here I run the runnable

    }


I've also included

<uses-permission android:name="android.permission.INTERNET" />

to my AndroidManifest.xml file.


Hopefully you understand what I'm asking here. Please ask for clarification if you need to.

Cheers!