hello everyone. i beginner in android &
java programming.
i'm trying build some weather report apps for Android.
i think (i do) the easiest way to modifying the WeatherReporter project from ebook Unlocking Android - A Developer’s Guide, Manning because the project are using API Yahoo Weather (those only works on US region only). instead of, i rather use other Weather API from www.worldweatheronline.com that available international weather report data.
1. the problem is i'm still beginning learning parsing XML data using package org.xml.sax as SAX handler for API worldweatheronline.com bean.
these the request URL format (to able accessing it, needed to register for free) :
sample :
http://www.worldweatheronline.com/feed/weather.ashx?q=singapore&format=xml&num_of_days=2&key=240001503b080202101211
(the key are my registered ID number, it required in every request)
then it gave XML data bean :
after i learning from some manual (because the site/owner API only gave .NET sample code, instead implemented in java),

i modify the Handler class to able working for API worldweatheronline.com
these are the code :
the every text data can be read it using getAttributeValue method.
i admit that the code doesn't work to read the API from.
but those code the best i know to resolve it or knowing other manual that have solution reading for those similar XML data.
i hope anyone can help to resolve these problem , at least the right way to read data x inside every element and on sub element :
and i hope someone gave manual reference with sample code to reading XML data for implemented in android/java.
the i want to ask how to pasing XML data from worldweatheronline.com
these are the XML data
2. next i want to ask how to change the
string link using local data from res/drawable/image.png instead downloading image from a web URL (from
http://go.to.web/weatherimages/image.png).
these are the code :
i've try change
by using
those i realize, it just gave integer value output because from generated class
how to change it to locally accessed as link URL name ?
or are able to mixed using cache handlers of sprites /drawables
i hope someone respond it sooner.
last, sorry for my bad english