public void updateDatabase(){
                XmlPullParser parser = Xml.newPullParser();
                try{
                        InputStream stream = getInputStream();
                        parser.setInput(stream, null);
                        int eventType = parser.getEventType();
                        //parse xml
                        //write data to database

                }catch(Exception e){
                        Log.e("omg",""+e.getMessage());
                }
        }

        private InputStream getInputStream() {
                try {
                        final String xmlDataUrl="http://path/data.xml";;
                        URL feedUrl = new URL(xmlDataUrl);
                        return feedUrl.openConnection().getInputStream();
                } catch (Exception e) {
                        Log.d("omg",""+e.getMessage());
                        throw new RuntimeException(e);
                }
        }

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to