开发者

Trying to pull API into LinearLayout Android APP

I am a beginner of Android apps and am using Eclipse. I have found some larger samples of pulling APIs but I cannot find a simple one to get started with. I simply want to pull from an XML file on the web (by using an API KEY) and throw it in a LinearLayout (Vertical). I can then go from the开发者_开发百科re, anyone know of any? Below is a sample of my XML:

<xmldata>
 <Products>
   <ProductCode>ITI-GR12</ProductCode>
   <ProductName>Granada 9-3/4" Narrow Rim Platter</ProductName>
   <ProductPrice>64.4000</ProductPrice>
 </Products>
</xmldata>


I am assuming you are looking for mechanisms which help you to parse XML and extract data from it...Voila here is a link to get you started with different ways of doing it...

http://www.ibm.com/developerworks/opensource/library/x-android/

Good luck!


your question is not easy as you will have quite a lot of programming to achieve what you want.

Here are the steps :

  1. read your data using sax
  2. fill a data structure of your own (build a class, data members will be filled by previous parsing)
  3. build an activity, use a layout you define to show all UI fields you think you need to display your data
  4. fill the content of each view using the data structure you filled on step 2.

If you are a beginner, I suggest you first understand steps 3 and 4, having fun with UIs, then try to understand how you could download your file, parse it and fill some data class to provide content for the views.

Regards, Stéphane

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