Hi everyone,
I am new here. I came to here for searching an answer. My problem is getting html content from a website. I need to get code as a string. I tried many codes for this. My latest code is below.
Also i added to internet permission to manifest file
twicerik is a textview.
When I tried to run this application it writes nothing on twicerik. Also cannot catch any error on twicerik. Can anybody help me ?
I am new here. I came to here for searching an answer. My problem is getting html content from a website. I need to get code as a string. I tried many codes for this. My latest code is below.
Code:
try
{
URL url = new URL(myURL);
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
String str;
String cumle = "";
while ((str = in.readLine()) != null){
cumle += str;
}
twicerik.setText(cumle);
in.close();
}
catch (Exception ex)
{
twicerik.setText(ex.getMessage());
}
Code:
<uses-permission android:name="android.permission.INTERNET" />
When I tried to run this application it writes nothing on twicerik. Also cannot catch any error on twicerik. Can anybody help me ?
Last edited: