private
class DownloadText extends Thread {
public
void run() {
StringBuilder text
= new StringBuilder();
text.append("");
try{
URL url = new
URL("http://.../version.txt");
HttpURLConnection
conn = (HttpURLConnection)url.openConnection();
if(conn !=
null)
{
conn.setConnectTimeout(1000);
// 1초 동안 인터넷 연결을 실패할경우 Fall 처리
conn.setUseCaches(false);
if(conn.getResponseCode()
== HttpURLConnection.HTTP_OK){
BufferedReader
br = new BufferedReader(
new
InputStreamReader(conn.getInputStream()));
for(;;){
String line =
br.readLine();
if(line ==
null) break;
text.append(line
+ "\n");
}
br.close();
}
conn.disconnect();
}
}
catch(Exception
ex){}
result =
text.toString();
}
}
public
void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.about);
DownloadText downloadtext = new DownloadText();
downloadtext.start();
}