I've been stuck on this issue for a long time and can't seem to find a fix. I have a method where I want to retrieve the HTML source of a website, but every time I run the client.execute step, Eclipse outputs "Source not found". I can hit a breakpoint prior to that step and whether I try to "step over" that line or just hit "go" I still receive "Source not found". This is my method
private void getQuestions()
{
try
{
URI url = null;
try
{
url = new URI("http://google.com");
}
catch (URISyntaxException e)
{
e.printStackTrace();
}
HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet();
request.setURI(url);
// THIS LINE CAUSES SOURCE NOT FOUND
HttpResponse response = client.execute(request);
System.out.println("HttpResponse received");
}
catch (ClientProtocolException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
In my AndroidManifest.xml file I've also added the following prior to my tags
<uses-sdk
android:minSdkVersion="13"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET"/>
I've found some people with similar problems and tried their fixes with no success. I've added my application name to my source path and placed it above Default.
I've also moved my Application to be bottom of my build paths
I am running Eclipse IDE for Java Developers
Version: Juno Service Release 1