Page 187 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 187

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;



            public  class  MainActivity  extends  Activity  {


                  String  myJSON;


                  private  static  final  String  TAG_RESULTS="result";

                  private  static  final  String  TAG_ID  =  "id";
                  private  static  final  String  TAG_NAME = "name";

                  private  static  final  String  TAG_ADD  ="address";


                  JSONArray  peoples  =  null;


                  ArrayList<HashMap<String,  String>>  personList;


                  ListView  list;


                  @Override
                  protected  void  onCreate(Bundle  savedInstanceState)  {

                        super.onCreate(savedInstanceState);
                        setContentView(R.layout.activity_main);

                        list  =  (ListView)  findViewById(R.id.listView);
                        personList = new ArrayList<HashMap<String,String>>();  //배열  선언,  관리  용이함(키값  부

            여)
                        getData("http://192.168.0.7/getdata.php");   //서버에  있는  php페이지  호출




                                                         -  180  -
   182   183   184   185   186   187   188   189   190   191   192