Page 284 - 3-3
P. 284

}
                      //http url 을 불러오기 위한 객체 생성
                      GetDataJSON g = new GetDataJSON();
                      g.execute(url);
                  }
              }


              자) DB4.java
              package layout;


              // 불러올 클래스들을 import       해준다
              import android.content.Context;
              import android.content.Intent;
              import android.os.AsyncTask;
              import android.os.Bundle;
              import android.support.annotation.Nullable;
              import android.support.v4.app.Fragment;
              import android.view.LayoutInflater;
              import android.view.View;
              import android.view.ViewGroup;
              import android.widget.ListAdapter;
              import android.widget.ListView;
              import android.widget.SimpleAdapter;


              import com.helloworld.smartschool.R;


              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.ArrayList;
              import java.util.HashMap;


              //DB4  클래스
              public class DB4 extends Fragment {


                  //Context  생성
                  Context ct;


                  //DB  변수 생성
                  String myJSON;


                                                        - 284 -
   279   280   281   282   283   284   285   286   287   288   289