adinadinadin
New Member
Situation:
I am trying to export my SQLite Tables to a XML file and have followed this answer as well as this post here and also this question (apparently both last links from the same author )
Update-2: I already have another class named \[code\]DBAdapter\[/code\] which extends the \[code\]SQLiteOpenHelper\[/code\]. So I have this: \[code\]public DBAdapter(Context ctx) { this.context = ctx; DBHelper = new DatabaseHelper(context); } private static class DatabaseHelper extends SQLiteOpenHelper { DatabaseHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); }......onCreate()...onUpgrade()...}\[/code\] already in my DBAdapter class file. How can I reuse this?
Also, I tried passing as: DataXmlExporter dm = new DataXmlExporter(SQLiteDatabase Database(getReadableDatabase ())); But still got an error.
Update-1: I used the 2nd Link to implement my solution.
Problem: I am getting a Null Pointer Exception; I guess because I haven't initialized my object correctly.
At the time of calling the DataXmlExporter / exportData method what is supplied as parameter? :
\[code\]DataXmlExporter dm = new DataXmlExporter(WHAT_IS_PASSED_HERE?);\[/code\]
Thanks..
I am trying to export my SQLite Tables to a XML file and have followed this answer as well as this post here and also this question (apparently both last links from the same author )
Update-2: I already have another class named \[code\]DBAdapter\[/code\] which extends the \[code\]SQLiteOpenHelper\[/code\]. So I have this: \[code\]public DBAdapter(Context ctx) { this.context = ctx; DBHelper = new DatabaseHelper(context); } private static class DatabaseHelper extends SQLiteOpenHelper { DatabaseHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); }......onCreate()...onUpgrade()...}\[/code\] already in my DBAdapter class file. How can I reuse this?
Also, I tried passing as: DataXmlExporter dm = new DataXmlExporter(SQLiteDatabase Database(getReadableDatabase ())); But still got an error.
Update-1: I used the 2nd Link to implement my solution.
Problem: I am getting a Null Pointer Exception; I guess because I haven't initialized my object correctly.
At the time of calling the DataXmlExporter / exportData method what is supplied as parameter? :
\[code\]DataXmlExporter dm = new DataXmlExporter(WHAT_IS_PASSED_HERE?);\[/code\]
Thanks..