<div class="tbody m-tcol-c" id="tbody" style="font-family: 돋움, dotum, Helvetica, sans-serif; list-style: none; margin: 20px 0px 0px; padding: 0px; clear: both; line-height: 1.4; min-height: 80px; width: 743px; position: relative; overflow-y: hidden; z-index: 0; color: #666666; overflow-wrap: break-word; overflow-x: auto !important;">
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><span style="font-size: 10pt;">우선 안드로이드 어플에서 서버로 이미지 파일을 전송하게 하려면 서버측에서 이미지 파일을 받아서 저장해주는&nbsp;</span></p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><span style="font-size: 10pt;">프로그램이 필요하다.&nbsp;</span></p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><span style="font-size: 10pt;">&nbsp;</span></p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><span style="font-size: 10pt;">multipart/form-data 를 이용하면 파일을 업로드하는 프로그램을 작성할 수 있다.</span></p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><span style="font-size: 10pt;">&nbsp;com.oreilly.servlet 패키지의 MultipartRequest 클래스를 이용하여 쉽게 파일 업로드를&nbsp; 구현할 수 있다.</span><br /><font size="4"><a target="_blank" href="http://www.servlets.com/cos/cos-05Nov2002.zip" style="text-decoration-line: none;"><span style="font-size: 10pt;"></span></a><a href="http://www.servlets.com/cos/cos-05Nov2002.zip" target="_blank" style="text-decoration-line: none;">http://www.servlets.com/cos/cos-05Nov2002.zip</a></font><font size="4"><span style="font-size: 10pt;">&nbsp;사이트에서 cos-05Nov2002.zip 파일을 다운로드 받아서</span><br /><span style="font-size: 10pt;">압축을 풀어 cos.jar 파일을 &lt;Tomcat&gt;/common/lib&nbsp;에 복사합니다.&nbsp;&nbsp;&nbsp;</span><br /></font><font size="4"><span style="font-size: 10pt;">***************************************************************************</span></font></p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font size="4"></font><span style="font-size: 10pt;"></span></p>
   <table height="40" cellspacing="1" cellpadding="0" width="671" bgcolor="#b7bbb5" border="0">
      <tbody>
         <tr bgcolor="#f5f4e0">
            <td width="671" style="color: #666666;">
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font size="4"><span style="font-size: 10pt;">&lt;%@ page import="java.io.*,com.oreilly.servlet.*,com.oreilly.servlet.multipart.*"%&gt;</span></font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font size="4"><span style="font-size: 10pt;">&lt;% request.setCharacterEncoding("euc-kr"); %&gt;</span></font><span style="font-size: 10pt;">&nbsp;</span></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font size="4"><span style="font-size: 10pt;">&lt;html&gt;</span><br /><span style="font-size: 10pt;">&lt;head&gt;&lt;title&gt;upload test&lt;/title&gt;&lt;/head&gt;</span><br /><span style="font-size: 10pt;">&lt;body&gt;</span><br /><span style="font-size: 10pt;">&lt;h3&gt;파일 upload&lt;/h3&gt;</span></font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font size="4"></font><span style="font-size: 10pt;"></span></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font size="4"><span style="font-size: 10pt;">&lt;%&nbsp;&nbsp;</span><br /><span style="font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String dir=application.getRealPath("/upload");</span><br /><span style="font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; int max= 5*1024*1024;</span></font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font size="4"><span style="font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<font color="#009e25">//최대크기 max바이트, dir 디렉토리에 파일을 업로드하는 MultipartRequest<br /><span style="font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;//객체를 생성한다.</span></font></span><br /><span style="font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>&nbsp; MultipartRequest m = new MultipartRequest(request,dir,max,"UTF-8",</strong></span></font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font size="4"><strong><span style="font-size: 10pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new&nbsp; DefaultFileRenamePolicy());</span><br /></strong><span style="font-size: 10pt;">%&gt;</span></font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font class="Apple-style-span" size="2">&lt;jsp:forward page="vew.jsp"/&gt;</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font size="4"><span style="font-size: 10pt;">&lt;/body&gt;</span><br /><span style="font-size: 10pt;">&lt;/html&gt;</span></font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font size="4"><span style="font-size: 10pt;"></span></font>&nbsp;</p>
               </td>
            </tr>
         </tbody>
      </table>
   &nbsp;
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;</p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font size="4"></font><span style="font-size: 12pt;">&nbsp;view.jsp 파일을 다음과 같이 작성해서 업로드 된 이미지 파일을 확인해 본다.</span></p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><span style="font-size: 12pt;">&lt;body&gt;</span></p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><span style="font-size: 12pt;">&lt;img src="upload/image01.jpg"/&gt;&nbsp;</span></p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><span style="font-size: 12pt;">&lt;/body&gt;</span></p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><span style="font-size: 12pt;"><br /></span></p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><span style="font-size: 12pt;"><br /></span></p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><span style="font-size: 12pt;">안드로이드에서 MultipartRequest를 이용하여 이미지 파일을 전송하려면 프로젝트에&nbsp;</span></p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font class="Apple-style-span" size="3"><span class="Apple-style-span" style="line-height: 24px;">httpmime-4.0.3.jar</span></font></p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font class="Apple-style-span" size="3"><span class="Apple-style-span" style="line-height: 24px;">apache-mime4j-0.6.1.jar</span></font></p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font class="Apple-style-span" size="3"><span class="Apple-style-span" style="line-height: 24px;">commons-logging-1.1.1.jar</span></font></p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font class="Apple-style-span" size="3"><span class="Apple-style-span" style="line-height: 24px;">httpcore-4.0.1.jar&nbsp;</span></font></p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font class="Apple-style-span" size="3"><span class="Apple-style-span" style="line-height: 24px;">라이브러리를 추가해 주어야 한다.(첨부파일 다운로드 받으심 됨)</span></font></p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font class="Apple-style-span" size="3"><span class="Apple-style-span" style="line-height: 24px;"><br /></span></font></p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><span style="font-size: 12pt;">카메라를 이용해 사진을 찍고, 찍어진 사진은 일단 뷰로 화면에 표시되고, 화면에 표시되는 동안</span></p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><span style="font-size: 12pt;">이미지파일을 서버에 전송한뒤, 전송이 완료되면 다시 카메라를 이용해 사진을 찍을 수 있도록 한다.</span></p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><span style="font-size: 12pt;"></span>&nbsp;</p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><span style="font-size: 12pt;">먼저 CameraTestActivity 를 실행하기 위한 Layout</span></p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><span style="font-size: 12pt;"></span></p>
   <table height="40" cellspacing="1" cellpadding="0" width="671" bgcolor="#b7bbb5" border="0">
      <tbody>
         <tr bgcolor="#f5f4e0">
            <td width="671" style="color: #666666;">
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&lt;?xml version="1.0" encoding="utf-8"?&gt;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&lt;LinearLayout</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp;xmlns:android="http://schemas.android.com/apk/res/android"</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp;android:orientation="horizontal"</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp;android:layout_width="wrap_content"</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp;android:layout_height="wrap_content"&gt;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp;&lt;SurfaceView android:id="@+id/SurfaceView01"</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"></span>&nbsp;android:layout_marginTop="20dip"&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"></span>&nbsp;android:layout_width="300dp"&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"></span>&nbsp;android:layout_height="fill_parent"&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"></span>&nbsp;android:layout_gravity="center_horizontal"/&gt;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"></span>&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp;&lt;ImageView android:id="@+id/ImageView01"&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; android:layout_width="300dp"&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"></span>&nbsp;android:layout_height="fill_parent" /&gt;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&lt;/LinearLayout&gt;</p>
               <div style="font-family: inherit; font-size: inherit; list-style: none; margin: 0px; padding: 0px;"><br /></div>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;</p>
               </td>
            </tr>
         </tbody>
      </table>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;</p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><span style="font-size: 11pt;"></span>&nbsp;</p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><span style="font-size: 11pt;">카메라와 인터넷, 셔트를 사용하기 위한 AndroidManifest.xml 권한설정 및 Activity 등록</span></p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><span style="font-size: 11pt;"></span></p>
   <table height="40" cellspacing="1" cellpadding="0" width="671" bgcolor="#b7bbb5" border="0">
      <tbody>
         <tr bgcolor="#f5f4e0">
            <td width="671" style="color: #666666;">
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;&lt;activity android:name=".CameraTestActivity"</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;android:screenOrientation="landscape"/&gt;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><br /></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;&lt;uses-permission android:name="android.permission.CAMERA" /&gt;<br />&nbsp;&nbsp;&nbsp; &lt;uses-feature android:name="android.hardware.camera" /&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp; &lt;uses-feature android:name="android.hardware.camera.autofocus" /&gt;<br />&nbsp;&nbsp;&nbsp; &lt;uses-permission android:name="android.permission.INTERNET" /&gt;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;</p>
               </td>
            </tr>
         </tbody>
      </table>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;</p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><span style="font-size: 11pt;"></span>&nbsp;</p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><span style="font-size: 11pt;">카메라 촬영및 서버로 이미지 파일 업로드를 처리하는 Activity .&nbsp;</span></p>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><span style="font-size: 11pt;"></span></p>
   <table height="40" cellspacing="1" cellpadding="0" width="671" bgcolor="#b7bbb5" border="0">
      <tbody>
         <tr bgcolor="#f5f4e0">
            <td width="671" style="color: #666666;">
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">package kims.android.device.test;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><br /></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">import java.io.DataOutputStream;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">import java.net.HttpURLConnection;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">import java.net.URL;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><br /></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">import android.app.Activity;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">import android.graphics.Bitmap;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">import android.graphics.BitmapFactory;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">import android.hardware.Camera;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">import android.os.Bundle;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">import android.util.Log;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">import android.view.KeyEvent;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">import android.view.SurfaceHolder;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">import android.view.SurfaceView;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">import android.view.Window;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">import android.widget.ImageView;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">import android.widget.Toast;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">public class CameraTestActivity extends Activity {</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;private static final String TAG = "CameraTestActivity";</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;<font class="Apple-style-span" color="#009E25">&nbsp; &nbsp;// 카메라 제어</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;private Camera camera;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp;&nbsp;<font class="Apple-style-span" color="#009E25">&nbsp;// 촬영된 &nbsp;사진보기</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;private ImageView imageView;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;<font class="Apple-style-span" color="#009E25">// 처리중&nbsp;</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;private boolean inProgress;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;<font class="Apple-style-span" color="#009E25">//카메라에 찍힌 이미지 데이터</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;byte[] data;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;DataOutputStream dos;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;ImageView view;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;SurfaceView surfaceView;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><br /></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;<font class="Apple-style-span" color="#009E25">// 카메라 SurfaceView의 리스너</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;private SurfaceHolder.Callback surfaceListener =&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;new SurfaceHolder.Callback() {</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><br /></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<font class="Apple-style-span" color="#009E25">&nbsp;// SurfaceView가 생성되었을때 화면에 보여주기위한 초기화 작업을 수행</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font class="Apple-style-span" color="#009E25">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// 카메라를 오픈하고, 프리뷰의 위치를 설정한다.</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><br /></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;public void surfaceCreated(SurfaceHolder holder) {</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;camera = Camera.open();</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try {</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="Apple-tab-span" style="white-space: pre;"></span>camera.setPreviewDisplay(holder); &nbsp;<font class="Apple-style-span" color="#009E25">//카메라의 preview 설정</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} catch (Exception e) {</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.printStackTrace();</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><br /></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<font class="Apple-style-span" color="#009E25">// SurfaceView가 화면에 표시되지않을때(액티비티가 비활성화 될때)호출한다.</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;public void surfaceDestroyed(SurfaceHolder holder) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="Apple-tab-span" style="white-space: pre;"></span>camera.release();</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="Apple-tab-span" style="white-space: pre;"></span>camera = null;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<font class="Apple-style-span" color="#009E25">&nbsp; &nbsp;// surfaceCreate()가 호출된 다음 호출된다.</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font class="Apple-style-span" color="#009E25">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// 프리뷰의 크기를 설정하고 프리뷰 영상을 표시한다.</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;public void surfaceChanged(SurfaceHolder holder,</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int format,</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int width,</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int height) {</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<font class="Apple-style-span" color="#009E25">&nbsp;&nbsp;// 카메라의 파라메터 값을 가져와서 미리보기 크기를 설정 하고&nbsp;</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font class="Apple-style-span" color="#009E25">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="Apple-tab-span" style="white-space: pre;"></span>// 프리뷰를 보여준다.</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Camera.Parameters parameters =</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; camera.getParameters();</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;parameters.setPreviewSize(width, height);</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;camera.setParameters(parameters);</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;camera.startPreview();</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;};</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp;&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp;&nbsp;<font class="Apple-style-span" color="#009E25">&nbsp;// 카메라 셔트가 눌러질때&nbsp;</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;private Camera.ShutterCallback shutterListener =</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;new Camera.ShutterCallback() {</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;public void onShutter() {</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (camera != null &amp;&amp; inProgress == false) {</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;camera.takePicture(</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;shutterListener, &nbsp; &nbsp; &nbsp; &nbsp;// 셔터 후</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;null, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Raw 이미지 생성 후</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;picutureListener); &nbsp; &nbsp;// JPE 이미지 생성 후</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;inProgress = true;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;};</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><br /></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp;&nbsp; &nbsp; Bitmap bitmap;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp;&nbsp;<font class="Apple-style-span" color="#009E25">&nbsp;// JPEG 이미지를 생성 후 호출</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;private Camera.PictureCallback picutureListener =</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;new Camera.PictureCallback() {</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;public void onPictureTaken(byte[] data, Camera camera) {</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (data != null) {</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<font class="Apple-style-span" color="#009E25">&nbsp;&nbsp;// &nbsp;적용할 옵션이 있는 경우 BitmapFactory클래스의 Options()</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font class="Apple-style-span" color="#009E25">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// &nbsp;메서드로 옵션객체를 만들어 값을 설정하며</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font class="Apple-style-span" color="#009E25">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// &nbsp;이렇게 만들어진 옵션을 Bitmap 객체를 만들때 네번째</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font class="Apple-style-span" color="#009E25">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// &nbsp;아규먼트로 사용한다.</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font class="Apple-style-span" color="#009E25">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font class="Apple-style-span" color="#009E25">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// &nbsp;처리하는 이미지의 크기를 축소</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font class="Apple-style-span" color="#009E25">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// &nbsp;BitmapFactory.Options options =</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font class="Apple-style-span" color="#009E25">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// &nbsp; &nbsp; &nbsp;new BitmapFactory.Options();</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font class="Apple-style-span" color="#009E25">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// &nbsp;options.inSampleSize = IN_SAMPLE_SIZE;</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MainActivity.this.data=data;&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bitmap =&nbsp;BitmapFactory.decodeByteArray(data,</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0,</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;data.length,</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;null);</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<font class="Apple-style-span" color="#009E25">&nbsp;&nbsp;//이미지 뷰 이미지 설정</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;imageView.setImageBitmap(bitmap);</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;doSaveFile(); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<font class="Apple-style-span" color="#009E25">&nbsp;// sdcard에 파일 저장</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;doFileUpload(); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<font class="Apple-style-span" color="#009E25">//서버에 이미지를 전송하는 메서드 호출</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Toast.makeText(MainActivity.this, "서버에 파일을 성공적으로 전송하였습니다",</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Toast.LENGTH_LONG).show();</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;camera.startPreview(); &nbsp;&nbsp;<font class="Apple-style-span" color="#009E25">// 정지된 프리뷰를 재개</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;inProgress = false; &nbsp; &nbsp; &nbsp; &nbsp;<font class="Apple-style-span" color="#009E25">// 처리중 플래그를 끔</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;};</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; File saveFile=new File("/mnt/sdcard/image01.jpg"); &nbsp;&nbsp;<font class="Apple-style-span" color="#009E25">// 파일이 저장되는 경로 지정</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><font class="Apple-style-span" color="#009E25"><br /></font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; public void doSaveFile() {</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;<span class="Apple-tab-span" style="white-space: pre;"></span>&nbsp;&nbsp; &nbsp; &nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;<span class="Apple-tab-span" style="white-space: pre;"></span>&nbsp;&nbsp; OutputStream out = null;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;<span class="Apple-tab-span" style="white-space: pre;"></span>&nbsp;&nbsp; try {&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;<span class="Apple-tab-span" style="white-space: pre;"></span>&nbsp;&nbsp; saveFile.createNewFile();</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;<span class="Apple-tab-span" style="white-space: pre;"></span>&nbsp;&nbsp; &nbsp; &nbsp; out = new FileOutputStream(saveFile);&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;<span class="Apple-tab-span" style="white-space: pre;"></span>&nbsp;&nbsp; &nbsp; &nbsp; bitmap.compress(CompressFormat.JPEG, 70, out);</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><br /></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;<span class="Apple-tab-span" style="white-space: pre;"></span>&nbsp;&nbsp; } catch (Exception e) {&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;<span class="Apple-tab-span" style="white-space: pre;"></span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; e.printStackTrace();</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;<span class="Apple-tab-span" style="white-space: pre;"></span>&nbsp;&nbsp; } finally {</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;<span class="Apple-tab-span" style="white-space: pre;"></span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; try { out.close(); &nbsp;} catch (IOException e) {e.printStackTrace();}</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;<span class="Apple-tab-span" style="white-space: pre;"></span>&nbsp;&nbsp; }</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; }</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><br /></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; public void doFileUpload() {</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try {</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HttpClient httpClient = new DefaultHttpClient(); &nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; String url = "http://172.20.11.235:8080/web1/file.jsp";</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HttpPost post = new HttpPost(url);&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FileBody bin = new FileBody(saveFile);</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MultipartEntity multipart =&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="Apple-tab-span" style="white-space: pre;"></span>&nbsp;&nbsp;new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE); &nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;multipart.addPart("images", bin);&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; post.setEntity(multipart); &nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HttpResponse response = httpClient.execute(post); &nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HttpEntity resEntity = response.getEntity(); &nbsp;&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}catch(Exception e){e.printStackTrace();}</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;} &nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;@Override</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;public void onCreate(Bundle savedInstanceState) {</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;super.onCreate(savedInstanceState);</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;&nbsp;<font class="Apple-style-span" color="#009E25">&nbsp; &nbsp;// 액티비티의 타이틀이 안보이도록 설정한다.</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;requestWindowFeature(Window.FEATURE_NO_TITLE);</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;setContentView(R.layout.camera);</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;imageView = (ImageView) findViewById(R.id.ImageView01);</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;surfaceView =</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(SurfaceView) findViewById(R.id.SurfaceView01);</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;<font class="Apple-style-span" color="#009E25">&nbsp;// surface를 제어하는 SurfaceHolder</font>&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;SurfaceHolder holder = surfaceView.getHolder();</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<font class="Apple-style-span" color="#009E25">// SurfaceView 리스너를 등록</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;holder.addCallback(surfaceListener);</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<font class="Apple-style-span" color="#009E25">// 버퍼 사용하지 않음</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;}</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp;&nbsp;<font class="Apple-style-span" color="#009E25">&nbsp;// 키가 눌러졌을때 카메라 셔트가 눌러졌다고 이벤트 처리설정</font></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;@Override</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;public boolean onKeyDown(int keyCode, KeyEvent event) {</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp;// TODO Auto-generated method stub</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; if(event.getAction() == KeyEvent.ACTION_DOWN) {&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; switch(keyCode) {&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case KeyEvent.KEYCODE_CAMERA:&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;shutterListener.onShutter();</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return true;&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; }&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;&nbsp; &nbsp; return super.onKeyDown(keyCode,event);&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;}</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;"><br /></p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">}</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;</p>
               <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;<br /></p>
               </td>
            </tr>
         </tbody>
      </table>
   <p style="list-style: none; padding: 0px; font-size: inherit; font-family: inherit;">&nbsp;</p>
   </div>
