Hello
I'm a beginner in developing android studio app for funny.
i'm looking for a simple solution to copy the content of web site in a android studio variable string
(could be a web page that contains only a string like "corpo" for istance

I wrote a html web page, and i put it in
www.giochipassatempo.altervista.org.

There, i wrote in body the word "corpo", in header the word "intestazione" and in the title the word "titolo": it would be enough for me understand how to copy one of those in a string variable in android studio)
does already exist an istruction let me to do that, or i have to import something?
I wrote following code, it has no syntax errors, but it doesn't work.
Because it always set in textView dat3 "ciao pippo", see down.
How is possible? Did i do any mistake ?


thank a lot franco.info






try {

URL url = new URL("www.giochipassatempo.altervista.org");
URLConnection yc = url.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream()));
String inputLine;
StringBuilder builder = new StringBuilder();
while ((inputLine = in.readLine()) != null)
builder.append(inputLine.trim());
in.close();
String htmlPage = builder.toString();
String versionNumber = htmlPage.replaceAll("\\<.*?>","");
dat3.setText(htmlPage+versionNumber);

}

catch (IOException ex){dat3.setText("ciao pippo");};