How to call a json webservice through android

前端 未结 4 1059
不知归路
不知归路 2020-12-31 07:28

I need to access a .Net web service in Rest format using JSON. I m pretty new to this concept and very much confused about how this works.... Any one who can give an overvie

4条回答
  •  清歌不尽
    2020-12-31 07:36

    This is the simplest way to parse Json web servie

        String str="url";
        try{
            URL url=new URL(str);
            URLConnection urlc=url.openConnection();
            BufferedReader bfr=new BufferedReader(new InputStreamReader(urlc.getInputStream()));
            String line;
            while((line=bfr.readLine())!=null)
            {
            JSONArray jsa=new JSONArray(line);
            for(int i=0;i

    Mention Internet permission in android manifest

提交回复
热议问题