English 中文(简体)
甲型六氯环己烷
原标题:problem in xml parsing and showing data in android application
  • 时间:2011-07-06 09:46:04
  •  标签:
  • android

我正在开发一种甲状腺应用,在这种应用中,我不得不将数据从尿液中分出来,并在清单中显示。 我已把acc升成样本代码。 我将主要班级扩大到违约的手递班。 并使用主角、起端和终点标。 我将acc升至低于代码

 HttpClient httpclient = new DefaultHttpClient();
     HttpPost httppost = new HttpPost("http://asia.vmsc.vmsplay.com/vmsc.asmx/GetCountries");

     // Add your data
      List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
         nameValuePairs.add(new BasicNameValuePair("AccountId","vmsfree48jfwe83dwe8"));
         nameValuePairs.add(new BasicNameValuePair("Countries","US"));
        // nameValuePairs.add(new BasicNameValuePair("Language","en"));
         UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(nameValuePairs);
         httppost.setEntity(formEntity);

     // Execute HTTP Post Response
     HttpResponse response = httpclient.execute(httppost);
     InputStream is = response.getEntity().getContent(); 

     SAXParserFactory factory = SAXParserFactory.newInstance();
        SAXParser parser = factory.newSAXParser();
        XMLReader reader = parser.getXMLReader();
        MyXMLHandler myXMLHandler = new MyXMLHandler();
        reader.setContentHandler(myXMLHandler);
        reader.parse(new InputSource(is));          
        sitesList = MyXMLHandler.sitesList;

        countryname=new String[sitesList.getisocountrycode().size()];
        isocountrycode =new String[sitesList.getisocountrycode().size()];
        countrycode=new String[sitesList.getisocountrycode().size()];
        idd=new String[sitesList.getisocountrycode().size()];
        image=new String[sitesList.getisocountrycode().size()];
        image1=new String[sitesList.getisocountrycode().size()];


        for (int j = 0; j < sitesList.getisocountrycode().size(); j++) {
            countryname[j] = sitesList.getcountryname().get(j);
            System.out.println(" id "+sitesList.getcountryname().get(j));
            isocountrycode[j]=sitesList.getisocountrycode().get(j);
            System.out.println("title "+sitesList.getisocountrycode().get(j));
            countrycode[j] = sitesList.getcountrycode().get(j);
            System.out.println("desc "+sitesList.getcountrycode().get(j));
            idd[j] = sitesList.getProductcount().get(j);
            System.out.println("prociunt "+sitesList.getProductcount().get(j));
            image[j] = sitesList.getidd().get(j);
            System.out.println("image "+sitesList.getidd().get(j));
            System.out.println("image length  "+sitesList.getidd().get(j).length());
            image1[j] = sitesList.getImage1().get(j);
            System.out.println("image1 "+sitesList.getImage1().get(j));

但是,我仍没有获得我所描述的数据,

Can anyone tell where I have done wrong

Thanks in advance Tushar

最佳回答

it s not good thing to publish you confidentiality in public site. second thing is that you have to call this http://asia.vmsc.vmsplay.com/vmsc.asmx?op=GetCountries and pass your parameter then after http://asia.vmsc.vmsplay.com/vmsc.asmx/GetCountries then after you can get value from it. always keep habit to print responce in logcat and then you judge that " post this issue to any site or not".

问题回答

贵重参数“国家”的改动是什么。 在公开论坛上发表你的信仰者,这并不是一种良好做法。





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签