For the Android app that I’m working on I have to do some lengthly sqlite queries, and it was making my code hard to follow. Is there any way I can put the queries into an XML file and then load them from there?
I’m attempting to do something similar to this.
You could create an XML file like the one you linked to under the
res/xml/directory, or use theres/raw/directory and store it in some other format of your choosing. Then read the resource in as you normally would with Android, parse it if necessary, and interact with your database directly by usingSQLiteDatabase.execSQL.For specifics, it really depends on your needs and application architecture.