[Simple-support] Error on using simplexml on android
Brought to you by:
niallg
|
From: Alex C. <mob...@gm...> - 2012-08-06 19:03:30
|
Hi for all.
I'm using the simplexml to write on android a simple class. I've followed
the tutorials on the site. Below is one of the classes I want to insert:
@Root(name="news-sites")
private class NewsSites{
@Element
private Site site = null;
@ElementList
private ArrayList<Site>siteList;
public NewsSites(){
siteList = new ArrayList<Site>(0);
}
public void addSite(Site site){
siteList.add(site);
}
}
Very simple. This is the way I insert:
try{
File file = new File(path+"/"+fileName);
Log.i("INFO", "1");
if(!file.exists()){
file = new File(path+"/"+fileName);
Log.i("INFO", "2");
//file.createNewFile();
Log.i("INFO", "3");
serializer.write(newsSites, file);
Log.i("INFO", "4");
}
Log.i("INFO", "WRITED");
}
But, this produces the following error.
08-06 15:57:56.832: I/dalvikvm(8861): Could not find method
javax.xml.stream.XMLInputFactory.createXMLEventReader, referenced from
method org.simpleframework.xml.stream.StreamProvider.provide
I believe it's because android doesn't have support for Stax. This is
strange because simpleframework, when compiled, needs stax jars.
Do I need to force the insertion of Stax?
|