@@ -0,0 +1,1697 @@
+public class MainActivity extends AppCompatActivity%0A%7B%0A%09public static String defaultUrl = %22http://m.naver.com%22;%0A%09Handler handler = new Handler();%0A%0A%09public void onCreate(Bundle savedInstanceState)%0A%09%7B%0A%09%09requestBtn.setOnClickListener(new View.OnClickListener()%7B%0A%09%09%09public void onClick(View v)%0A%09%09%09%7B%0A%09%09%09%09String urlStr = input01.getText().toString();%0A%0A%09%09%09%09ConnectThread thread = new ConnectThread(urlStr);%0A%09%09%09%09thread.start();%0A%09%09%09%7D%0A%09%09%7D);%0A%09%7D%0A%7D%0A%0Aclass ConnectThread extends Thread%0A%7B%0A%09String urlStr;%0A%0A%09public ConnectThread(String inStr)%0A%09%7B%0A%09%09urlStr = inStr;%0A%09%7D%0A%0A%09public void run()%0A%09%7B%0A%09%09try%0A%09%09%7B%0A%09%09%09final String output = request(urlStr);%0A%09%09%09handler.post(new Runnable()%7B%0A%09%09%09%09public void run()%0A%09%09%09%09%7B%0A%09%09%09%09%09txtMsg.setText(output);%0A%09%09%09%09%7D%0A%09%09%09%7D);%0A%09%09%7D%0A%09%09catch(Exception ex)%0A%09%09%7B%0A%09%09%09ex.printStackTrace();%0A%09%09%7D%0A%09%7D%0A%0A%09private String request(String urlStr)%0A%09%7B%0A%09%09StringBuilder output = new StringBuilder();%0A%09%09try%0A%09%09%7B%0A%09%09%09URL url = new URL(urlStr);%0A%0A%09%09%09HttpURLConnection conn = (HttpURLConnection)url.openConnection();%0A%09%09%09if(conn != NULL)%0A%09%09%09%7B%0A%09%09%09%09conn.setConnectTimeout(10000);%0A%09%09%09%09conn.setRequestMethod(%22GET%22);%0A%09%09%09%09conn.setDoInput(true);%0A%09%09%09%09conn.setDoOutput(true);%0A%0A%09%09%09%09int resCode = conn.getResponseCode();%0A%09%09%09%09if(resCode == HttpURLConnection.HTTP_OK)%0A%09%09%09%09%7B%0A%09%09%09%09%09BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));%0A%09%09%09%09%09String line = null;%0A%09%09%09%09%09while(true)%0A%09%09%09%09%09%7B%0A%09%09%09%09%09%09line = reader.readLine();%0A%09%09%09%09%09%09if(line == null)%0A%09%09%09%09%09%09%09break;%0A%09%09%09%09%09%09output.append(line + %22%5Cn%22);%0A%09%09%09%09%09%7D%0A%09%09%09%09%09reader.close();%0A%09%09%09%09%09conn.disconnect();%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%09%09catch(Exception ex)%0A%09%09%7B%0A%09%09%09Log.e(%22SampleHTTP%22, %22Exception in processing response.%22, ex);%0A%09%09%09ex.printStackTrace();%0A%09%09%7D%0A%09%09return output.toString();%0A%09%7D%0A%7D

Add httpSampleMainActivity.java