Page 210 - 3-2
P. 210

// Read Server Response
                                while ((line = reader.readLine()) != null) {
                                    sb.append(line);
                                    break;
                                }


                                Log.d(this.getClass().getName(), "php 온값: "+sb.toString());
                                return sb.toString();


                            } catch (Exception e) {
                                Log.d(this.getClass().getName(), "Exception: " + e.getMessage());
                                return new String("Exception: " + e.getMessage());
                            }
                        }
                    }
                    InsertData task = new InsertData();
                    task.execute(out_data);
                }
            }


              - MyService.java
            package kr.icehs.intec.smart_elevator;


            import android.app.Service;
            import android.content.Intent;
            import android.os.IBinder;
            import android.util.Log;


            import org.json.JSONArray;
            import org.json.JSONException;
            import org.json.JSONObject;


            import java.io.BufferedReader;
            import java.io.InputStreamReader;
            import java.net.HttpURLConnection;
            import java.net.URL;
            import java.util.Vector;


            public class MyService extends Service implements Runnable {
                static String c_l = null;
                static String t_l = null;
                int ja1;


                public void onCreate() {
                    Log.d(this.getClass().getName(), "onCreate");


                                                         - 210 -
   205   206   207   208   209   210   211   212   213   214   215