<table role="presentation" cellspacing="0" class="tag_n_id tag_list_area" style="width: 743px; table-layout: fixed; border-width: 0px; border-style: initial; border-color: initial; padding-top: 40px; color: #000000; font-family: 돋움, dotum, Helvetica, sans-serif;">
   <tbody>
      <tr>
         <td class="tagarea" style="vertical-align: top; padding-right: 10px; margin-bottom: -20px;">
            <div class="autosourcing-stub" style="list-style: none; margin: 0px; padding: 0px; position: absolute; opacity: 0;">
               <p style="list-style: none; margin-top: 20px; margin-bottom: 30px; padding: 0px; font-family: dotum;"><strong style="padding: 0px 7px 0px 0px;">[출처]</strong>&nbsp;<a href="https://cafe.naver.com/sunschool/4408" target="_blank" style="text-decoration-line: none;">[안드로이드예제] 카메라로 찍은 사진(이미지파일)을 웹서버에 전송하는 프로그램예제 (썬스쿨(자바/안드로이드/보안))</a>&nbsp;<span style="padding: 0px 7px 0px 5px;">|</span><strong style="padding: 0px 7px 0px 0px;">작성자</strong><a href="https://cafe.naver.com/sunschool.cafe?iframe_url=/CafeMemberNetworkView.nhn%3Fm=view%26memberid=yskim511" target="_blank" style="text-decoration-line: none;">스플랜더</a></p>
               </div>
            </td>
         </tr>
      </tbody>
   </table>